anv: fix acceleration structure descriptor template writes
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Wed, 20 Apr 2022 16:29:08 +0000 (19:29 +0300)
committerMarge Bot <emma+marge@anholt.net>
Mon, 25 Apr 2022 11:01:56 +0000 (11:01 +0000)
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: d258b0bf0e07 ("anv: Add support for binding acceleration structures")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16058>

src/intel/vulkan/anv_descriptor_set.c

index 97ad56f..b72351c 100644 (file)
@@ -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;
       }