diff --git a/Cargo.toml b/Cargo.toml index fc45ec4..061ebe6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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"] } diff --git a/blade-render/code/fill-gbuf.wgsl b/blade-render/code/fill-gbuf.wgsl index 180cd62..e574bc4 100644 --- a/blade-render/code/fill-gbuf.wgsl +++ b/blade-render/code/fill-gbuf.wgsl @@ -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, diff --git a/blade-render/code/ray-trace.wgsl b/blade-render/code/ray-trace.wgsl index df4c335..94e3e21 100644 --- a/blade-render/code/ray-trace.wgsl +++ b/blade-render/code/ray-trace.wgsl @@ -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 diff --git a/examples/ray-query/shader.wgsl b/examples/ray-query/shader.wgsl index e17e3c1..8387ab0 100644 --- a/examples/ray-query/shader.wgsl +++ b/examples/ray-query/shader.wgsl @@ -69,7 +69,7 @@ fn main(@builtin(global_invocation_id) global_id: vec3) { 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) { @@ -85,7 +85,7 @@ fn main(@builtin(global_invocation_id) global_id: vec3) { break; } } - + let color = get_miss_color(ray_dir); textureStore(output, global_id.xy, color); }