Skip to content

Commit f4303cd

Browse files
authored
Fixup acceleration structure and raytracing flags. (#1073)
When determining if acceleration structures and ray tracing are supported it isn't enough to just check for the device extension. Both of these extensions maybe available, then the features contain a flag which determines if it is implemented. So, if we've got the features, we need to additionally check the flag and reset our internal tracking based on the implementation flag.
1 parent 05e8c35 commit f4303cd

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

samples/config_helper_vulkan.cc

+11
Original file line numberDiff line numberDiff line change
@@ -920,6 +920,17 @@ amber::Result ConfigHelperVulkan::CheckVulkanPhysicalDeviceRequirements(
920920
vkGetPhysicalDeviceFeatures2KHR(physical_device, &features2);
921921
available_features_ = features2.features;
922922

923+
// Just having the extension does not necessarily mean that the feature is
924+
// available. We have to check the features structure for specific flags.
925+
if (supports_acceleration_structure_) {
926+
supports_acceleration_structure_ =
927+
acceleration_structure_features.accelerationStructure;
928+
}
929+
if (supports_ray_tracing_pipeline_) {
930+
supports_ray_tracing_pipeline_ =
931+
ray_tracing_pipeline_features.rayTracingPipeline;
932+
}
933+
923934
std::vector<std::string> required_features1;
924935
for (const auto& feature : required_features) {
925936
// No dot means this is a features1 feature.

0 commit comments

Comments
 (0)