Skip to content

Commit a46b52a

Browse files
committed
wgpu 0.17
1 parent 8a8d43d commit a46b52a

File tree

4 files changed

+12
-26
lines changed

4 files changed

+12
-26
lines changed

crates/bevy_pbr/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ bevy_derive = { path = "../bevy_derive", version = "0.12.0-dev" }
2929
bitflags = "2.3"
3030
# direct dependency required for derive macro
3131
bytemuck = { version = "1", features = ["derive"] }
32-
naga_oil = "0.8"
3332
radsort = "0.1"
33+
# naga_oil = "0.8"
34+
naga_oil = { git = "https://github.com/VitalyAnkh/naga_oil.git", branch = "update-naga-to-0.13" }
3435
smallvec = "1.6"

crates/bevy_pbr/src/ssao/gtao.wgsl

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,12 @@ fn calculate_neighboring_depth_differences(pixel_coordinates: vec2<i32>) -> f32
5353
edge_info = saturate((1.0 + bias) - edge_info / scale); // Apply the bias and scale, and invert edge_info so that small values become large, and vice versa
5454

5555
// Pack the edge info into the texture
56-
let edge_info_packed = vec4<u32>(mypack4x8unorm(edge_info), 0u, 0u, 0u);
56+
let edge_info_packed = vec4<u32>(pack4x8unorm(edge_info), 0u, 0u, 0u);
5757
textureStore(depth_differences, pixel_coordinates, edge_info_packed);
5858

5959
return depth_center;
6060
}
6161

62-
// TODO: Remove this once https://github.com/gfx-rs/naga/pull/2353 lands
63-
fn mypack4x8unorm(e: vec4<f32>) -> u32 {
64-
return u32(clamp(e.x, 0.0, 1.0) * 255.0 + 0.5) |
65-
u32(clamp(e.y, 0.0, 1.0) * 255.0 + 0.5) << 8u |
66-
u32(clamp(e.z, 0.0, 1.0) * 255.0 + 0.5) << 16u |
67-
u32(clamp(e.w, 0.0, 1.0) * 255.0 + 0.5) << 24u;
68-
}
69-
7062
fn load_normal_view_space(uv: vec2<f32>) -> vec3<f32> {
7163
var world_normal = textureSampleLevel(normals, point_clamp_sampler, uv, 0.0).xyz;
7264
world_normal = (world_normal * 2.0) - 1.0;

crates/bevy_pbr/src/ssao/spatial_denoise.wgsl

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ fn spatial_denoise(@builtin(global_invocation_id) global_id: vec3<u32>) {
3131
let visibility2 = textureGather(0, ambient_occlusion_noisy, point_clamp_sampler, uv, vec2<i32>(0i, 2i));
3232
let visibility3 = textureGather(0, ambient_occlusion_noisy, point_clamp_sampler, uv, vec2<i32>(2i, 2i));
3333

34-
let left_edges = myunpack4x8unorm(edges0.x);
35-
let right_edges = myunpack4x8unorm(edges1.x);
36-
let top_edges = myunpack4x8unorm(edges0.z);
37-
let bottom_edges = myunpack4x8unorm(edges2.w);
38-
var center_edges = myunpack4x8unorm(edges0.y);
34+
let left_edges = unpack4x8unorm(edges0.x);
35+
let right_edges = unpack4x8unorm(edges1.x);
36+
let top_edges = unpack4x8unorm(edges0.z);
37+
let bottom_edges = unpack4x8unorm(edges2.w);
38+
var center_edges = unpack4x8unorm(edges0.y);
3939
center_edges *= vec4<f32>(left_edges.y, right_edges.x, top_edges.w, bottom_edges.z);
4040

4141
let center_weight = 1.2;
@@ -82,11 +82,3 @@ fn spatial_denoise(@builtin(global_invocation_id) global_id: vec3<u32>) {
8282

8383
textureStore(ambient_occlusion, pixel_coordinates, vec4<f32>(denoised_visibility, 0.0, 0.0, 0.0));
8484
}
85-
86-
// TODO: Remove this once https://github.com/gfx-rs/naga/pull/2353 lands in Bevy
87-
fn myunpack4x8unorm(e: u32) -> vec4<f32> {
88-
return vec4<f32>(clamp(f32(e & 0xFFu) / 255.0, 0.0, 1.0),
89-
clamp(f32((e >> 8u) & 0xFFu) / 255.0, 0.0, 1.0),
90-
clamp(f32((e >> 16u) & 0xFFu) / 255.0, 0.0, 1.0),
91-
clamp(f32((e >> 24u) & 0xFFu) / 255.0, 0.0, 1.0));
92-
}

crates/bevy_render/Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ bevy_tasks = { path = "../bevy_tasks", version = "0.12.0-dev" }
5757
image = { version = "0.24", default-features = false }
5858

5959
# misc
60-
wgpu = { version = "0.16.0", features=["naga"] }
60+
wgpu = { version = "0.17.0", features=["naga"] }
6161
codespan-reporting = "0.11.0"
62-
naga = { version = "0.12.0", features = ["wgsl-in"] }
62+
naga = { version = "0.13.0", features = ["wgsl-in"] }
6363
serde = { version = "1", features = ["derive"] }
6464
bitflags = "2.3"
6565
bytemuck = { version = "1.5", features = ["derive"] }
@@ -74,7 +74,8 @@ parking_lot = "0.12.1"
7474
regex = "1.5"
7575
ddsfile = { version = "0.5.0", optional = true }
7676
ktx2 = { version = "0.3.0", optional = true }
77-
naga_oil = "0.8"
77+
# naga_oil = "0.8"
78+
naga_oil = { git = "https://github.com/VitalyAnkh/naga_oil.git", branch = "update-naga-to-0.13" }
7879
# For ktx2 supercompression
7980
flate2 = { version = "1.0.22", optional = true }
8081
ruzstd = { version = "0.4.0", optional = true }

0 commit comments

Comments
 (0)