Mesa (staging/19.2): anv: fix vkUpdateDescriptorSets with inline uniform blocks

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Oct 21 16:18:07 UTC 2019


Module: Mesa
Branch: staging/19.2
Commit: 425fbe2902ba25df3e969d9410ae0c002f015235
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=425fbe2902ba25df3e969d9410ae0c002f015235

Author: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Date:   Fri Oct 18 14:50:02 2019 +0300

anv: fix vkUpdateDescriptorSets with inline uniform blocks

With inline uniform blocks descriptor, the meaning of descriptorCount
is a number of bytes to copy into the descriptor. Don't try to use
that size as an index into the descriptor table.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Fixes: 43f40dc7cb ("anv: Implement VK_EXT_inline_uniform_block")
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/issues/1195
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
(cherry picked from commit 3f8f52b241e3f8bf31344f52c2c8faa32b05e804)

---

 src/intel/vulkan/anv_descriptor_set.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/intel/vulkan/anv_descriptor_set.c b/src/intel/vulkan/anv_descriptor_set.c
index 23d6ddede5b..80a34695e08 100644
--- a/src/intel/vulkan/anv_descriptor_set.c
+++ b/src/intel/vulkan/anv_descriptor_set.c
@@ -1470,9 +1470,6 @@ void anv_UpdateDescriptorSets(
          &dst->descriptors[dst_layout->descriptor_index];
       dst_desc += copy->dstArrayElement;
 
-      for (uint32_t j = 0; j < copy->descriptorCount; j++)
-         dst_desc[j] = src_desc[j];
-
       if (src_layout->data & ANV_DESCRIPTOR_INLINE_UNIFORM) {
          assert(src_layout->data == ANV_DESCRIPTOR_INLINE_UNIFORM);
          memcpy(dst->desc_mem.map + dst_layout->descriptor_offset +
@@ -1481,6 +1478,9 @@ void anv_UpdateDescriptorSets(
                                     copy->srcArrayElement,
                 copy->descriptorCount);
       } else {
+         for (uint32_t j = 0; j < copy->descriptorCount; j++)
+            dst_desc[j] = src_desc[j];
+
          unsigned desc_size = anv_descriptor_size(src_layout);
          if (desc_size > 0) {
             assert(desc_size == anv_descriptor_size(dst_layout));




More information about the mesa-commit mailing list