Mesa (staging/22.1): anv: fix acceleration structure descriptor template writes

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Apr 26 16:22:28 UTC 2022


Module: Mesa
Branch: staging/22.1
Commit: 12eb1548bd41461b784a91db36dccc768bb5db78
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=12eb1548bd41461b784a91db36dccc768bb5db78

Author: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Date:   Wed Apr 20 19:29:08 2022 +0300

anv: fix acceleration structure descriptor template writes

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Fixes: d258b0bf0e07 ("anv: Add support for binding acceleration structures")
Reviewed-by: Tapani Pälli <tapani.palli at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16058>
(cherry picked from commit b7828f56ba9fb885b998da55ada38d9c038bc8a5)

---

 .pick_status.json                     |  2 +-
 src/intel/vulkan/anv_descriptor_set.c | 13 +++++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/.pick_status.json b/.pick_status.json
index 991041d2e23..13e188092fd 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -589,7 +589,7 @@
         "description": "anv: fix acceleration structure descriptor template writes",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "d258b0bf0e072438fc9eb921c5335734e6794459"
     },
diff --git a/src/intel/vulkan/anv_descriptor_set.c b/src/intel/vulkan/anv_descriptor_set.c
index 97ad56fc43a..b72351c4cba 100644
--- a/src/intel/vulkan/anv_descriptor_set.c
+++ b/src/intel/vulkan/anv_descriptor_set.c
@@ -1956,6 +1956,19 @@ anv_descriptor_set_write_template(struct anv_device *device,
                                                       entry->array_count);
          break;
 
+      case VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR:
+         for (uint32_t j = 0; j < entry->array_count; j++) {
+            VkAccelerationStructureKHR *accel_obj =
+               (VkAccelerationStructureKHR *)(data + entry->offset + j * entry->stride);
+            ANV_FROM_HANDLE(anv_acceleration_structure, accel, *accel_obj);
+
+            anv_descriptor_set_write_acceleration_structure(device, set,
+                                                            accel,
+                                                            entry->binding,
+                                                            entry->array_element + j);
+         }
+         break;
+
       default:
          break;
       }



More information about the mesa-commit mailing list