Skip to content

Commit

Permalink
[wgsl-out] Update entry point stage attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
Gordon-F authored and JCapucho committed Apr 15, 2022
1 parent fbb77aa commit 1720725
Show file tree
Hide file tree
Showing 57 changed files with 75 additions and 75 deletions.
2 changes: 1 addition & 1 deletion src/back/wgsl/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ impl<W: Write> Writer<W> {
ShaderStage::Fragment => "fragment",
ShaderStage::Compute => "compute",
};
write!(self.out, "@stage({}) ", stage_str)?;
write!(self.out, "@{} ", stage_str)?;
}
Attribute::WorkGroupSize(size) => {
write!(
Expand Down
2 changes: 1 addition & 1 deletion tests/out/wgsl/210-bevy-2d-shader-frag.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fn main_1() {
return;
}

@stage(fragment)
@fragment
fn main(@location(0) v_Uv: vec2<f32>) -> FragmentOutput {
v_Uv_1 = v_Uv;
main_1();
Expand Down
2 changes: 1 addition & 1 deletion tests/out/wgsl/210-bevy-2d-shader-vert.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ fn main_1() {
return;
}

@stage(vertex)
@vertex
fn main(@location(0) Vertex_Position: vec3<f32>, @location(1) Vertex_Normal: vec3<f32>, @location(2) Vertex_Uv: vec2<f32>) -> VertexOutput {
Vertex_Position_1 = Vertex_Position;
Vertex_Normal_1 = Vertex_Normal;
Expand Down
2 changes: 1 addition & 1 deletion tests/out/wgsl/210-bevy-shader-vert.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ fn main_1() {
return;
}

@stage(vertex)
@vertex
fn main(@location(0) Vertex_Position: vec3<f32>, @location(1) Vertex_Normal: vec3<f32>, @location(2) Vertex_Uv: vec2<f32>) -> VertexOutput {
Vertex_Position_1 = Vertex_Position;
Vertex_Normal_1 = Vertex_Normal;
Expand Down
2 changes: 1 addition & 1 deletion tests/out/wgsl/246-collatz-comp.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ fn main_1() {
return;
}

@stage(compute) @workgroup_size(1, 1, 1)
@compute @workgroup_size(1, 1, 1)
fn main(@builtin(global_invocation_id) param: vec3<u32>) {
gl_GlobalInvocationID = param;
main_1();
Expand Down
2 changes: 1 addition & 1 deletion tests/out/wgsl/277-casting-vert.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ fn main_1() {

}

@stage(vertex)
@vertex
fn main() {
main_1();
return;
Expand Down
2 changes: 1 addition & 1 deletion tests/out/wgsl/280-matrix-cast-vert.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ fn main_1() {
let _e1 = f32(1);
}

@stage(vertex)
@vertex
fn main() {
main_1();
return;
Expand Down
2 changes: 1 addition & 1 deletion tests/out/wgsl/484-preprocessor-if-vert.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ fn main_1() {
return;
}

@stage(vertex)
@vertex
fn main() {
main_1();
return;
Expand Down
2 changes: 1 addition & 1 deletion tests/out/wgsl/800-out-of-bounds-panic-vert.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fn main_1() {
return;
}

@stage(vertex)
@vertex
fn main(@location(0) position: vec2<f32>, @location(1) color: vec4<f32>) -> VertexOutput {
position_1 = position;
color_1 = color;
Expand Down
2 changes: 1 addition & 1 deletion tests/out/wgsl/896-push-constant-vert.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ fn main_1() {
return;
}

@stage(vertex)
@vertex
fn main() {
main_1();
return;
Expand Down
2 changes: 1 addition & 1 deletion tests/out/wgsl/900-implicit-conversions-vert.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ fn main_1() {
return;
}

@stage(vertex)
@vertex
fn main() {
main_1();
return;
Expand Down
2 changes: 1 addition & 1 deletion tests/out/wgsl/901-lhs-field-select-vert.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ fn main_1() {
return;
}

@stage(vertex)
@vertex
fn main() {
main_1();
return;
Expand Down
2 changes: 1 addition & 1 deletion tests/out/wgsl/931-constant-emitting-vert.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ fn main_1() {
return;
}

@stage(vertex)
@vertex
fn main() {
main_1();
return;
Expand Down
2 changes: 1 addition & 1 deletion tests/out/wgsl/932-for-loop-if-vert.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fn main_1() {
return;
}

@stage(vertex)
@vertex
fn main() {
main_1();
return;
Expand Down
6 changes: 3 additions & 3 deletions tests/out/wgsl/access.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ fn test_arr_as_arg(a: array<array<f32,10>,5>) -> f32 {
return a[4][9];
}

@stage(vertex)
@vertex
fn foo_vert(@builtin(vertex_index) vi: u32) -> @builtin(position) vec4<f32> {
var foo: f32 = 0.0;
var c: array<i32,5>;
Expand All @@ -101,7 +101,7 @@ fn foo_vert(@builtin(vertex_index) vi: u32) -> @builtin(position) vec4<f32> {
return vec4<f32>((matrix * vec4<f32>(vec4<i32>(value))), 2.0);
}

@stage(fragment)
@fragment
fn foo_frag() -> @location(0) vec4<f32> {
bar.matrix[1][2] = 1.0;
bar.matrix = mat4x3<f32>(vec3<f32>(0.0), vec3<f32>(1.0), vec3<f32>(2.0), vec3<f32>(3.0));
Expand All @@ -110,7 +110,7 @@ fn foo_frag() -> @location(0) vec4<f32> {
return vec4<f32>(0.0);
}

@stage(compute) @workgroup_size(1, 1, 1)
@compute @workgroup_size(1, 1, 1)
fn atomics() {
var tmp: i32;

Expand Down
2 changes: 1 addition & 1 deletion tests/out/wgsl/bevy-pbr-frag.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ fn main_1() {
return;
}

@stage(fragment)
@fragment
fn main(@location(0) v_WorldPosition: vec3<f32>, @location(1) v_WorldNormal: vec3<f32>, @location(2) v_Uv: vec2<f32>, @location(3) v_WorldTangent: vec4<f32>, @builtin(front_facing) param: bool) -> FragmentOutput {
v_WorldPosition_1 = v_WorldPosition;
v_WorldNormal_1 = v_WorldNormal;
Expand Down
2 changes: 1 addition & 1 deletion tests/out/wgsl/bevy-pbr-vert.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fn main_1() {
return;
}

@stage(vertex)
@vertex
fn main(@location(0) Vertex_Position: vec3<f32>, @location(1) Vertex_Normal: vec3<f32>, @location(2) Vertex_Uv: vec2<f32>, @location(3) Vertex_Tangent: vec4<f32>) -> VertexOutput {
Vertex_Position_1 = Vertex_Position;
Vertex_Normal_1 = Vertex_Normal;
Expand Down
2 changes: 1 addition & 1 deletion tests/out/wgsl/binop-frag.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ fn main1() {
return;
}

@stage(fragment)
@fragment
fn main() {
main1();
return;
Expand Down
2 changes: 1 addition & 1 deletion tests/out/wgsl/bits.wgsl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@stage(compute) @workgroup_size(1, 1, 1)
@compute @workgroup_size(1, 1, 1)
fn main() {
var i: i32 = 0;
var i2_: vec2<i32>;
Expand Down
2 changes: 1 addition & 1 deletion tests/out/wgsl/bits_glsl-frag.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ fn main_1() {
return;
}

@stage(fragment)
@fragment
fn main() {
main_1();
return;
Expand Down
2 changes: 1 addition & 1 deletion tests/out/wgsl/boids.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var<storage> particlesSrc: Particles;
@group(0) @binding(2)
var<storage, read_write> particlesDst: Particles;

@stage(compute) @workgroup_size(64, 1, 1)
@compute @workgroup_size(64, 1, 1)
fn main(@builtin(global_invocation_id) global_invocation_id: vec3<u32>) {
var vPos: vec2<f32>;
var vVel: vec2<f32>;
Expand Down
2 changes: 1 addition & 1 deletion tests/out/wgsl/bool-select-frag.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fn main_1() {
return;
}

@stage(fragment)
@fragment
fn main() -> FragmentOutput {
main_1();
let _e3 = o_color;
Expand Down
2 changes: 1 addition & 1 deletion tests/out/wgsl/buffer-frag.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fn main_1() {
return;
}

@stage(fragment)
@fragment
fn main() {
main_1();
return;
Expand Down
2 changes: 1 addition & 1 deletion tests/out/wgsl/clamp-splat-vert.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn main_1() {
return;
}

@stage(vertex)
@vertex
fn main(@location(0) a_pos: vec2<f32>) -> VertexOutput {
a_pos_1 = a_pos;
main_1();
Expand Down
2 changes: 1 addition & 1 deletion tests/out/wgsl/collatz.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fn collatz_iterations(n_base: u32) -> u32 {
return _e24;
}

@stage(compute) @workgroup_size(1, 1, 1)
@compute @workgroup_size(1, 1, 1)
fn main(@builtin(global_invocation_id) global_id: vec3<u32>) {
let _e8 = v_indices.data[global_id.x];
let _e9 = collatz_iterations(_e8);
Expand Down
2 changes: 1 addition & 1 deletion tests/out/wgsl/constant-array-size-vert.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fn main_1() {
return;
}

@stage(vertex)
@vertex
fn main() {
main_1();
return;
Expand Down
2 changes: 1 addition & 1 deletion tests/out/wgsl/control-flow.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fn loop_switch_continue(x: i32) {
return;
}

@stage(compute) @workgroup_size(1, 1, 1)
@compute @workgroup_size(1, 1, 1)
fn main(@builtin(global_invocation_id) global_id: vec3<u32>) {
var pos: i32;

Expand Down
2 changes: 1 addition & 1 deletion tests/out/wgsl/declarations-vert.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ fn main_1() {
return;
}

@stage(vertex)
@vertex
fn main(@location(0) position: vec2<f32>, @location(1) a: vec2<f32>, @location(2) in_array: vec4<f32>, @location(3) in_array_1: vec4<f32>) -> VertexOutput {
vert.position = position;
vert.a = a;
Expand Down
2 changes: 1 addition & 1 deletion tests/out/wgsl/empty-global-name.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fn function_() {
return;
}

@stage(compute) @workgroup_size(64, 1, 1)
@compute @workgroup_size(64, 1, 1)
fn main() {
function_();
}
2 changes: 1 addition & 1 deletion tests/out/wgsl/empty.wgsl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@stage(compute) @workgroup_size(1, 1, 1)
@compute @workgroup_size(1, 1, 1)
fn main() {
return;
}
2 changes: 1 addition & 1 deletion tests/out/wgsl/expressions-frag.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ fn main_1() {
return;
}

@stage(fragment)
@fragment
fn main() -> FragmentOutput {
main_1();
let _e5 = o_color;
Expand Down
2 changes: 1 addition & 1 deletion tests/out/wgsl/extra.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ struct FragmentIn {

var<push_constant> pc: PushConstants;

@stage(fragment)
@fragment
fn main(in: FragmentIn) -> @location(0) vec4<f32> {
let _e4 = pc.index;
if (in.primitive_index == _e4) {
Expand Down
2 changes: 1 addition & 1 deletion tests/out/wgsl/fma-frag.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fn main_1() {
return;
}

@stage(fragment)
@fragment
fn main() -> FragmentOutput {
main_1();
let _e3 = o_color;
Expand Down
2 changes: 1 addition & 1 deletion tests/out/wgsl/functions.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fn test_integer_dot_product() -> i32 {
return c_4_;
}

@stage(compute) @workgroup_size(1, 1, 1)
@compute @workgroup_size(1, 1, 1)
fn main() {
let _e0 = test_fma();
let _e1 = test_integer_dot_product();
Expand Down
2 changes: 1 addition & 1 deletion tests/out/wgsl/global-constant-array-vert.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ fn main_1() {
let _e2 = i;
}

@stage(vertex)
@vertex
fn main() {
main_1();
return;
Expand Down
2 changes: 1 addition & 1 deletion tests/out/wgsl/globals.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fn test_msl_packed_vec3_() {
let unnamed_5 = (2.0 * data.v3_);
}

@stage(compute) @workgroup_size(1, 1, 1)
@compute @workgroup_size(1, 1, 1)
fn main() {
var Foo_1: f32 = 1.0;
var at: bool = true;
Expand Down
Loading

0 comments on commit 1720725

Please sign in to comment.