Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/trunk' into feature/enable
Browse files Browse the repository at this point in the history
# Conflicts:
#	naga/Cargo.toml
  • Loading branch information
cwfitzgerald committed Feb 6, 2025
2 parents a41cfe1 + 4268824 commit efb441d
Show file tree
Hide file tree
Showing 26 changed files with 100 additions and 95 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ jobs:
run: taplo format --check --diff

- name: Check for typos
uses: crate-ci/[email protected].4
uses: crate-ci/[email protected].5

check-cts-runner:
# runtime is normally 2 minutes
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ Bottom level categories:
- Avoid using default features in many dependencies, etc. By Brody in [#7031](https://github.com/gfx-rs/wgpu/pull/7031)
- Use `hashbrown` to simplify no-std support. By Brody in [#6938](https://github.com/gfx-rs/wgpu/pull/6938) & [#6925](https://github.com/gfx-rs/wgpu/pull/6925).
- If you use Binding Arrays in a bind group, you may not use Dynamic Offset Buffers or Uniform Buffers in that bind group. By @cwfitzgerald in [#6811](https://github.com/gfx-rs/wgpu/pull/6811)
- Rename `instance_id` and `instance_custom_index` to `instance_index` and `instance_custom_data` by @Vecvec in
[#6780](https://github.com/gfx-rs/wgpu/pull/6780)

##### Refactored internal trace path parameter

Expand Down
6 changes: 4 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ The WGPU project has multiple official platforms for community engagement:
- `wgpu` Maintainership Meetings: Every week, the maintainership of the wgpu
project meets to discuss the project's direction and review ongoing work.
These meetings are open to the public, and you are welcome to attend. They
happen on Google Meet and happen on Wednesday at 16:00 UTC and last approximately
an hour. Remember to obey the [`CODE_OF_CONDUCT.md`] in the meeting.
happen on Google Meet and happen on Wednesday at 11:00 US Eastern Standard
Time and last approximately an hour. Remember to obey the
[`CODE_OF_CONDUCT.md`] in the meeting.

- [Meeting Notes]
- [Meeting Link]
- [GitHub discussions]: TODO: Experimentally used by some enthusiastic members
Expand Down
72 changes: 32 additions & 40 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ ron = "0.8"
# see discussion here (including with some other alternatives): https://github.com/gfx-rs/wgpu/issues/6999
# (using default-features = false to support no-std build, avoiding any extra features that may require std::collections)
rustc-hash = { version = "1", default-features = false }
serde_json = "1.0.137"
serde_json = "1.0.138"
serde = { version = "1", default-features = false }
smallvec = "1"
static_assertions = "1.1.0"
Expand Down
6 changes: 3 additions & 3 deletions etc/specs/ray_tracing.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ struct RayIntersection {
kind: u32,
// Distance from starting point, measured in units of `RayDesc::dir`.
t: f32,
// Corresponds to `instance.custom_index` where `instance` is the `TlasInstance`
// Corresponds to `instance.custom_data` where `instance` is the `TlasInstance`
// that the intersected object was contained in.
instance_custom_index: u32,
instance_custom_data: u32,
// The index into the `TlasPackage` to get the `TlasInstance` that the hit object is in
instance_id: u32,
instance_index: u32,
// The offset into the shader binding table. Currently, this value is always 0.
sbt_record_offset: u32,
// The index into the `Blas`'s build descriptor (e.g. if `BlasBuildEntry::geometry` is
Expand Down
4 changes: 2 additions & 2 deletions examples/features/src/ray_cube_compute/shader.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ struct RayDesc {
struct RayIntersection {
kind: u32,
t: f32,
instance_custom_index: u32,
instance_id: u32,
instance_custom_data: u32,
instance_index: u32,
sbt_record_offset: u32,
geometry_index: u32,
primitive_index: u32,
Expand Down
8 changes: 4 additions & 4 deletions examples/features/src/ray_scene/shader.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ struct RayDesc {
struct RayIntersection {
kind: u32,
t: f32,
instance_custom_index: u32,
instance_id: u32,
instance_custom_data: u32,
instance_index: u32,
sbt_record_offset: u32,
geometry_index: u32,
primitive_index: u32,
Expand Down Expand Up @@ -131,7 +131,7 @@ fn fs_main(vertex: VertexOutput) -> @location(0) vec4<f32> {

let intersection = rayQueryGetCommittedIntersection(&rq);
if (intersection.kind != RAY_QUERY_INTERSECTION_NONE) {
let instance = instances[intersection.instance_custom_index];
let instance = instances[intersection.instance_custom_data];
let geometry = geometries[intersection.geometry_index + instance.first_geometry];

let index_offset = geometry.first_index;
Expand All @@ -155,7 +155,7 @@ fn fs_main(vertex: VertexOutput) -> @location(0) vec4<f32> {

color = vec4<f32>(material.albedo, 1.0);

if(intersection.instance_custom_index == 1u){
if(intersection.instance_custom_data == 1u){
color = vec4<f32>(normal, 1.0);
}
}
Expand Down
4 changes: 2 additions & 2 deletions naga/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ cfg_aliases.workspace = true
[dev-dependencies]
diff = "0.1"
env_logger.workspace = true
itertools.workspace = true
hashbrown = { version = "0.15", features = ["serde"] }
hashbrown = { workspace = true, features = ["serde"] }
# This _cannot_ have a version specified. If it does, crates.io will look
# for a version of the package on crates when we publish naga. Path dependencies
# are allowed through though.
hlsl-snapshots = { path = "./hlsl-snapshots" }
itertools.workspace = true
# Require at least version 0.7.1 of ron, this version changed how floating points are
# serialized by forcing them to always have the decimal part, this makes it backwards
# incompatible with our tests because we do a syntactic diff and not a semantic one.
Expand Down
8 changes: 4 additions & 4 deletions naga/src/back/hlsl/ray.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ impl<W: Write> super::Writer<'_, W> {
writeln!(self.out, " ret.t = rq.CommittedRayT();")?;
writeln!(
self.out,
" ret.instance_custom_index = rq.CommittedInstanceID();"
" ret.instance_custom_data = rq.CommittedInstanceID();"
)?;
writeln!(
self.out,
" ret.instance_id = rq.CommittedInstanceIndex();"
" ret.instance_index = rq.CommittedInstanceIndex();"
)?;
writeln!(
self.out,
Expand Down Expand Up @@ -129,11 +129,11 @@ impl<W: Write> super::Writer<'_, W> {

writeln!(
self.out,
" ret.instance_custom_index = rq.CandidateInstanceID();"
" ret.instance_custom_data = rq.CandidateInstanceID();"
)?;
writeln!(
self.out,
" ret.instance_id = rq.CandidateInstanceIndex();"
" ret.instance_index = rq.CandidateInstanceIndex();"
)?;
writeln!(
self.out,
Expand Down
4 changes: 2 additions & 2 deletions naga/src/front/type_gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,13 @@ impl crate::Module {
offset: 4,
},
crate::StructMember {
name: Some("instance_custom_index".to_string()),
name: Some("instance_custom_data".to_string()),
ty: ty_flag,
binding: None,
offset: 8,
},
crate::StructMember {
name: Some("instance_id".to_string()),
name: Some("instance_index".to_string()),
ty: ty_flag,
binding: None,
offset: 12,
Expand Down
4 changes: 2 additions & 2 deletions naga/tests/in/ray-query.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ struct RayDesc {
struct RayIntersection {
kind: u32,
t: f32,
instance_custom_index: u32,
instance_id: u32,
instance_custom_data: u32,
instance_index: u32,
sbt_record_offset: u32,
geometry_index: u32,
primitive_index: u32,
Expand Down
Loading

0 comments on commit efb441d

Please sign in to comment.