Skip to content

Commit

Permalink
[naga] Update naga with new struct members separator
Browse files Browse the repository at this point in the history
  • Loading branch information
Gordon-F committed Mar 15, 2022
1 parent 73f4235 commit b076449
Show file tree
Hide file tree
Showing 15 changed files with 68 additions and 68 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion wgpu-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ thiserror = "1"

[dependencies.naga]
git = "https://github.com/gfx-rs/naga"
rev = "a45b9a6"
rev = "f90e563"
#version = "0.8"
features = ["span", "validate", "wgsl-in"]

Expand Down
4 changes: 2 additions & 2 deletions wgpu-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@ js-sys = { version = "0.3" }

[dependencies.naga]
git = "https://github.com/gfx-rs/naga"
rev = "a45b9a6"
rev = "f90e563"
#version = "0.8"

# DEV dependencies

[dev-dependencies.naga]
git = "https://github.com/gfx-rs/naga"
rev = "a45b9a6"
rev = "f90e563"
#version = "0.8"
features = ["wgsl-in"]

Expand Down
16 changes: 8 additions & 8 deletions wgpu-hal/examples/halmark/shader.wgsl
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
struct Globals {
mvp: mat4x4<f32>;
size: vec2<f32>;
mvp: mat4x4<f32>,
size: vec2<f32>,
};

struct Locals {
position: vec2<f32>;
velocity: vec2<f32>;
color: u32;
position: vec2<f32>,
velocity: vec2<f32>,
color: u32,
};

@group(0)
Expand All @@ -18,9 +18,9 @@ var<uniform> globals: Globals;
var<uniform> locals: Locals;

struct VertexOutput {
@builtin(position) position: vec4<f32>;
@location(0) tex_coords: vec2<f32>;
@location(1) color: vec4<f32>;
@builtin(position) position: vec4<f32>,
@location(0) tex_coords: vec2<f32>,
@location(1) color: vec4<f32>,
};

@stage(vertex)
Expand Down
6 changes: 3 additions & 3 deletions wgpu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -139,20 +139,20 @@ env_logger = "0.9"

[dependencies.naga]
git = "https://github.com/gfx-rs/naga"
rev = "a45b9a6"
rev = "f90e563"
#version = "0.8"
optional = true

# used to test all the example shaders
[dev-dependencies.naga]
git = "https://github.com/gfx-rs/naga"
rev = "a45b9a6"
rev = "f90e563"
#version = "0.8"
features = ["wgsl-in"]

[target.'cfg(target_arch = "wasm32")'.dependencies.naga]
git = "https://github.com/gfx-rs/naga"
rev = "a45b9a6"
rev = "f90e563"
#version = "0.8"
features = ["wgsl-out"]

Expand Down
18 changes: 9 additions & 9 deletions wgpu/examples/boids/compute.wgsl
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
struct Particle {
pos : vec2<f32>;
vel : vec2<f32>;
pos : vec2<f32>,
vel : vec2<f32>,
};

struct SimParams {
deltaT : f32;
rule1Distance : f32;
rule2Distance : f32;
rule3Distance : f32;
rule1Scale : f32;
rule2Scale : f32;
rule3Scale : f32;
deltaT : f32,
rule1Distance : f32,
rule2Distance : f32,
rule3Distance : f32,
rule1Scale : f32,
rule2Scale : f32,
rule3Scale : f32,
};

@group(0) @binding(0) var<uniform> params : SimParams;
Expand Down
4 changes: 2 additions & 2 deletions wgpu/examples/conservative-raster/upscale.wgsl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
struct VertexOutput {
@builtin(position) position: vec4<f32>;
@location(0) tex_coords: vec2<f32>;
@builtin(position) position: vec4<f32>,
@location(0) tex_coords: vec2<f32>,
};

@stage(vertex)
Expand Down
6 changes: 3 additions & 3 deletions wgpu/examples/cube/shader.wgsl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
struct VertexOutput {
@location(0) tex_coord: vec2<f32>;
@builtin(position) position: vec4<f32>;
@location(0) tex_coord: vec2<f32>,
@builtin(position) position: vec4<f32>,
};

struct Locals {
transform: mat4x4<f32>;
transform: mat4x4<f32>
};
@group(0)
@binding(0)
Expand Down
4 changes: 2 additions & 2 deletions wgpu/examples/mipmap/blit.wgsl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
struct VertexOutput {
@builtin(position) position: vec4<f32>;
@location(0) tex_coords: vec2<f32>;
@builtin(position) position: vec4<f32>,
@location(0) tex_coords: vec2<f32>,
};

@stage(vertex)
Expand Down
6 changes: 3 additions & 3 deletions wgpu/examples/mipmap/draw.wgsl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
struct VertexOutput {
@builtin(position) position: vec4<f32>;
@location(0) tex_coords: vec2<f32>;
@builtin(position) position: vec4<f32>,
@location(0) tex_coords: vec2<f32>,
};

