Skip to content

Commit

Permalink
Update naga and use built-in ray flags
Browse files Browse the repository at this point in the history
  • Loading branch information
kvark committed Nov 28, 2024
1 parent 5da73b1 commit 4ddcef9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ glam = { version = "0.28", features = ["mint"] }
gltf = { version = "1.1", default-features = false }
log = "0.4"
mint = "0.5"
naga = { version = "23.0", features = ["wgsl-in"] }
naga = { git = "https://github.com/gfx-rs/wgpu", rev = "1a643291c2e8854ba7e4f5445a4388202731bfa1", features = [
"wgsl-in",
] }
profiling = "1"
slab = "0.4"
strum = { version = "0.25", features = ["derive"] }
Expand Down
3 changes: 0 additions & 3 deletions blade-render/code/fill-gbuf.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
#include "debug-param.inc.wgsl"
#include "gbuf.inc.wgsl"

//TODO: use proper WGSL
const RAY_FLAG_CULL_NO_OPAQUE: u32 = 0x80u;

// Has to match the host!
struct Vertex {
pos: vec3<f32>,
Expand Down
3 changes: 0 additions & 3 deletions blade-render/code/ray-trace.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
#include "surface.inc.wgsl"
#include "gbuf.inc.wgsl"

//TODO: use proper WGSL
const RAY_FLAG_CULL_NO_OPAQUE: u32 = 0x80u;

const PI: f32 = 3.1415926;
const MAX_RESERVOIRS: u32 = 4u;
// See "DECOUPLING SHADING AND REUSE" in
Expand Down
4 changes: 2 additions & 2 deletions examples/ray-query/shader.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ fn main(@builtin(global_invocation_id) global_id: vec3<u32>) {
var ray_pos = qrot(rotator, parameters.cam_position);
var ray_dir = qrot(rotator, world_dir);
loop {
rayQueryInitialize(&rq, acc_struct, RayDesc(0u, 0xFFu, 0.1, parameters.depth, ray_pos, ray_dir));
rayQueryInitialize(&rq, acc_struct, RayDesc(RAY_FLAG_NONE, 0xFFu, 0.1, parameters.depth, ray_pos, ray_dir));
rayQueryProceed(&rq);
let intersection = rayQueryGetCommittedIntersection(&rq);
if (intersection.kind == RAY_QUERY_INTERSECTION_NONE) {
Expand All @@ -85,7 +85,7 @@ fn main(@builtin(global_invocation_id) global_id: vec3<u32>) {
break;
}
}

let color = get_miss_color(ray_dir);
textureStore(output, global_id.xy, color);
}
Expand Down

0 comments on commit 4ddcef9

Please sign in to comment.