vulkan: initialize discardRectangleCount even if the state is dynamic
Only the array of rectangles should be dynamic.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18015>
diff --git a/src/vulkan/runtime/vk_graphics_state.c b/src/vulkan/runtime/vk_graphics_state.c
index 2ca8dfc..164526b 100644
--- a/src/vulkan/runtime/vk_graphics_state.c
+++ b/src/vulkan/runtime/vk_graphics_state.c
@@ -403,11 +403,11 @@
if (dr_info == NULL)
return;
+ assert(dr_info->discardRectangleCount <= MESA_VK_MAX_DISCARD_RECTANGLES);
dr->mode = dr_info->discardRectangleMode;
+ dr->rectangle_count = dr_info->discardRectangleCount;
if (!IS_DYNAMIC(DR_RECTANGLES)) {
- assert(dr_info->discardRectangleCount <= MESA_VK_MAX_DISCARD_RECTANGLES);
- dr->rectangle_count = dr_info->discardRectangleCount;
typed_memcpy(dr->rectangles, dr_info->pDiscardRectangles,
dr_info->discardRectangleCount);
}