Skip to content

Commit eeb67ae

Browse files
authored
Replace <const INTERSECTION: u32> with two functions (#750)
* Replace <const INTERSECTION: u32> with two functions * Fix doc URLs
1 parent 6807c59 commit eeb67ae

13 files changed

+428
-110
lines changed

crates/spirv-std/src/ray_tracing.rs

Lines changed: 404 additions & 98 deletions
Large diffs are not rendered by default.

tests/ui/arch/ray_query_get_intersection_barycentrics_khr.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pub fn main(#[spirv(descriptor_set = 0, binding = 0)] accel: &AccelerationStruct
99
unsafe {
1010
spirv_std::ray_query!(let mut handle);
1111
handle.initialize(accel, RayFlags::NONE, 0, Vec3::ZERO, 0.0, Vec3::ZERO, 0.0);
12-
let barycentric_coords: glam::Vec2 = handle.get_intersection_barycentrics::<_, 5>();
12+
let barycentric_coords: glam::Vec2 = handle.get_candidate_intersection_barycentrics();
13+
let barycentric_coords: glam::Vec2 = handle.get_committed_intersection_barycentrics();
1314
}
1415
}

tests/ui/arch/ray_query_get_intersection_front_face_khr.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pub fn main(#[spirv(descriptor_set = 0, binding = 0)] accel: &AccelerationStruct
99
unsafe {
1010
spirv_std::ray_query!(let mut handle);
1111
handle.initialize(accel, RayFlags::NONE, 0, Vec3::ZERO, 0.0, Vec3::ZERO, 0.0);
12-
assert!(handle.get_intersection_front_face::<5>());
12+
assert!(handle.get_candidate_intersection_front_face());
13+
assert!(handle.get_committed_intersection_front_face());
1314
}
1415
}

tests/ui/arch/ray_query_get_intersection_geometry_index_khr.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pub fn main(#[spirv(descriptor_set = 0, binding = 0)] accel: &AccelerationStruct
99
unsafe {
1010
spirv_std::ray_query!(let mut handle);
1111
handle.initialize(accel, RayFlags::NONE, 0, Vec3::ZERO, 0.0, Vec3::ZERO, 0.0);
12-
let t = handle.get_intersection_geometry_index::<5>();
12+
let t = handle.get_candidate_intersection_geometry_index();
13+
let t = handle.get_committed_intersection_geometry_index();
1314
}
1415
}

tests/ui/arch/ray_query_get_intersection_instance_custom_index_khr.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pub fn main(#[spirv(descriptor_set = 0, binding = 0)] accel: &AccelerationStruct
99
unsafe {
1010
spirv_std::ray_query!(let mut handle);
1111
handle.initialize(accel, RayFlags::NONE, 0, Vec3::ZERO, 0.0, Vec3::ZERO, 0.0);
12-
let index = handle.get_intersection_instance_custom_index::<5>();
12+
let index = handle.get_candidate_intersection_instance_custom_index();
13+
let index = handle.get_committed_intersection_instance_custom_index();
1314
}
1415
}

tests/ui/arch/ray_query_get_intersection_instance_id_khr.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pub fn main(#[spirv(descriptor_set = 0, binding = 0)] accel: &AccelerationStruct
99
unsafe {
1010
spirv_std::ray_query!(let mut handle);
1111
handle.initialize(accel, RayFlags::NONE, 0, Vec3::ZERO, 0.0, Vec3::ZERO, 0.0);
12-
let id = handle.get_intersection_instance_id::<5>();
12+
let id = handle.get_candidate_intersection_instance_id();
13+
let id = handle.get_committed_intersection_instance_id();
1314
}
1415
}

tests/ui/arch/ray_query_get_intersection_object_ray_direction_khr.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pub fn main(#[spirv(descriptor_set = 0, binding = 0)] accel: &AccelerationStruct
99
unsafe {
1010
spirv_std::ray_query!(let mut handle);
1111
handle.initialize(accel, RayFlags::NONE, 0, Vec3::ZERO, 0.0, Vec3::ZERO, 0.0);
12-
let direction: glam::Vec3 = handle.get_intersection_object_ray_direction::<_, 5>();
12+
let direction: glam::Vec3 = handle.get_candidate_intersection_object_ray_direction();
13+
let direction: glam::Vec3 = handle.get_committed_intersection_object_ray_direction();
1314
}
1415
}

tests/ui/arch/ray_query_get_intersection_object_ray_origin_khr.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pub fn main(#[spirv(descriptor_set = 0, binding = 0)] accel: &AccelerationStruct
99
unsafe {
1010
spirv_std::ray_query!(let mut handle);
1111
handle.initialize(accel, RayFlags::NONE, 0, Vec3::ZERO, 0.0, Vec3::ZERO, 0.0);
12-
let origin: glam::Vec3 = handle.get_intersection_object_ray_origin::<_, 5>();
12+
let origin: glam::Vec3 = handle.get_candidate_intersection_object_ray_origin();
13+
let origin: glam::Vec3 = handle.get_committed_intersection_object_ray_origin();
1314
}
1415
}

tests/ui/arch/ray_query_get_intersection_object_to_world_khr.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pub fn main(#[spirv(descriptor_set = 0, binding = 0)] accel: &AccelerationStruct
99
unsafe {
1010
spirv_std::ray_query!(let mut handle);
1111
handle.initialize(accel, RayFlags::NONE, 0, Vec3::ZERO, 0.0, Vec3::ZERO, 0.0);
12-
let matrix: [glam::Vec3; 4] = handle.get_intersection_object_to_world::<_, 5>();
12+
let matrix: [glam::Vec3; 4] = handle.get_candidate_intersection_object_to_world();
13+
let matrix: [glam::Vec3; 4] = handle.get_committed_intersection_object_to_world();
1314
}
1415
}

tests/ui/arch/ray_query_get_intersection_primitive_index_khr.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pub fn main(#[spirv(descriptor_set = 0, binding = 0)] accel: &AccelerationStruct
99
unsafe {
1010
spirv_std::ray_query!(let mut handle);
1111
handle.initialize(accel, RayFlags::NONE, 0, Vec3::ZERO, 0.0, Vec3::ZERO, 0.0);
12-
handle.get_intersection_primitive_index::<5>();
12+
handle.get_candidate_intersection_primitive_index();
13+
handle.get_committed_intersection_primitive_index();
1314
}
1415
}

tests/ui/arch/ray_query_get_intersection_shader_binding_table_record_offset_khr.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pub fn main(#[spirv(descriptor_set = 0, binding = 0)] accel: &AccelerationStruct
99
unsafe {
1010
spirv_std::ray_query!(let mut handle);
1111
handle.initialize(accel, RayFlags::NONE, 0, Vec3::ZERO, 0.0, Vec3::ZERO, 0.0);
12-
let offset = handle.get_intersection_shader_binding_table_record_offset::<5>();
12+
let offset = handle.get_candidate_intersection_shader_binding_table_record_offset();
13+
let offset = handle.get_committed_intersection_shader_binding_table_record_offset();
1314
}
1415
}

tests/ui/arch/ray_query_get_intersection_t_khr.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pub fn main(#[spirv(descriptor_set = 0, binding = 0)] accel: &AccelerationStruct
99
unsafe {
1010
spirv_std::ray_query!(let mut handle);
1111
handle.initialize(accel, RayFlags::NONE, 0, Vec3::ZERO, 0.0, Vec3::ZERO, 0.0);
12-
let t = handle.get_intersection_t::<5>();
12+
let t = handle.get_candidate_intersection_t();
13+
let t = handle.get_committed_intersection_t();
1314
}
1415
}

tests/ui/arch/ray_query_get_intersection_type_khr.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pub fn main(#[spirv(descriptor_set = 0, binding = 0)] accel: &AccelerationStruct
99
unsafe {
1010
spirv_std::ray_query!(let mut handle);
1111
handle.initialize(accel, RayFlags::NONE, 0, Vec3::ZERO, 0.0, Vec3::ZERO, 0.0);
12-
handle.get_intersection_type::<5>();
12+
handle.get_candidate_intersection_type();
13+
handle.get_committed_intersection_type();
1314
}
1415
}

0 commit comments

Comments
 (0)