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 <lionel.g.landwerlin@intel.com>
Fixes: 03e1e19246
("anv: Refactor descriptor copy")
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15241>
This commit is contained in:

committed by
Marge Bot

parent
968d68125c
commit
71cd6a7b84
@@ -1686,8 +1686,12 @@ anv_descriptor_set_write_acceleration_structure(struct anv_device *device,
|
|||||||
assert(bind_layout->data & ANV_DESCRIPTOR_ADDRESS_RANGE);
|
assert(bind_layout->data & ANV_DESCRIPTOR_ADDRESS_RANGE);
|
||||||
*desc = (struct anv_descriptor) {
|
*desc = (struct anv_descriptor) {
|
||||||
.type = VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR,
|
.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 = { };
|
struct anv_address_range_descriptor desc_data = { };
|
||||||
if (accel != NULL) {
|
if (accel != NULL) {
|
||||||
desc_data.address = anv_address_physical(accel->address);
|
desc_data.address = anv_address_physical(accel->address);
|
||||||
@@ -1867,13 +1871,8 @@ void anv_UpdateDescriptorSets(
|
|||||||
}
|
}
|
||||||
|
|
||||||
case VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR: {
|
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,
|
anv_descriptor_set_write_acceleration_structure(device, dst,
|
||||||
accel,
|
src_desc[j].accel_struct,
|
||||||
copy->dstBinding,
|
copy->dstBinding,
|
||||||
copy->dstArrayElement + j);
|
copy->dstArrayElement + j);
|
||||||
break;
|
break;
|
||||||
|
@@ -1921,6 +1921,8 @@ struct anv_descriptor {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct anv_buffer_view *buffer_view;
|
struct anv_buffer_view *buffer_view;
|
||||||
|
|
||||||
|
struct anv_acceleration_structure *accel_struct;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user