struct Locals {
transform: mat4x4<f32>;
transform: mat4x4<f32>
};
@group(0)
@binding(0)
Expand Down
4 changes: 2 additions & 2 deletions wgpu/examples/msaa-line/shader.wgsl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
struct VertexOutput {
@location(0) color: vec4<f32>;
@builtin(position) position: vec4<f32>;
@location(0) color: vec4<f32>,
@builtin(position) position: vec4<f32>,
};

@stage(vertex)
Expand Down
20 changes: 10 additions & 10 deletions wgpu/examples/shadow/shader.wgsl
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
struct Globals {
view_proj: mat4x4<f32>;
num_lights: vec4<u32>;
view_proj: mat4x4<f32>,
num_lights: vec4<u32>,
};

@group(0)
@binding(0)
var<uniform> u_globals: Globals;

struct Entity {
world: mat4x4<f32>;
color: vec4<f32>;
world: mat4x4<f32>,
color: vec4<f32>,
};

@group(1)
Expand All @@ -22,9 +22,9 @@ fn vs_bake(@location(0) position: vec4<i32>) -> @builtin(position) vec4<f32> {
}

struct VertexOutput {
@builtin(position) proj_position: vec4<f32>;
@location(0) world_normal: vec3<f32>;
@location(1) world_position: vec4<f32>;
@builtin(position) proj_position: vec4<f32>,
@location(0) world_normal: vec3<f32>,
@location(1) world_position: vec4<f32>
};

@stage(vertex)
Expand All @@ -44,9 +44,9 @@ fn vs_main(
// fragment shader

struct Light {
proj: mat4x4<f32>;
pos: vec4<f32>;
color: vec4<f32>;
proj: mat4x4<f32>,
pos: vec4<f32>,
color: vec4<f32>,
};

@group(0)
Expand Down
18 changes: 9 additions & 9 deletions wgpu/examples/skybox/shader.wgsl
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
struct SkyOutput {
@builtin(position) position: vec4<f32>;
@location(0) uv: vec3<f32>;
@builtin(position) position: vec4<f32>,
@location(0) uv: vec3<f32>,
};

struct Data {
// from camera to screen
proj: mat4x4<f32>;
proj: mat4x4<f32>,
// from screen to camera
proj_inv: mat4x4<f32>;
proj_inv: mat4x4<f32>,
// from world to camera
view: mat4x4<f32>;
view: mat4x4<f32>,
// camera position
cam_pos: vec4<f32>;
cam_pos: vec4<f32>,
};
@group(0)
@binding(0)
Expand Down Expand Up @@ -40,9 +40,9 @@ fn vs_sky(@builtin(vertex_index) vertex_index: u32) -> SkyOutput {
}

struct EntityOutput {
@builtin(position) position: vec4<f32>;
@location(1) normal: vec3<f32>;
@location(3) view: vec3<f32>;
@builtin(position) position: vec4<f32>,
@location(1) normal: vec3<f32>,
@location(3) view: vec3<f32>,
};

@stage(vertex)
Expand Down
10 changes: 5 additions & 5 deletions wgpu/examples/water/terrain.wgsl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
struct Uniforms {
projection_view: mat4x4<f32>;
clipping_plane: vec4<f32>;
projection_view: mat4x4<f32>,
clipping_plane: vec4<f32>,
};

@group(0)
Expand All @@ -12,10 +12,10 @@ let light_colour = vec3<f32>(1.0, 0.98, 0.82);
let ambient = 0.2;

struct VertexOutput {
@builtin(position) position: vec4<f32>;
@location(0) colour: vec4<f32>;
@builtin(position) position: vec4<f32>,
@location(0) colour: vec4<f32>,
// Comment this out if using user-clipping planes:
@location(1) clip_dist: f32;
@location(1) clip_dist: f32,
};

@stage(vertex)
Expand Down
16 changes: 8 additions & 8 deletions wgpu/examples/water/water.wgsl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
struct Uniforms {
view: mat4x4<f32>;
projection: mat4x4<f32>;
time_size_width: vec4<f32>;
viewport_height: f32;
view: mat4x4<f32>,
projection: mat4x4<f32>,
time_size_width: vec4<f32>,
viewport_height: f32,
};
@group(0) @binding(0) var<uniform> uniforms: Uniforms;

Expand Down Expand Up @@ -181,10 +181,10 @@ fn calc_specular(eye: vec3<f32>, normal: vec3<f32>, light: vec3<f32>) -> f32 {
}

struct VertexOutput {
@builtin(position) position: vec4<f32>;
@location(0) f_WaterScreenPos: vec2<f32>;
@location(1) f_Fresnel: f32;
@location(2) f_Light: vec3<f32>;
@builtin(position) position: vec4<f32>,
@location(0) f_WaterScreenPos: vec2<f32>,
@location(1) f_Fresnel: f32,
@location(2) f_Light: vec3<f32>,
};

@stage(vertex)
Expand Down

0 comments on commit b076449

Please sign in to comment.