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>
This commit is contained in:
Samuel Pitoiset 2022-08-09 15:01:28 +02:00
parent bb5d09da6c
commit 3f9450b4e5

View file

@ -403,11 +403,11 @@ vk_discard_rectangles_state_init(struct vk_discard_rectangles_state *dr,
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);
}