summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConnor Abbott <cwabbott0@gmail.com>2020-11-10 16:54:07 +0100
committerEric Engestrom <eric@engestrom.ch>2021-04-18 22:13:20 +0200
commit50b926566c31a21bf552cdd89e3ee29b960416de (patch)
tree16a8706daab3a000f7dfb4a45e543a229e2ab33d
parentb571fef9e2efacb63854d17e2c8486fc90c0668b (diff)
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 cb02a48f831da750c4124ea6fa7c95861a4f4609)
-rw-r--r--.pick_status.json2
-rw-r--r--src/freedreno/vulkan/tu_cmd_buffer.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/.pick_status.json b/.pick_status.json
index 906b50b2d30..c90d92ccdf8 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -958,7 +958,7 @@
"description": "tu: Correctly preserve old push descriptor contents",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": "6d4f33e469b301b2fc4f398f62c81ef66f9150be"
},
diff --git a/src/freedreno/vulkan/tu_cmd_buffer.c b/src/freedreno/vulkan/tu_cmd_buffer.c
index 26391605f23..db685707da7 100644
--- a/src/freedreno/vulkan/tu_cmd_buffer.c
+++ b/src/freedreno/vulkan/tu_cmd_buffer.c
@@ -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;