From 53dfff1c4d95ee21661d86256f44eae26b985b50 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Thu, 9 May 2019 10:15:20 +0200 Subject: [PATCH] radv: fix setting the number of rectangles when it's dyanmic We need to know the number of rectangles. This fixes new CTS dEQP-VK.draw.discard_rectangles.dynamic_*. Fixes: 5db0bf99944 ("radv: Implement VK_EXT_discard_rectangles.") Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen --- src/amd/vulkan/radv_pipeline.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index 5383f00e754..f25a5f55bf5 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -1417,11 +1417,13 @@ radv_pipeline_init_dynamic_state(struct radv_pipeline *pipeline, const VkPipelineDiscardRectangleStateCreateInfoEXT *discard_rectangle_info = vk_find_struct_const(pCreateInfo->pNext, PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT); - if (states & RADV_DYNAMIC_DISCARD_RECTANGLE) { + if (needed_states & RADV_DYNAMIC_DISCARD_RECTANGLE) { dynamic->discard_rectangle.count = discard_rectangle_info->discardRectangleCount; - typed_memcpy(dynamic->discard_rectangle.rectangles, - discard_rectangle_info->pDiscardRectangles, - discard_rectangle_info->discardRectangleCount); + if (states & RADV_DYNAMIC_DISCARD_RECTANGLE) { + typed_memcpy(dynamic->discard_rectangle.rectangles, + discard_rectangle_info->pDiscardRectangles, + discard_rectangle_info->discardRectangleCount); + } } pipeline->dynamic_state.mask = states; -- 2.30.2