@@ -419,6 +419,7 @@ void RaytracingInvocationReorder::create_bottom_level_acceleration_structure(boo
419419 model_buffer.vertex_offset + (model_buffer.is_static ? static_vertex_handle : dynamic_vertex_handle),
420420 model_buffer.index_offset + (model_buffer.is_static ? static_index_handle : dynamic_index_handle));
421421 }
422+ model_buffer.bottom_level_acceleration_structure ->set_scrach_buffer_alignment (acceleration_structure_properties.minAccelerationStructureScratchOffsetAlignment );
422423 model_buffer.bottom_level_acceleration_structure ->build (queue,
423424 model_buffer.is_static ? VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHR : VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_KHR | VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR,
424425 is_update ? VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR : VK_BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR);
@@ -548,6 +549,7 @@ void RaytracingInvocationReorder::create_top_level_acceleration_structure(bool p
548549 {
549550 top_level_acceleration_structure->update_instance_geometry (instance_uid, instances_buffer, static_cast <uint32_t >(instances.size ()));
550551 }
552+ top_level_acceleration_structure->set_scrach_buffer_alignment (acceleration_structure_properties.minAccelerationStructureScratchOffsetAlignment );
551553 top_level_acceleration_structure->build (queue);
552554}
553555
@@ -1183,6 +1185,8 @@ bool RaytracingInvocationReorder::prepare(const vkb::ApplicationOptions &options
11831185 VkPhysicalDeviceProperties2 device_properties{};
11841186 device_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
11851187 device_properties.pNext = &ray_tracing_pipeline_properties;
1188+ ray_tracing_pipeline_properties.pNext = &acceleration_structure_properties;
1189+
11861190 vkGetPhysicalDeviceProperties2 (get_device ().get_gpu ().get_handle (), &device_properties);
11871191
11881192 // Get the acceleration structure features, which we'll need later on in the sample
0 commit comments