Commit cb02a48f authored by Connor Abbott's avatar Connor Abbott
Browse files

tu: Correctly preserve old push descriptor contents

We were never setting set->size, so we were always copying 0 bytes. But
as we only copy the contents when the layout and therefore the size is
the same, we don't have to take the old size into account anyway.

This fixes some VK_EXT_robustness2 tests that use push descriptors.

Fixes: 6d4f33e4 ("turnip: initial implementation of VK_KHR_push_descriptor")
Part-of: <mesa/mesa!7573>
parent c68ea960
......@@ -1806,7 +1806,7 @@ void tu_CmdPushDescriptorSetKHR(VkCommandBuffer commandBuffer,
/* preserve previous content if the layout is the same: */
if (set->layout == layout)
memcpy(set_mem.map, set->mapped_ptr, MIN2(set->size, layout->size));
memcpy(set_mem.map, set->mapped_ptr, layout->size);
set->layout = layout;
set->mapped_ptr = set_mem.map;
......@@ -1845,7 +1845,7 @@ void tu_CmdPushDescriptorSetWithTemplateKHR(
/* preserve previous content if the layout is the same: */
if (set->layout == layout)
memcpy(set_mem.map, set->mapped_ptr, MIN2(set->size, layout->size));
memcpy(set_mem.map, set->mapped_ptr, layout->size);
set->layout = layout;
set->mapped_ptr = set_mem.map;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment