better wgsl code style
This commit is contained in:
parent
a88155b2a2
commit
390e2a2d34
4 changed files with 11 additions and 11 deletions
|
|
@ -21,12 +21,12 @@ var<private> uvs: array<vec2<f32>, 6> = array<vec2<f32>, 6>(
|
|||
|
||||
struct VertexInput {
|
||||
@builtin(vertex_index) vertex_index: u32,
|
||||
};
|
||||
}
|
||||
|
||||
struct VertexOutput {
|
||||
@builtin(position) position: vec4<f32>,
|
||||
@location(0) uv: vec2<f32>,
|
||||
};
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vs_main(input: VertexInput) -> VertexOutput {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
struct Globals {
|
||||
transform: mat4x4<f32>,
|
||||
};
|
||||
}
|
||||
|
||||
@group(0) @binding(0) var<uniform> globals: Globals;
|
||||
@group(0) @binding(1) var u_sampler: sampler;
|
||||
|
|
@ -13,13 +13,13 @@ struct VertexInput {
|
|||
@location(3) atlas_pos: vec2<f32>,
|
||||
@location(4) atlas_scale: vec2<f32>,
|
||||
@location(5) layer: i32,
|
||||
};
|
||||
}
|
||||
|
||||
struct VertexOutput {
|
||||
@builtin(position) position: vec4<f32>,
|
||||
@location(0) uv: vec2<f32>,
|
||||
@location(1) layer: f32, // this should be an i32, but naga currently reads that as requiring interpolation.
|
||||
};
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vs_main(input: VertexInput) -> VertexOutput {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
struct Globals {
|
||||
transform: mat4x4<f32>,
|
||||
scale: f32,
|
||||
};
|
||||
}
|
||||
|
||||
@group(0) @binding(0) var<uniform> globals: Globals;
|
||||
|
||||
|
|
@ -13,7 +13,7 @@ struct VertexInput {
|
|||
@location(4) border_color: vec4<f32>,
|
||||
@location(5) border_radius: f32,
|
||||
@location(6) border_width: f32,
|
||||
};
|
||||
}
|
||||
|
||||
struct VertexOutput {
|
||||
@builtin(position) position: vec4<f32>,
|
||||
|
|
@ -23,7 +23,7 @@ struct VertexOutput {
|
|||
@location(3) scale: vec2<f32>,
|
||||
@location(4) border_radius: f32,
|
||||
@location(5) border_width: f32,
|
||||
};
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vs_main(input: VertexInput) -> VertexOutput {
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
struct Globals {
|
||||
transform: mat4x4<f32>,
|
||||
};
|
||||
}
|
||||
|
||||
@group(0) @binding(0) var<uniform> globals: Globals;
|
||||
|
||||
struct VertexInput {
|
||||
@location(0) position: vec2<f32>,
|
||||
@location(1) color: vec4<f32>,
|
||||
};
|
||||
}
|
||||
|
||||
struct VertexOutput {
|
||||
@builtin(position) position: vec4<f32>,
|
||||
@location(0) color: vec4<f32>,
|
||||
};
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vs_main(input: VertexInput) -> VertexOutput {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue