From: Lionel Landwerlin Date: Mon, 7 Mar 2022 08:29:19 +0000 (+0200) Subject: anv: fix acceleration structure descriptor copies X-Git-Tag: upstream/22.3.5~11808 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=71cd6a7b84c44c3dc79f6916542a2ccc633d9766;p=platform%2Fupstream%2Fmesa.git anv: fix acceleration structure descriptor copies We're not supposed to have a VkWriteDescriptorSetAccelerationStructureKHR when doing a copy. We should instead get the acceleration structure object from the source descriptor. Signed-off-by: Lionel Landwerlin Fixes: 03e1e19246da ("anv: Refactor descriptor copy") Reviewed-by: Rohan Garg Reviewed-by: Tapani Pälli Part-of: --- diff --git a/src/intel/vulkan/anv_descriptor_set.c b/src/intel/vulkan/anv_descriptor_set.c index f23b3a8..22d6dc5 100644 --- a/src/intel/vulkan/anv_descriptor_set.c +++ b/src/intel/vulkan/anv_descriptor_set.c @@ -1686,8 +1686,12 @@ anv_descriptor_set_write_acceleration_structure(struct anv_device *device, assert(bind_layout->data & ANV_DESCRIPTOR_ADDRESS_RANGE); *desc = (struct anv_descriptor) { .type = VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR, + .accel_struct = accel, }; + if (set->pool && !set->pool->allocate_surface_states) + return; + struct anv_address_range_descriptor desc_data = { }; if (accel != NULL) { desc_data.address = anv_address_physical(accel->address); @@ -1867,13 +1871,8 @@ void anv_UpdateDescriptorSets( } case VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR: { - const VkWriteDescriptorSetAccelerationStructureKHR *accel_write = - vk_find_struct_const(dst_desc, WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR); - assert(accel_write->accelerationStructureCount == - copy->descriptorCount); - ANV_FROM_HANDLE(anv_acceleration_structure, accel, accel_write->pAccelerationStructures[j]); anv_descriptor_set_write_acceleration_structure(device, dst, - accel, + src_desc[j].accel_struct, copy->dstBinding, copy->dstArrayElement + j); break; diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 62b3a04..90ec212 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -1921,6 +1921,8 @@ struct anv_descriptor { }; struct anv_buffer_view *buffer_view; + + struct anv_acceleration_structure *accel_struct; }; };