From b5915d4a6c5d51eff8adb3f16b266c86912e65bc Mon Sep 17 00:00:00 2001 From: Rua Date: Sat, 26 Aug 2023 10:55:29 +0200 Subject: [PATCH 1/4] Wrap buffer values in `AccelerationStructureBuildGeometryInfo` in an `Option` --- vulkano/src/acceleration_structure.rs | 84 ++++++++++++------ .../commands/acceleration_structure.rs | 86 ++++++++++++++++++- 2 files changed, 140 insertions(+), 30 deletions(-) diff --git a/vulkano/src/acceleration_structure.rs b/vulkano/src/acceleration_structure.rs index 8bb91b29f7..5e4cd03d12 100644 --- a/vulkano/src/acceleration_structure.rs +++ b/vulkano/src/acceleration_structure.rs @@ -474,27 +474,29 @@ pub struct AccelerationStructureBuildGeometryInfo { /// Scratch memory to be used for the build. /// - /// There is no default value. - pub scratch_data: Subbuffer<[u8]>, + /// This can be `None` when calling [`Device::acceleration_structure_build_sizes`], + /// but must be `Some` otherwise. + /// + /// The default value is `None`. + pub scratch_data: Option>, pub _ne: crate::NonExhaustive, } impl AccelerationStructureBuildGeometryInfo { /// Returns a `AccelerationStructureBuildGeometryInfo` with the specified - /// `dst_acceleration_structure`, `geometries` and `scratch_data`. + /// `dst_acceleration_structure` and `geometries`. #[inline] pub fn new( dst_acceleration_structure: Arc, geometries: AccelerationStructureGeometries, - scratch_data: Subbuffer<[u8]>, ) -> Self { Self { flags: BuildAccelerationStructureFlags::empty(), mode: BuildAccelerationStructureMode::Build, dst_acceleration_structure, geometries, - scratch_data, + scratch_data: None, _ne: crate::NonExhaustive(()), } } @@ -633,10 +635,12 @@ impl AccelerationStructureBuildGeometryInfo { triangles: ash::vk::AccelerationStructureGeometryTrianglesDataKHR { vertex_format: vertex_format.into(), vertex_data: ash::vk::DeviceOrHostAddressConstKHR { - device_address: vertex_data - .device_address() - .unwrap() - .into(), + device_address: vertex_data.as_ref().map_or( + 0, + |vertex_data| { + vertex_data.device_address().unwrap().into() + }, + ), }, vertex_stride: vertex_stride as DeviceSize, max_vertex, @@ -691,7 +695,9 @@ impl AccelerationStructureBuildGeometryInfo { geometry: ash::vk::AccelerationStructureGeometryDataKHR { aabbs: ash::vk::AccelerationStructureGeometryAabbsDataKHR { data: ash::vk::DeviceOrHostAddressConstKHR { - device_address: data.device_address().unwrap().get(), + device_address: data.as_ref().map_or(0, |data| { + data.device_address().unwrap().into() + }), }, stride: stride as DeviceSize, ..Default::default() @@ -715,13 +721,17 @@ impl AccelerationStructureBuildGeometryInfo { AccelerationStructureGeometryInstancesDataType::Values(data) => ( ash::vk::FALSE, ash::vk::DeviceOrHostAddressConstKHR { - device_address: data.device_address().unwrap().get(), + device_address: data + .as_ref() + .map_or(0, |data| data.device_address().unwrap().into()), }, ), AccelerationStructureGeometryInstancesDataType::Pointers(data) => ( ash::vk::TRUE, ash::vk::DeviceOrHostAddressConstKHR { - device_address: data.device_address().unwrap().get(), + device_address: data + .as_ref() + .map_or(0, |data| data.device_address().unwrap().into()), }, ), }; @@ -760,7 +770,12 @@ impl AccelerationStructureBuildGeometryInfo { p_geometries: ptr::null(), pp_geometries: ptr::null(), scratch_data: ash::vk::DeviceOrHostAddressKHR { - device_address: scratch_data.device_address().unwrap().get(), + device_address: scratch_data + .as_ref() + .unwrap() + .device_address() + .unwrap() + .get(), }, ..Default::default() }, @@ -940,8 +955,11 @@ pub struct AccelerationStructureGeometryTrianglesData { /// The vertex data itself, consisting of an array of `vertex_format` values. /// - /// There is no default value. - pub vertex_data: Subbuffer<[u8]>, + /// This can be `None` when calling [`Device::acceleration_structure_build_sizes`], + /// but must be `Some` otherwise. + /// + /// The default value is `None`. + pub vertex_data: Option>, /// The number of bytes between the start of successive elements in `vertex_data`. /// @@ -975,13 +993,13 @@ pub struct AccelerationStructureGeometryTrianglesData { impl AccelerationStructureGeometryTrianglesData { /// Returns a `AccelerationStructureGeometryTrianglesData` with the specified - /// `vertex_format` and `vertex_data`. + /// `vertex_format`. #[inline] - pub fn new(vertex_format: Format, vertex_data: Subbuffer<[u8]>) -> Self { + pub fn new(vertex_format: Format) -> Self { Self { flags: GeometryFlags::empty(), vertex_format, - vertex_data, + vertex_data: None, vertex_stride: 0, max_vertex: 0, index_data: None, @@ -1080,8 +1098,11 @@ pub struct AccelerationStructureGeometryAabbsData { /// The AABB data itself, consisting of an array of [`AabbPositions`] structs. /// - /// There is no default value. - pub data: Subbuffer<[u8]>, + /// This can be `None` when calling [`Device::acceleration_structure_build_sizes`], + /// but must be `Some` otherwise. + /// + /// The default value is `None`. + pub data: Option>, /// The number of bytes between the start of successive elements in `data`. /// @@ -1093,18 +1114,19 @@ pub struct AccelerationStructureGeometryAabbsData { pub _ne: crate::NonExhaustive, } -impl AccelerationStructureGeometryAabbsData { - /// Returns a `AccelerationStructureGeometryAabbsData` with the specified `data`. +impl Default for AccelerationStructureGeometryAabbsData { #[inline] - pub fn new(data: Subbuffer<[u8]>) -> Self { + fn default() -> Self { Self { flags: GeometryFlags::empty(), - data, + data: None, stride: 0, _ne: crate::NonExhaustive(()), } } +} +impl AccelerationStructureGeometryAabbsData { pub(crate) fn validate(&self, device: &Device) -> Result<(), Box> { let &Self { flags, @@ -1195,11 +1217,17 @@ impl AccelerationStructureGeometryInstancesData { #[derive(Clone, Debug)] pub enum AccelerationStructureGeometryInstancesDataType { /// The data buffer contains an array of [`AccelerationStructureInstance`] structures directly. - Values(Subbuffer<[AccelerationStructureInstance]>), + /// + /// The inner value can be `None` when calling [`Device::acceleration_structure_build_sizes`], + /// but must be `Some` otherwise. + Values(Option>), /// The data buffer contains an array of pointers to [`AccelerationStructureInstance`] /// structures. - Pointers(Subbuffer<[DeviceSize]>), + /// + /// The inner value can be `None` when calling [`Device::acceleration_structure_build_sizes`], + /// but must be `Some` otherwise. + Pointers(Option>), } impl From> @@ -1207,14 +1235,14 @@ impl From> { #[inline] fn from(value: Subbuffer<[AccelerationStructureInstance]>) -> Self { - Self::Values(value) + Self::Values(Some(value)) } } impl From> for AccelerationStructureGeometryInstancesDataType { #[inline] fn from(value: Subbuffer<[DeviceSize]>) -> Self { - Self::Pointers(value) + Self::Pointers(Some(value)) } } diff --git a/vulkano/src/command_buffer/commands/acceleration_structure.rs b/vulkano/src/command_buffer/commands/acceleration_structure.rs index dc6f496c5e..94a0d4ebbe 100644 --- a/vulkano/src/command_buffer/commands/acceleration_structure.rs +++ b/vulkano/src/command_buffer/commands/acceleration_structure.rs @@ -662,6 +662,8 @@ fn add_build_geometry_resources( _ne, } = triangles_data; + let vertex_data = vertex_data.as_ref().unwrap(); + [ ( ResourceInCommand::GeometryTrianglesVertexData { index }.into(), @@ -710,6 +712,8 @@ fn add_build_geometry_resources( _ne: _, } = aabbs_data; + let data = data.as_ref().unwrap(); + ( ResourceInCommand::GeometryAabbsData { index }.into(), Resource::Buffer { @@ -729,8 +733,14 @@ fn add_build_geometry_resources( } = instances_data; let data = match data { - AccelerationStructureGeometryInstancesDataType::Values(data) => data.as_bytes(), - AccelerationStructureGeometryInstancesDataType::Pointers(data) => data.as_bytes(), + AccelerationStructureGeometryInstancesDataType::Values(data) => { + let data = data.as_ref().unwrap(); + data.as_bytes() + } + AccelerationStructureGeometryInstancesDataType::Pointers(data) => { + let data = data.as_ref().unwrap(); + data.as_bytes() + } }; let size = data.size(); @@ -769,6 +779,8 @@ fn add_build_geometry_resources( PipelineStageAccessFlags::AccelerationStructureBuild_AccelerationStructureWrite, }, )); + + let scratch_data = scratch_data.as_ref().unwrap(); used_resources.push(( ResourceInCommand::ScratchData.into(), Resource::Buffer { @@ -839,6 +851,13 @@ where _ne, } = info; + let scratch_data = scratch_data.as_ref().ok_or(Box::new(ValidationError { + context: "info.scratch_data".into(), + problem: "is `None`".into(), + // vuids? + ..Default::default() + }))?; + // VUID-vkCmdBuildAccelerationStructuresKHR-mode-04628 // Ensured as long as `BuildAccelerationStructureMode` is exhaustive. @@ -968,6 +987,13 @@ where _ne, } = triangles_data; + let vertex_data = vertex_data.as_ref().ok_or(Box::new(ValidationError { + context: format!("info.geometries[{}].vertex_data", geometry_index).into(), + problem: "is `None`".into(), + // vuids? + ..Default::default() + }))?; + let &AccelerationStructureBuildRangeInfo { primitive_count, primitive_offset, @@ -1217,6 +1243,13 @@ where _ne, } = aabbs_data; + let data = data.as_ref().ok_or(Box::new(ValidationError { + context: format!("info.geometries[{}].data", geometry_index).into(), + problem: "is `None`".into(), + // vuids? + ..Default::default() + }))?; + let &AccelerationStructureBuildRangeInfo { primitive_count, primitive_offset, @@ -1329,6 +1362,13 @@ where let data_buffer = match data { AccelerationStructureGeometryInstancesDataType::Values(data) => { + let data = data.as_ref().ok_or(Box::new(ValidationError { + context: "info.geometries.data".into(), + problem: "is `None`".into(), + // vuids? + ..Default::default() + }))?; + if data.device_address().unwrap().get() % 16 != 0 { return Err(Box::new(ValidationError { context: "info.geometries.data".into(), @@ -1363,6 +1403,13 @@ where data.buffer() } AccelerationStructureGeometryInstancesDataType::Pointers(data) => { + let data = data.as_ref().ok_or(Box::new(ValidationError { + context: "info.geometries.data".into(), + problem: "is `None`".into(), + // vuids? + ..Default::default() + }))?; + if !data .buffer() .usage() @@ -1620,6 +1667,13 @@ where // VUID-vkCmdBuildAccelerationStructuresIndirectKHR-scratchData-03705 // Ensured by unsafe on `AccelerationStructure::new`. + let scratch_data = scratch_data.as_ref().ok_or(Box::new(ValidationError { + context: "info.scratch_data".into(), + problem: "is `None`".into(), + // vuids? + ..Default::default() + }))?; + if !scratch_data .buffer() .usage() @@ -1716,6 +1770,13 @@ where _ne, } = triangles_data; + let vertex_data = vertex_data.as_ref().ok_or(Box::new(ValidationError { + context: format!("info.geometries[{}].vertex_data", geometry_index).into(), + problem: "is `None`".into(), + // vuids? + ..Default::default() + }))?; + // VUID-VkAccelerationStructureBuildGeometryInfoKHR-type-03795 // unsafe @@ -1855,6 +1916,13 @@ where _ne, } = aabbs_data; + let data = data.as_ref().ok_or(Box::new(ValidationError { + context: format!("info.geometries[{}].data", geometry_index).into(), + problem: "is `None`".into(), + // vuids? + ..Default::default() + }))?; + // VUID-VkAccelerationStructureBuildGeometryInfoKHR-type-03794 // unsafe @@ -1902,6 +1970,13 @@ where let data_buffer = match data { AccelerationStructureGeometryInstancesDataType::Values(data) => { + let data = data.as_ref().ok_or(Box::new(ValidationError { + context: "info.geometries.data".into(), + problem: "is `None`".into(), + // vuids? + ..Default::default() + }))?; + if data.device_address().unwrap().get() % 16 != 0 { return Err(Box::new(ValidationError { context: "info.geometries.data".into(), @@ -1919,6 +1994,13 @@ where data.buffer() } AccelerationStructureGeometryInstancesDataType::Pointers(data) => { + let data = data.as_ref().ok_or(Box::new(ValidationError { + context: "info.geometries.data".into(), + problem: "is `None`".into(), + // vuids? + ..Default::default() + }))?; + if !data .buffer() .usage() From 4f0812c6d96c46630e212b978e54077fbc5c8b21 Mon Sep 17 00:00:00 2001 From: Rua Date: Sat, 26 Aug 2023 11:04:44 +0200 Subject: [PATCH 2/4] Oops! --- vulkano/src/acceleration_structure.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/vulkano/src/acceleration_structure.rs b/vulkano/src/acceleration_structure.rs index 5e4cd03d12..d3f05920d4 100644 --- a/vulkano/src/acceleration_structure.rs +++ b/vulkano/src/acceleration_structure.rs @@ -770,12 +770,9 @@ impl AccelerationStructureBuildGeometryInfo { p_geometries: ptr::null(), pp_geometries: ptr::null(), scratch_data: ash::vk::DeviceOrHostAddressKHR { - device_address: scratch_data - .as_ref() - .unwrap() - .device_address() - .unwrap() - .get(), + device_address: scratch_data.as_ref().map_or(0, |scratch_data| { + scratch_data.device_address().unwrap().into() + }), }, ..Default::default() }, From 297cf87214b5dab99979532a43321d161e42a406 Mon Sep 17 00:00:00 2001 From: Rua Date: Sat, 26 Aug 2023 11:16:09 +0200 Subject: [PATCH 3/4] Also wrap `mode` and `dst_acceleration_structure` --- vulkano/src/acceleration_structure.rs | 42 +++++++++-------- .../commands/acceleration_structure.rs | 46 ++++++++++++++++--- 2 files changed, 63 insertions(+), 25 deletions(-) diff --git a/vulkano/src/acceleration_structure.rs b/vulkano/src/acceleration_structure.rs index d3f05920d4..71198567c6 100644 --- a/vulkano/src/acceleration_structure.rs +++ b/vulkano/src/acceleration_structure.rs @@ -454,13 +454,19 @@ pub struct AccelerationStructureBuildGeometryInfo { /// The mode that the build command should operate in. /// - /// The default value is [`BuildAccelerationStructureMode::Build`]. - pub mode: BuildAccelerationStructureMode, + /// This can be `None` when calling [`Device::acceleration_structure_build_sizes`], + /// but must be `Some` otherwise. + /// + /// The default value is `None`. + pub mode: Option, /// The acceleration structure to build or update. /// + /// This can be `None` when calling [`Device::acceleration_structure_build_sizes`], + /// but must be `Some` otherwise. + /// /// There is no default value. - pub dst_acceleration_structure: Arc, + pub dst_acceleration_structure: Option>, /// The geometries that will be built into `dst_acceleration_structure`. /// @@ -484,17 +490,13 @@ pub struct AccelerationStructureBuildGeometryInfo { } impl AccelerationStructureBuildGeometryInfo { - /// Returns a `AccelerationStructureBuildGeometryInfo` with the specified - /// `dst_acceleration_structure` and `geometries`. + /// Returns a `AccelerationStructureBuildGeometryInfo` with the specified `geometries`. #[inline] - pub fn new( - dst_acceleration_structure: Arc, - geometries: AccelerationStructureGeometries, - ) -> Self { + pub fn new(geometries: AccelerationStructureGeometries) -> Self { Self { flags: BuildAccelerationStructureFlags::empty(), - mode: BuildAccelerationStructureMode::Build, - dst_acceleration_structure, + mode: None, + dst_acceleration_structure: None, geometries, scratch_data: None, _ne: crate::NonExhaustive(()), @@ -573,10 +575,12 @@ impl AccelerationStructureBuildGeometryInfo { } } - // VUID-VkAccelerationStructureBuildGeometryInfoKHR-commonparent - assert_eq!(device, dst_acceleration_structure.device().as_ref()); + if let Some(dst_acceleration_structure) = dst_acceleration_structure { + // VUID-VkAccelerationStructureBuildGeometryInfoKHR-commonparent + assert_eq!(device, dst_acceleration_structure.device().as_ref()); + } - if let BuildAccelerationStructureMode::Update(src_acceleration_structure) = mode { + if let Some(BuildAccelerationStructureMode::Update(src_acceleration_structure)) = mode { assert_eq!(device, src_acceleration_structure.device().as_ref()); } @@ -758,14 +762,16 @@ impl AccelerationStructureBuildGeometryInfo { ash::vk::AccelerationStructureBuildGeometryInfoKHR { ty, flags: flags.into(), - mode: mode.into(), + mode: mode.as_ref().map_or_else(Default::default, Into::into), src_acceleration_structure: match mode { - BuildAccelerationStructureMode::Build => Default::default(), - BuildAccelerationStructureMode::Update(src_acceleration_structure) => { + None | Some(BuildAccelerationStructureMode::Build) => Default::default(), + Some(BuildAccelerationStructureMode::Update(src_acceleration_structure)) => { src_acceleration_structure.handle() } }, - dst_acceleration_structure: dst_acceleration_structure.handle(), + dst_acceleration_structure: dst_acceleration_structure + .as_ref() + .map_or_else(Default::default, VulkanObject::handle), geometry_count: 0, p_geometries: ptr::null(), pp_geometries: ptr::null(), diff --git a/vulkano/src/command_buffer/commands/acceleration_structure.rs b/vulkano/src/command_buffer/commands/acceleration_structure.rs index 94a0d4ebbe..3d4bd0723a 100644 --- a/vulkano/src/command_buffer/commands/acceleration_structure.rs +++ b/vulkano/src/command_buffer/commands/acceleration_structure.rs @@ -756,6 +756,7 @@ fn add_build_geometry_resources( } }; + let mode = mode.as_ref().unwrap(); if let BuildAccelerationStructureMode::Update(src_acceleration_structure) = mode { let src_buffer = src_acceleration_structure.buffer(); used_resources.push(( @@ -769,6 +770,7 @@ fn add_build_geometry_resources( )); } + let dst_acceleration_structure = dst_acceleration_structure.as_ref().unwrap(); let dst_buffer = dst_acceleration_structure.buffer(); used_resources.push(( ResourceInCommand::Destination.into(), @@ -851,6 +853,21 @@ where _ne, } = info; + let mode = mode.as_ref().ok_or(Box::new(ValidationError { + context: "info.mode".into(), + problem: "is `None`".into(), + // vuids? + ..Default::default() + }))?; + let dst_acceleration_structure = + dst_acceleration_structure + .as_ref() + .ok_or(Box::new(ValidationError { + context: "info.dst_acceleration_structure".into(), + problem: "is `None`".into(), + // vuids? + ..Default::default() + }))?; let scratch_data = scratch_data.as_ref().ok_or(Box::new(ValidationError { context: "info.scratch_data".into(), problem: "is `None`".into(), @@ -1647,6 +1664,28 @@ where _ne, } = info; + let mode = mode.as_ref().ok_or(Box::new(ValidationError { + context: "info.mode".into(), + problem: "is `None`".into(), + // vuids? + ..Default::default() + }))?; + let dst_acceleration_structure = + dst_acceleration_structure + .as_ref() + .ok_or(Box::new(ValidationError { + context: "info.dst_acceleration_structure".into(), + problem: "is `None`".into(), + // vuids? + ..Default::default() + }))?; + let scratch_data = scratch_data.as_ref().ok_or(Box::new(ValidationError { + context: "info.scratch_data".into(), + problem: "is `None`".into(), + // vuids? + ..Default::default() + }))?; + // VUID-vkCmdBuildAccelerationStructuresIndirectKHR-mode-04628 // Ensured as long as `BuildAccelerationStructureMode` is exhaustive. @@ -1667,13 +1706,6 @@ where // VUID-vkCmdBuildAccelerationStructuresIndirectKHR-scratchData-03705 // Ensured by unsafe on `AccelerationStructure::new`. - let scratch_data = scratch_data.as_ref().ok_or(Box::new(ValidationError { - context: "info.scratch_data".into(), - problem: "is `None`".into(), - // vuids? - ..Default::default() - }))?; - if !scratch_data .buffer() .usage() From 4d41d4ac03195f53ce25280c49f139aa9aa22987 Mon Sep 17 00:00:00 2001 From: Rua Date: Sat, 26 Aug 2023 11:32:30 +0200 Subject: [PATCH 4/4] Un-wrap mode --- vulkano/src/acceleration_structure.rs | 17 ++++++++--------- .../commands/acceleration_structure.rs | 13 ------------- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/vulkano/src/acceleration_structure.rs b/vulkano/src/acceleration_structure.rs index 71198567c6..4c1d0bb5ba 100644 --- a/vulkano/src/acceleration_structure.rs +++ b/vulkano/src/acceleration_structure.rs @@ -454,11 +454,10 @@ pub struct AccelerationStructureBuildGeometryInfo { /// The mode that the build command should operate in. /// - /// This can be `None` when calling [`Device::acceleration_structure_build_sizes`], - /// but must be `Some` otherwise. + /// This is ignored when calling [`Device::acceleration_structure_build_sizes`]. /// - /// The default value is `None`. - pub mode: Option, + /// The default value is [`BuildAccelerationStructureMode::Build`]. + pub mode: BuildAccelerationStructureMode, /// The acceleration structure to build or update. /// @@ -495,7 +494,7 @@ impl AccelerationStructureBuildGeometryInfo { pub fn new(geometries: AccelerationStructureGeometries) -> Self { Self { flags: BuildAccelerationStructureFlags::empty(), - mode: None, + mode: BuildAccelerationStructureMode::Build, dst_acceleration_structure: None, geometries, scratch_data: None, @@ -580,7 +579,7 @@ impl AccelerationStructureBuildGeometryInfo { assert_eq!(device, dst_acceleration_structure.device().as_ref()); } - if let Some(BuildAccelerationStructureMode::Update(src_acceleration_structure)) = mode { + if let BuildAccelerationStructureMode::Update(src_acceleration_structure) = mode { assert_eq!(device, src_acceleration_structure.device().as_ref()); } @@ -762,10 +761,10 @@ impl AccelerationStructureBuildGeometryInfo { ash::vk::AccelerationStructureBuildGeometryInfoKHR { ty, flags: flags.into(), - mode: mode.as_ref().map_or_else(Default::default, Into::into), + mode: mode.into(), src_acceleration_structure: match mode { - None | Some(BuildAccelerationStructureMode::Build) => Default::default(), - Some(BuildAccelerationStructureMode::Update(src_acceleration_structure)) => { + BuildAccelerationStructureMode::Build => Default::default(), + BuildAccelerationStructureMode::Update(src_acceleration_structure) => { src_acceleration_structure.handle() } }, diff --git a/vulkano/src/command_buffer/commands/acceleration_structure.rs b/vulkano/src/command_buffer/commands/acceleration_structure.rs index 3d4bd0723a..8c7042ec2c 100644 --- a/vulkano/src/command_buffer/commands/acceleration_structure.rs +++ b/vulkano/src/command_buffer/commands/acceleration_structure.rs @@ -756,7 +756,6 @@ fn add_build_geometry_resources( } }; - let mode = mode.as_ref().unwrap(); if let BuildAccelerationStructureMode::Update(src_acceleration_structure) = mode { let src_buffer = src_acceleration_structure.buffer(); used_resources.push(( @@ -853,12 +852,6 @@ where _ne, } = info; - let mode = mode.as_ref().ok_or(Box::new(ValidationError { - context: "info.mode".into(), - problem: "is `None`".into(), - // vuids? - ..Default::default() - }))?; let dst_acceleration_structure = dst_acceleration_structure .as_ref() @@ -1664,12 +1657,6 @@ where _ne, } = info; - let mode = mode.as_ref().ok_or(Box::new(ValidationError { - context: "info.mode".into(), - problem: "is `None`".into(), - // vuids? - ..Default::default() - }))?; let dst_acceleration_structure = dst_acceleration_structure .as_ref()