From f2b642dff3c8f9e7f70ed4af30d2b7bd4daa388d Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Wed, 20 Apr 2022 19:29:08 +0300 Subject: [PATCH] anv: fix acceleration structure descriptor template writes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lionel Landwerlin Fixes: d258b0bf0e07 ("anv: Add support for binding acceleration structures") Reviewed-by: Tapani Pälli Part-of: (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 a6fc0abf673..2989b1d91ac 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -532,7 +532,7 @@ "description": "anv: fix acceleration structure descriptor template writes", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "because_sha": "d258b0bf0e072438fc9eb921c5335734e6794459" }, { diff --git a/src/intel/vulkan/anv_descriptor_set.c b/src/intel/vulkan/anv_descriptor_set.c index 2b5a1d5d4ff..9c007fb3845 100644 --- a/src/intel/vulkan/anv_descriptor_set.c +++ b/src/intel/vulkan/anv_descriptor_set.c @@ -1949,6 +1949,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; }