mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-29 10:13:34 +00:00
Update to Naga rev 7aaac25f
.
This commit is contained in:
parent
4cba5ffbed
commit
a47b5c554f
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -1032,7 +1032,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "naga"
|
name = "naga"
|
||||||
version = "0.8.0"
|
version = "0.8.0"
|
||||||
source = "git+https://github.com/gfx-rs/naga?rev=f90e563#f90e563c281cfc71c794e0426ebcced9e3999202"
|
source = "git+https://github.com/gfx-rs/naga?rev=7aaac25f#7aaac25fbf64c0f77f0e2deba2963293f3632dad"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bit-set",
|
"bit-set",
|
||||||
"bitflags",
|
"bitflags",
|
||||||
|
@ -40,7 +40,7 @@ thiserror = "1"
|
|||||||
|
|
||||||
[dependencies.naga]
|
[dependencies.naga]
|
||||||
git = "https://github.com/gfx-rs/naga"
|
git = "https://github.com/gfx-rs/naga"
|
||||||
rev = "f90e563"
|
rev = "7aaac25f"
|
||||||
#version = "0.8"
|
#version = "0.8"
|
||||||
features = ["span", "validate", "wgsl-in"]
|
features = ["span", "validate", "wgsl-in"]
|
||||||
|
|
||||||
|
@ -845,7 +845,10 @@ impl Interface {
|
|||||||
sampling,
|
sampling,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Some(&naga::Binding::BuiltIn(built_in)) => Varying::BuiltIn(built_in),
|
Some(&naga::Binding::BuiltIn {
|
||||||
|
built_in,
|
||||||
|
invariant: _,
|
||||||
|
}) => Varying::BuiltIn(built_in),
|
||||||
None => {
|
None => {
|
||||||
log::error!("Missing binding for a varying");
|
log::error!("Missing binding for a varying");
|
||||||
return;
|
return;
|
||||||
|
@ -91,14 +91,14 @@ js-sys = { version = "0.3" }
|
|||||||
|
|
||||||
[dependencies.naga]
|
[dependencies.naga]
|
||||||
git = "https://github.com/gfx-rs/naga"
|
git = "https://github.com/gfx-rs/naga"
|
||||||
rev = "f90e563"
|
rev = "7aaac25f"
|
||||||
#version = "0.8"
|
#version = "0.8"
|
||||||
|
|
||||||
# DEV dependencies
|
# DEV dependencies
|
||||||
|
|
||||||
[dev-dependencies.naga]
|
[dev-dependencies.naga]
|
||||||
git = "https://github.com/gfx-rs/naga"
|
git = "https://github.com/gfx-rs/naga"
|
||||||
rev = "f90e563"
|
rev = "7aaac25f"
|
||||||
#version = "0.8"
|
#version = "0.8"
|
||||||
features = ["wgsl-in"]
|
features = ["wgsl-in"]
|
||||||
|
|
||||||
|
@ -139,20 +139,20 @@ env_logger = "0.9"
|
|||||||
|
|
||||||
[dependencies.naga]
|
[dependencies.naga]
|
||||||
git = "https://github.com/gfx-rs/naga"
|
git = "https://github.com/gfx-rs/naga"
|
||||||
rev = "f90e563"
|
rev = "7aaac25f"
|
||||||
#version = "0.8"
|
#version = "0.8"
|
||||||
optional = true
|
optional = true
|
||||||
|
|
||||||
# used to test all the example shaders
|
# used to test all the example shaders
|
||||||
[dev-dependencies.naga]
|
[dev-dependencies.naga]
|
||||||
git = "https://github.com/gfx-rs/naga"
|
git = "https://github.com/gfx-rs/naga"
|
||||||
rev = "f90e563"
|
rev = "7aaac25f"
|
||||||
#version = "0.8"
|
#version = "0.8"
|
||||||
features = ["wgsl-in"]
|
features = ["wgsl-in"]
|
||||||
|
|
||||||
[target.'cfg(target_arch = "wasm32")'.dependencies.naga]
|
[target.'cfg(target_arch = "wasm32")'.dependencies.naga]
|
||||||
git = "https://github.com/gfx-rs/naga"
|
git = "https://github.com/gfx-rs/naga"
|
||||||
rev = "f90e563"
|
rev = "7aaac25f"
|
||||||
#version = "0.8"
|
#version = "0.8"
|
||||||
features = ["wgsl-out"]
|
features = ["wgsl-out"]
|
||||||
|
|
||||||
|
@ -242,10 +242,10 @@ fn fs_main(in: VertexOutput) -> @location(0) vec4<f32> {
|
|||||||
let terrain_depth = to_linear_depth(textureSample(terrain_depth_tex, depth_sampler, normalized_coords).r);
|
let terrain_depth = to_linear_depth(textureSample(terrain_depth_tex, depth_sampler, normalized_coords).r);
|
||||||
|
|
||||||
let dist = terrain_depth - pixel_depth;
|
let dist = terrain_depth - pixel_depth;
|
||||||
let clamped = pow(smoothStep(0.0, 1.5, dist), 4.8);
|
let clamped = pow(smoothstep(0.0, 1.5, dist), 4.8);
|
||||||
|
|
||||||
let final_colour = in.f_Light + reflection_colour;
|
let final_colour = in.f_Light + reflection_colour;
|
||||||
let t = smoothStep(1.0, 5.0, dist) * 0.2; //TODO: splat for mix()?
|
let t = smoothstep(1.0, 5.0, dist) * 0.2; //TODO: splat for mix()?
|
||||||
let depth_colour = mix(final_colour, water_colour, vec3<f32>(t, t, t));
|
let depth_colour = mix(final_colour, water_colour, vec3<f32>(t, t, t));
|
||||||
|
|
||||||
return vec4<f32>(depth_colour, clamped * (1.0 - in.f_Fresnel));
|
return vec4<f32>(depth_colour, clamped * (1.0 - in.f_Fresnel));
|
||||||
|
Loading…
Reference in New Issue
Block a user