wsi: move an assertion in wsi_xxx_surface_get_capabilities2()

Hit this with vulkaninfo on X11, probably a vulkaninfo bug. Though
moving the assertion doesn't hurt.

Fixes: be0dcbdfa2 ("wsi/x11: Implement EXT_swapchain_maintenance1.")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21722>
This commit is contained in:
Samuel Pitoiset 2023-03-06 08:40:03 +01:00 committed by Marge Bot
parent c3cc8455d4
commit 0ed28d2715
4 changed files with 4 additions and 4 deletions

View file

@ -987,10 +987,10 @@ wsi_display_surface_get_capabilities2(VkIcdSurfaceBase *icd_surface,
case VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_COMPATIBILITY_EXT: {
/* We only support FIFO. */
assert(present_mode);
VkSurfacePresentModeCompatibilityEXT *compat = (void *)ext;
if (compat->pPresentModes) {
if (compat->presentModeCount) {
assert(present_mode);
compat->pPresentModes[0] = present_mode->presentMode;
compat->presentModeCount = 1;
}

View file

@ -1077,9 +1077,9 @@ wsi_wl_surface_get_capabilities2(VkIcdSurfaceBase *surface,
case VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_COMPATIBILITY_EXT: {
/* Can easily toggle between FIFO and MAILBOX on Wayland. */
assert(present_mode);
VkSurfacePresentModeCompatibilityEXT *compat = (void *)ext;
if (compat->pPresentModes) {
assert(present_mode);
VK_OUTARRAY_MAKE_TYPED(VkPresentModeKHR, modes, compat->pPresentModes, &compat->presentModeCount);
/* Must always return queried present mode even when truncating. */
vk_outarray_append_typed(VkPresentModeKHR, &modes, mode) {

View file

@ -257,11 +257,11 @@ wsi_win32_surface_get_capabilities2(VkIcdSurfaceBase *surface,
case VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_COMPATIBILITY_EXT: {
/* Unsupported, just report the input present mode. */
assert(present_mode);
VkSurfacePresentModeCompatibilityEXT *compat =
(VkSurfacePresentModeCompatibilityEXT *)ext;
if (compat->pPresentModes) {
if (compat->presentModeCount) {
assert(present_mode);
compat->pPresentModes[0] = present_mode->presentMode;
compat->presentModeCount = 1;
}

View file

@ -771,10 +771,10 @@ x11_surface_get_capabilities2(VkIcdSurfaceBase *icd_surface,
case VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_COMPATIBILITY_EXT: {
/* To be able to toggle between FIFO and non-FIFO, we would need a rewrite to always use FIFO thread
* mechanism. For now, only return the input, making this effectively unsupported. */
assert(present_mode);
VkSurfacePresentModeCompatibilityEXT *compat = (void *)ext;
if (compat->pPresentModes) {
if (compat->presentModeCount) {
assert(present_mode);
compat->pPresentModes[0] = present_mode->presentMode;
compat->presentModeCount = 1;
}