Skip to content

Commit

Permalink
Consolidate redundant type definition
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Oct 31, 2024
1 parent 11abf36 commit 6650df3
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions experiments/2024-10-30/src/shader.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@ struct VertexInput {
@location(0) position: vec3<f32>
}

struct VertexOutput {
@builtin(position) position: vec4<f32>
}

@vertex
fn vertex(in: VertexInput) -> @builtin(position) vec4<f32> {
return transform * vec4(in.position, 1.0);
fn vertex(in: VertexInput) -> VertexOutput {
var out: VertexOutput;
out.position = transform * vec4(in.position, 1.0);
return out;
}

@fragment
fn fragment(@builtin(position) position: vec4<f32>) -> @location(0) vec4<f32> {
fn fragment(in: VertexOutput) -> @location(0) vec4<f32> {
return vec4(1.0, 0.0, 0.0, 1.0);
}

0 comments on commit 6650df3

Please sign in to comment.