From 39606585296a3c20214fc60818e210f3b4a541de Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Wed, 15 Dec 2021 12:29:37 -0500 Subject: [PATCH] Remove block decorations (#2292) --- Cargo.lock | 2 +- player/tests/data/zero-init-buffer-for-binding.wgsl | 1 - wgpu-core/Cargo.toml | 2 +- wgpu-core/src/validation.rs | 6 +----- wgpu-hal/Cargo.toml | 4 ++-- wgpu-hal/examples/halmark/shader.wgsl | 2 -- wgpu/Cargo.toml | 6 +++--- wgpu/examples/boids/compute.wgsl | 2 -- wgpu/examples/cube/shader.wgsl | 1 - wgpu/examples/hello-compute/shader.wgsl | 1 - wgpu/examples/mipmap/draw.wgsl | 1 - wgpu/examples/shadow/shader.wgsl | 4 ---- wgpu/examples/skybox/shader.wgsl | 1 - wgpu/examples/water/terrain.wgsl | 1 - wgpu/examples/water/water.wgsl | 1 - wgpu/tests/vertex_indices/draw.vert.wgsl | 1 - 16 files changed, 8 insertions(+), 28 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 814d245ab3..c968af57b3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -871,7 +871,7 @@ dependencies = [ [[package]] name = "naga" version = "0.7.1" -source = "git+https://github.com/gfx-rs/naga?rev=3867ef4#3867ef4f6cba6af0bbeec330c9379d7ade14e4ef" +source = "git+https://github.com/gfx-rs/naga?rev=8ffd6ba#8ffd6ba929b4b93c9564f08fe8bb34b23fa72a6f" dependencies = [ "bit-set", "bitflags", diff --git a/player/tests/data/zero-init-buffer-for-binding.wgsl b/player/tests/data/zero-init-buffer-for-binding.wgsl index d99e1407a2..41d33705a0 100644 --- a/player/tests/data/zero-init-buffer-for-binding.wgsl +++ b/player/tests/data/zero-init-buffer-for-binding.wgsl @@ -1,4 +1,3 @@ -[[block]] struct InOutBuffer { data: [[stride(4)]] array; }; diff --git a/wgpu-core/Cargo.toml b/wgpu-core/Cargo.toml index d01b6a7f3e..ba0fd48d54 100644 --- a/wgpu-core/Cargo.toml +++ b/wgpu-core/Cargo.toml @@ -38,7 +38,7 @@ thiserror = "1" [dependencies.naga] git = "https://github.com/gfx-rs/naga" -rev = "3867ef4" +rev = "8ffd6ba" #version = "0.7" features = ["span", "validate", "wgsl-in"] diff --git a/wgpu-core/src/validation.rs b/wgpu-core/src/validation.rs index 614c52b215..32fbe8bbc1 100644 --- a/wgpu-core/src/validation.rs +++ b/wgpu-core/src/validation.rs @@ -892,11 +892,7 @@ impl Interface { _ => continue, }; let ty = match module.types[var.ty].inner { - naga::TypeInner::Struct { - top_level: true, - members: _, - span, - } => ResourceType::Buffer { + naga::TypeInner::Struct { members: _, span } => ResourceType::Buffer { size: wgt::BufferSize::new(span as u64).unwrap(), }, naga::TypeInner::Image { diff --git a/wgpu-hal/Cargo.toml b/wgpu-hal/Cargo.toml index 7542a3a88b..c38b9d9938 100644 --- a/wgpu-hal/Cargo.toml +++ b/wgpu-hal/Cargo.toml @@ -75,12 +75,12 @@ js-sys = { version = "0.3" } [dependencies.naga] git = "https://github.com/gfx-rs/naga" -rev = "3867ef4" +rev = "8ffd6ba" #version = "0.7" [dev-dependencies.naga] git = "https://github.com/gfx-rs/naga" -rev = "3867ef4" +rev = "8ffd6ba" #version = "0.7" features = ["wgsl-in"] diff --git a/wgpu-hal/examples/halmark/shader.wgsl b/wgpu-hal/examples/halmark/shader.wgsl index 8030b5bd39..a72128f762 100644 --- a/wgpu-hal/examples/halmark/shader.wgsl +++ b/wgpu-hal/examples/halmark/shader.wgsl @@ -1,10 +1,8 @@ -[[block]] struct Globals { mvp: mat4x4; size: vec2; }; -[[block]] struct Locals { position: vec2; velocity: vec2; diff --git a/wgpu/Cargo.toml b/wgpu/Cargo.toml index e3b1266dbf..a2dbf7a511 100644 --- a/wgpu/Cargo.toml +++ b/wgpu/Cargo.toml @@ -136,20 +136,20 @@ env_logger = "0.8" [dependencies.naga] git = "https://github.com/gfx-rs/naga" -rev = "3867ef4" +rev = "8ffd6ba" #version = "0.7" optional = true # used to test all the example shaders [dev-dependencies.naga] git = "https://github.com/gfx-rs/naga" -rev = "3867ef4" +rev = "8ffd6ba" #version = "0.7" features = ["wgsl-in"] [target.'cfg(target_arch = "wasm32")'.dependencies.naga] git = "https://github.com/gfx-rs/naga" -rev = "3867ef4" +rev = "8ffd6ba" #version = "0.7" features = ["wgsl-out"] diff --git a/wgpu/examples/boids/compute.wgsl b/wgpu/examples/boids/compute.wgsl index 68be4894e8..de25a98cb2 100644 --- a/wgpu/examples/boids/compute.wgsl +++ b/wgpu/examples/boids/compute.wgsl @@ -3,7 +3,6 @@ struct Particle { vel : vec2; }; -[[block]] struct SimParams { deltaT : f32; rule1Distance : f32; @@ -14,7 +13,6 @@ struct SimParams { rule3Scale : f32; }; -[[block]] struct Particles { particles : [[stride(16)]] array; }; diff --git a/wgpu/examples/cube/shader.wgsl b/wgpu/examples/cube/shader.wgsl index 9051a6cbbd..4bd4305abf 100644 --- a/wgpu/examples/cube/shader.wgsl +++ b/wgpu/examples/cube/shader.wgsl @@ -3,7 +3,6 @@ struct VertexOutput { [[builtin(position)]] position: vec4; }; -[[block]] struct Locals { transform: mat4x4; }; diff --git a/wgpu/examples/hello-compute/shader.wgsl b/wgpu/examples/hello-compute/shader.wgsl index 9a14f9065c..df541aff5e 100644 --- a/wgpu/examples/hello-compute/shader.wgsl +++ b/wgpu/examples/hello-compute/shader.wgsl @@ -1,4 +1,3 @@ -[[block]] struct PrimeIndices { data: [[stride(4)]] array; }; // this is used as both input and output for convenience diff --git a/wgpu/examples/mipmap/draw.wgsl b/wgpu/examples/mipmap/draw.wgsl index c87b463d4d..5d8bb2df1a 100644 --- a/wgpu/examples/mipmap/draw.wgsl +++ b/wgpu/examples/mipmap/draw.wgsl @@ -3,7 +3,6 @@ struct VertexOutput { [[location(0)]] tex_coords: vec2; }; -[[block]] struct Locals { transform: mat4x4; }; diff --git a/wgpu/examples/shadow/shader.wgsl b/wgpu/examples/shadow/shader.wgsl index a4984bf33b..1be7d914b7 100644 --- a/wgpu/examples/shadow/shader.wgsl +++ b/wgpu/examples/shadow/shader.wgsl @@ -1,4 +1,3 @@ -[[block]] struct Globals { view_proj: mat4x4; num_lights: vec4; @@ -7,7 +6,6 @@ struct Globals { [[group(0), binding(0)]] var u_globals: Globals; -[[block]] struct Entity { world: mat4x4; color: vec4; @@ -49,13 +47,11 @@ struct Light { color: vec4; }; -[[block]] struct Lights { data: [[stride(96)]] array; }; // Used when storage types are not supported -[[block]] struct LightsWithoutStorage { data: array; }; diff --git a/wgpu/examples/skybox/shader.wgsl b/wgpu/examples/skybox/shader.wgsl index f4e7681405..d10f293e70 100644 --- a/wgpu/examples/skybox/shader.wgsl +++ b/wgpu/examples/skybox/shader.wgsl @@ -3,7 +3,6 @@ struct SkyOutput { [[location(0)]] uv: vec3; }; -[[block]] struct Data { // from camera to screen proj: mat4x4; diff --git a/wgpu/examples/water/terrain.wgsl b/wgpu/examples/water/terrain.wgsl index 2af261bf4b..9f7e256900 100644 --- a/wgpu/examples/water/terrain.wgsl +++ b/wgpu/examples/water/terrain.wgsl @@ -1,4 +1,3 @@ -[[block]] struct Uniforms { projection_view: mat4x4; clipping_plane: vec4; diff --git a/wgpu/examples/water/water.wgsl b/wgpu/examples/water/water.wgsl index 0e69955bf2..b7a4701f0e 100644 --- a/wgpu/examples/water/water.wgsl +++ b/wgpu/examples/water/water.wgsl @@ -1,4 +1,3 @@ -[[block]] struct Uniforms { view: mat4x4; projection: mat4x4; diff --git a/wgpu/tests/vertex_indices/draw.vert.wgsl b/wgpu/tests/vertex_indices/draw.vert.wgsl index 5161ef29bf..a4babee980 100644 --- a/wgpu/tests/vertex_indices/draw.vert.wgsl +++ b/wgpu/tests/vertex_indices/draw.vert.wgsl @@ -1,4 +1,3 @@ -[[block]] struct Indices { arr: array; }; // this is used as both input and output for convenience