anv: fix acceleration structure descriptor template writes

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: d258b0bf0e ("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>
(cherry picked from commit b7828f56ba)
This commit is contained in:
Lionel Landwerlin 2022-04-20 19:29:08 +03:00 committed by Dylan Baker
parent 20e3c2c717
commit f2b642dff3
2 changed files with 14 additions and 1 deletions

View file

@ -532,7 +532,7 @@
"description": "anv: fix acceleration structure descriptor template writes",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"because_sha": "d258b0bf0e072438fc9eb921c5335734e6794459"
},
{

View file

@ -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;
}