Skip to content

Commit

Permalink
Update naga with the new intersection code
Browse files Browse the repository at this point in the history
  • Loading branch information
kvark committed Feb 13, 2025
1 parent 7dffb3c commit e8598d4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ glam = { version = "0.28", features = ["mint"] }
gltf = { version = "1.1", default-features = false }
log = "0.4"
mint = "0.5"
naga = { version = "24.0", features = ["wgsl-in"] }
# Needed for https://github.com/gfx-rs/wgpu/pull/7047
naga = { git = "https://github.com/gfx-rs/wgpu", rev = "0f111cb27c3a06ac15325791212b9d4139d7eaa3", features = ["wgsl-in"] }
profiling = "1"
slab = "0.4"
strum = { version = "0.26", features = ["derive"] }
Expand Down
1 change: 1 addition & 0 deletions blade-graphics/src/metal/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ impl super::Context {
.collect(),
bounds_check_policies: naga::proc::BoundsCheckPolicies::default(),
zero_initialize_workgroup_memory: false,
force_loop_bounding: false,
};

let pipeline_options = msl::PipelineOptions {
Expand Down
4 changes: 2 additions & 2 deletions blade-render/code/fill-gbuf.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ fn main(@builtin(global_invocation_id) global_id: vec3<u32>) {
let enable_debug = all(global_id.xy == debug.mouse_pos);

if (intersection.kind != RAY_QUERY_INTERSECTION_NONE) {
let entry = hit_entries[intersection.instance_custom_index + intersection.geometry_index];
let entry = hit_entries[intersection.instance_custom_data + intersection.geometry_index];
depth = intersection.t;

var indices = intersection.primitive_index * 3u + vec3<u32>(0u, 1u, 2u);
Expand Down Expand Up @@ -132,7 +132,7 @@ fn main(@builtin(global_invocation_id) global_id: vec3<u32>) {

let hit_position = camera.position + intersection.t * ray_dir;
if (enable_debug) {
debug_buf.entry.custom_index = intersection.instance_custom_index;
debug_buf.entry.custom_index = intersection.instance_custom_data;
debug_buf.entry.depth = intersection.t;
debug_buf.entry.tex_coords = tex_coords;
debug_buf.entry.base_color_texture = entry.base_color_texture;
Expand Down

0 comments on commit e8598d4

Please sign in to comment.