Skip to content

Commit

Permalink
Not feature is experimental.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vecvec committed Feb 8, 2025
1 parent 04898b8 commit 9a71454
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/features/src/ray_cube_normals/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ impl crate::framework::Example for Example {
fn required_features() -> wgpu::Features {
wgpu::Features::EXPERIMENTAL_RAY_QUERY
| wgpu::Features::EXPERIMENTAL_RAY_TRACING_ACCELERATION_STRUCTURE
| wgpu::Features::RAY_HIT_VERTEX_RETURN
| wgpu::Features::EXPERIMENTAL_RAY_HIT_VERTEX_RETURN
}

fn required_downlevel_capabilities() -> wgpu::DownlevelCapabilities {
Expand Down
2 changes: 1 addition & 1 deletion wgpu-core/src/device/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ pub fn create_validator(
);
caps.set(
Caps::RAY_HIT_VERTEX_POSITION,
features.intersects(wgt::Features::RAY_HIT_VERTEX_RETURN),
features.intersects(wgt::Features::EXPERIMENTAL_RAY_HIT_VERTEX_RETURN),
);

naga::valid::Validator::new(flags, caps)
Expand Down
4 changes: 2 additions & 2 deletions wgpu-core/src/device/ray_tracing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl Device {
.flags
.contains(wgt::AccelerationStructureFlags::ALLOW_RAY_HIT_VERTEX_RETURN)
{
self.require_features(Features::RAY_HIT_VERTEX_RETURN)?;
self.require_features(Features::EXPERIMENTAL_RAY_HIT_VERTEX_RETURN)?;
}

let size_info = match &sizes {
Expand Down Expand Up @@ -126,7 +126,7 @@ impl Device {
.flags
.contains(wgt::AccelerationStructureFlags::ALLOW_RAY_HIT_VERTEX_RETURN)
{
self.require_features(Features::RAY_HIT_VERTEX_RETURN)?;
self.require_features(Features::EXPERIMENTAL_RAY_HIT_VERTEX_RETURN)?;
}

let size_info = unsafe {
Expand Down
6 changes: 3 additions & 3 deletions wgpu-hal/src/vulkan/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ impl PhysicalDeviceFeatures {
caps.supports_extension(ext::conservative_rasterization::NAME),
);
features.set(
F::RAY_HIT_VERTEX_RETURN,
F::EXPERIMENTAL_RAY_HIT_VERTEX_RETURN,
caps.supports_extension(khr::ray_tracing_position_fetch::NAME),
);

Expand Down Expand Up @@ -1041,7 +1041,7 @@ impl PhysicalDeviceProperties {
extensions.push(khr::ray_query::NAME);
}

if requested_features.contains(wgt::Features::RAY_HIT_VERTEX_RETURN) {
if requested_features.contains(wgt::Features::EXPERIMENTAL_RAY_HIT_VERTEX_RETURN) {
extensions.push(khr::ray_tracing_position_fetch::NAME)
}

Expand Down Expand Up @@ -1913,7 +1913,7 @@ impl super::Adapter {
if features.contains(wgt::Features::EXPERIMENTAL_RAY_QUERY) {
capabilities.push(spv::Capability::RayQueryKHR);
}
if features.contains(wgt::Features::RAY_HIT_VERTEX_RETURN) {
if features.contains(wgt::Features::EXPERIMENTAL_RAY_HIT_VERTEX_RETURN) {
capabilities.push(spv::Capability::RayQueryPositionFetchKHR)
}
spv::Options {
Expand Down
6 changes: 5 additions & 1 deletion wgpu-types/src/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1121,14 +1121,18 @@ bitflags_array! {
/// This is a native only feature.
const TEXTURE_INT64_ATOMIC = 1 << 45;

/// ***THIS IS EXPERIMENTAL:*** Features enabled by this may have
/// major bugs in them and are expected to be subject to breaking changes, suggestions
/// for the API exposed by this should be posted on [the ray-tracing issue](https://github.com/gfx-rs/wgpu/issues/6762)
///
/// Allows for returning of hit triangles vertex position on acceleration
/// structure marked with [`AccelerationStructureFlags::ALLOW_RAY_HIT_VERTEX_RETURN`].
///
/// Supported platforms:
/// - Vulkan
///
/// This is a native only feature
const RAY_HIT_VERTEX_RETURN = 1 << 46;
const EXPERIMENTAL_RAY_HIT_VERTEX_RETURN = 1 << 46;
}

/// Features that are not guaranteed to be supported.
Expand Down

0 comments on commit 9a71454

Please sign in to comment.