Skip to content

Commit

Permalink
Fixup acceleration structure and raytracing flags. (#1073)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dj2 authored Jan 7, 2025
1 parent 05e8c35 commit f4303cd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions samples/config_helper_vulkan.cc
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,17 @@ amber::Result ConfigHelperVulkan::CheckVulkanPhysicalDeviceRequirements(
vkGetPhysicalDeviceFeatures2KHR(physical_device, &features2);
available_features_ = features2.features;

// Just having the extension does not necessarily mean that the feature is
// available. We have to check the features structure for specific flags.
if (supports_acceleration_structure_) {
supports_acceleration_structure_ =
acceleration_structure_features.accelerationStructure;
}
if (supports_ray_tracing_pipeline_) {
supports_ray_tracing_pipeline_ =
ray_tracing_pipeline_features.rayTracingPipeline;
}

std::vector<std::string> required_features1;
for (const auto& feature : required_features) {
// No dot means this is a features1 feature.
Expand Down

0 comments on commit f4303cd

Please sign in to comment.