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: 6d4f33e ("turnip: initial implementation of VK_KHR_push_descriptor")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7573>
(cherry picked from commit cb02a48f83)
This commit is contained in:
Connor Abbott 2020-11-10 16:54:07 +01:00 committed by Dylan Baker
parent 2a7ad92fc5
commit 14c0c1a2b1
2 changed files with 3 additions and 3 deletions

View file

@ -634,7 +634,7 @@
"description": "tu: Correctly preserve old push descriptor contents",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"master_sha": null,
"because_sha": "6d4f33e469b301b2fc4f398f62c81ef66f9150be"
},

View file

@ -1807,7 +1807,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;
@ -1846,7 +1846,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;