Vulkan on X11: vkGetPhysicalDeviceSurfaceCapabilitiesKHR error

匿名 (未验证) 提交于 2019-12-03 01:06:02

问题:

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).

回答1:

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.



回答2:

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.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!