Vulkan on X11: vkGetPhysicalDeviceSurfaceCapabilit

2019-08-10 21:10发布

I am trying to get Vulkan running under X11.

I have (apparently) successfully created an instance, device and surface, and several calls relating to the surface also succeed, and even return reasonable values (for example vkGetPhysicalDeviceSurfaceFormatsKHR returns two formats). However, when I call vkGetPhysicalDeviceSurfaceCapabilitiesKHR, I get the following:

X Error of failed request:  BadDrawable (invalid Pixmap or Window parameter)
  Major opcode of failed request:  14 (X_GetGeometry)
  Resource id in failed request:  0x5800009
  Serial number of failed request:  42
  Current serial number in output stream:  42

The X11 Window is 0x5800009, as referenced in the error. I am using Vulkan SDK 1.0.5, and Nvidia 364.12 drivers (if that is relevant).

标签: c++ x11 vulkan
2条回答
混吃等死
2楼-- · 2019-08-10 21:31

On the hunch that Vulkan was querying something about the Window that had not yet been created, I put a XSync(<display>, false) call before this one, and that seems to have solved the issue.

I am not sure whether this is required for proper operation (I am not an X11 expert), or whether this is an issue with Vulkan itself. If somebody has a better explanation, I would love to hear it.

查看更多
We Are One
3楼-- · 2019-08-10 21:38

I had the same error on Linux with XCB and I resolved it (with the help of MuertoExcobito's answer) by calling xcb_flush after the window creation.

查看更多
登录 后发表回答