Skip to content

Commit

Permalink
Merge branch 'trunk' of https://github.com/gfx-rs/wgpu into no-std-su…
Browse files Browse the repository at this point in the history
…pport-in-wgpu-core
  • Loading branch information
brody4hire committed Jan 17, 2025
2 parents 3b73f30 + bdef8c0 commit b82f877
Show file tree
Hide file tree
Showing 11 changed files with 914 additions and 376 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ XXX TODO

By XXX in XXX

### Bug Fixes

#### Vulkan

- Stop naga causing undefined behavior when a ray query misses. By @Vecvec in [#6752](https://github.com/gfx-rs/wgpu/pull/6752).

### Changes

#### Refactored internal trace path parameter
Expand Down
15 changes: 14 additions & 1 deletion naga/src/back/spv/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1736,7 +1736,20 @@ impl BlockContext<'_> {
}
crate::Expression::ArrayLength(expr) => self.write_runtime_array_length(expr, block)?,
crate::Expression::RayQueryGetIntersection { query, committed } => {
self.write_ray_query_get_intersection(query, block, committed)
let query_id = self.cached[query];
let func_id = self
.writer
.write_ray_query_get_intersection_function(committed, self.ir_module);
let ray_intersection = self.ir_module.special_types.ray_intersection.unwrap();
let intersection_type_id = self.get_type_id(LookupType::Handle(ray_intersection));
let id = self.gen_id();
block.body.push(Instruction::function_call(
intersection_type_id,
id,
func_id,
&[query_id],
));
id
}
};

Expand Down
2 changes: 2 additions & 0 deletions naga/src/back/spv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,8 @@ pub struct Writer {

// Just a temporary list of SPIR-V ids
temp_list: Vec<Word>,

ray_get_intersection_function: Option<Word>,
}

bitflags::bitflags! {
Expand Down
Loading

0 comments on commit b82f877

Please sign in to comment.