尽管重新配置,XCB window geometry/surface 维度似乎已过时
XCB window geometry/surface dimensions appear to be stale despite reconfigure
我在我自己的 windowing 抽象下的 XCB-provided window 表面上使用 Vulkan,但是在接收 [=48= 重新创建交换链时遇到了一个相当奇怪的行为] 重新配置事件 (XCB_CONFIGURE_NOTIFY
).
xcb_get_geometry
返回的值似乎保留为 window 的初始值。即,如果我在 (0,0) 处创建了一个范围为 640x480 的 window,将其拖动到屏幕上的其他位置并调整其大小 - xcb_get_geometry
返回的值仍将是 (0,0) 处的 640x480。我尝试显式刷新 window 并将其重新配置为其他值,以查看它是否只是事件被错误传递的情况 - 但即使我可以看到 window 在视觉上调整大小,xcb_get_geometry
还是老样子
突出显示的原因是验证层(下面附有实际消息)通知我我指定给 vkCreateSwapchain
的范围超出了根据 vkGetPhysicalDeviceSurfaceCapabilitiesKHR
的可接受值范围 - 也是 640x480尽管 window 在视觉上被调整了大小并且已经传递了调整大小事件。即使我在重新创建交换链之前明确地重新配置了 window,这也仍然存在。
我觉得我可能缺少某种我应该调用的 surface-resize 过程,或者我可能必须等待一帧才能调整大小,但我不确定。
代码很多,但我可以指出一些相关部分 - 都在 this repo.
下
genstone/genfx/genuwin.c:361
Event polling code - configuration requests are buffered into separate position and window events delivered on the two subsequent calls to the one where the event is actually processed.
genstone/genfx/gengfx.c:902
Swapchain recreation code - shouldn't be problematic as far as I can see and the issue does appear to be on the side of my XCB abstraction but probably better to share as much info as possible.
sandbox/sample/main.c:240
Handling of wrapped Genuwin event and dispatching call to gen_internal_vk_create_swapchain
.
发出此信号的验证错误(没有验证层提交 VkQueue
导致失败):
Fatal: Validation Error: Validation Error: [ VUID-VkSwapchainCreateInfoKHR-imageExtent-01274 ] Object 0: handle = 0x62d000168450, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x7cd0911d | vkCreateSwapchainKHR() called with imageExtent = (792,605), which is outside the bounds returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR(): currentExtent = (640,480), minImageExtent = (640,480), maxImageExtent = (640,480). The Vulkan spec states: imageExtent must be between minImageExtent and maxImageExtent, inclusive, where minImageExtent and maxImageExtent are members of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageExtent-01274)
Trace: frame #0: 0x0x7f4c9a0afa00 gen_internal_vk_debug_callback() genstone/genfx/gengfx.c
Trace: frame #1: 0x0x7f4c9a0b33e0 gen_internal_vk_create_swapchain() genstone/genfx/gengfx.c
Trace: frame #2: 0x0x7f4c9a0baaa0 gen_gfx_targetable_geometry_update() genstone/genfx/gengfx.c
Trace: frame #3: 0x0x563b13ebcbc0 main() sandbox/sample/main.c
回溯遗漏了任何不是我使用的代码,但你明白了。
我正在使用 XCB 1.15-1(根据 pacman
),并且我已经对我使用的所有 Vulkan“东西”进行了子模块化(验证层、headers、加载程序),所以它们是他们的行李箱都是最新的(在我发帖的时候)。
找到了。您确实通过在 window 上选择 XCB_EVENT_MASK_RESIZE_REDIRECT
来制作 window non-resizable:https://github.com/Th3T3chn0G1t/Genstone/blob/c8759b6687bb83045b8fe58b03c2575276940ca7/genstone/genfx/genuwin.c#L741-L743
因此,您只会收到 ResizeRequest 事件,而不会实际调整大小,请参阅:https://www.x.org/releases/X11R7.6/doc/xproto/x11protocol.html#events:ResizeRequest
整个事件掩码看起来像“这严重需要一些换行符以提高可读性”,但也像“我只是选择存在的每个事件”。我建议只询问您真正感兴趣的事件。只需选择一个已经有 side-effects 的事件,而 ResizeRedirect 并不是唯一的此类事件掩码。
我找到了 https://github.com/Th3T3chn0G1t/Genstone/blob/c8759b6687bb83045b8fe58b03c2575276940ca7/genstone/genfx/genuwin.c#L394-L722 and it looks like you are only interested in few of the events. You can find which event mask you need for which event on https://www.x.org/releases/X11R7.6/doc/xproto/x11protocol.html。
我在我自己的 windowing 抽象下的 XCB-provided window 表面上使用 Vulkan,但是在接收 [=48= 重新创建交换链时遇到了一个相当奇怪的行为] 重新配置事件 (XCB_CONFIGURE_NOTIFY
).
xcb_get_geometry
返回的值似乎保留为 window 的初始值。即,如果我在 (0,0) 处创建了一个范围为 640x480 的 window,将其拖动到屏幕上的其他位置并调整其大小 - xcb_get_geometry
返回的值仍将是 (0,0) 处的 640x480。我尝试显式刷新 window 并将其重新配置为其他值,以查看它是否只是事件被错误传递的情况 - 但即使我可以看到 window 在视觉上调整大小,xcb_get_geometry
还是老样子
突出显示的原因是验证层(下面附有实际消息)通知我我指定给 vkCreateSwapchain
的范围超出了根据 vkGetPhysicalDeviceSurfaceCapabilitiesKHR
的可接受值范围 - 也是 640x480尽管 window 在视觉上被调整了大小并且已经传递了调整大小事件。即使我在重新创建交换链之前明确地重新配置了 window,这也仍然存在。
我觉得我可能缺少某种我应该调用的 surface-resize 过程,或者我可能必须等待一帧才能调整大小,但我不确定。
代码很多,但我可以指出一些相关部分 - 都在 this repo.
下
genstone/genfx/genuwin.c:361
Event polling code - configuration requests are buffered into separate position and window events delivered on the two subsequent calls to the one where the event is actually processed.
genstone/genfx/gengfx.c:902
Swapchain recreation code - shouldn't be problematic as far as I can see and the issue does appear to be on the side of my XCB abstraction but probably better to share as much info as possible.
sandbox/sample/main.c:240
Handling of wrapped Genuwin event and dispatching call togen_internal_vk_create_swapchain
.
发出此信号的验证错误(没有验证层提交 VkQueue
导致失败):
Fatal: Validation Error: Validation Error: [ VUID-VkSwapchainCreateInfoKHR-imageExtent-01274 ] Object 0: handle = 0x62d000168450, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x7cd0911d | vkCreateSwapchainKHR() called with imageExtent = (792,605), which is outside the bounds returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR(): currentExtent = (640,480), minImageExtent = (640,480), maxImageExtent = (640,480). The Vulkan spec states: imageExtent must be between minImageExtent and maxImageExtent, inclusive, where minImageExtent and maxImageExtent are members of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageExtent-01274)
Trace: frame #0: 0x0x7f4c9a0afa00 gen_internal_vk_debug_callback() genstone/genfx/gengfx.c
Trace: frame #1: 0x0x7f4c9a0b33e0 gen_internal_vk_create_swapchain() genstone/genfx/gengfx.c
Trace: frame #2: 0x0x7f4c9a0baaa0 gen_gfx_targetable_geometry_update() genstone/genfx/gengfx.c
Trace: frame #3: 0x0x563b13ebcbc0 main() sandbox/sample/main.c
回溯遗漏了任何不是我使用的代码,但你明白了。
我正在使用 XCB 1.15-1(根据 pacman
),并且我已经对我使用的所有 Vulkan“东西”进行了子模块化(验证层、headers、加载程序),所以它们是他们的行李箱都是最新的(在我发帖的时候)。
找到了。您确实通过在 window 上选择 XCB_EVENT_MASK_RESIZE_REDIRECT
来制作 window non-resizable:https://github.com/Th3T3chn0G1t/Genstone/blob/c8759b6687bb83045b8fe58b03c2575276940ca7/genstone/genfx/genuwin.c#L741-L743
因此,您只会收到 ResizeRequest 事件,而不会实际调整大小,请参阅:https://www.x.org/releases/X11R7.6/doc/xproto/x11protocol.html#events:ResizeRequest
整个事件掩码看起来像“这严重需要一些换行符以提高可读性”,但也像“我只是选择存在的每个事件”。我建议只询问您真正感兴趣的事件。只需选择一个已经有 side-effects 的事件,而 ResizeRedirect 并不是唯一的此类事件掩码。
我找到了 https://github.com/Th3T3chn0G1t/Genstone/blob/c8759b6687bb83045b8fe58b03c2575276940ca7/genstone/genfx/genuwin.c#L394-L722 and it looks like you are only interested in few of the events. You can find which event mask you need for which event on https://www.x.org/releases/X11R7.6/doc/xproto/x11protocol.html。