Skip to content

Commit

Permalink
Fix vertex type in module #35
Browse files Browse the repository at this point in the history
  • Loading branch information
sytherax authored and Swoorup committed Jul 27, 2024
1 parent 7e6b52a commit 41a61eb
Show file tree
Hide file tree
Showing 18 changed files with 648 additions and 461 deletions.
27 changes: 24 additions & 3 deletions example/shaders/testbed.wgsl
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#import utils::types::{Scalars, VectorsU32, VectorsI32, VectorsF32, MatricesF32, StaticArrays, Nested}
#import utils::types::{
Scalars,
VectorsU32,
VectorsI32,
VectorsF32,
MatricesF32,
StaticArrays,
Nested,
VertexIn
}

@group(2) @binding(2)
var<storage> a: Scalars;
Expand Down Expand Up @@ -34,6 +43,18 @@ struct Uniforms {
@group(1) @binding(0)
var<uniform> uniforms: Uniforms;

@compute @workgroup_size(1)
fn main(@builtin(global_invocation_id) id: vec3<u32>) { }
struct VertexOutput {
@builtin(position) position: vec4<f32>,
}

@vertex
fn vertex_main(input: VertexIn) -> VertexOutput {
var output: VertexOutput;
output.position = input.position;
return output;
}

@fragment
fn fragment_main(input: VertexOutput) -> @location(0) vec4<f32> {
return vec4(1.0, 1.0, 1.0, 1.0);
}
6 changes: 5 additions & 1 deletion example/shaders/utils/types.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,8 @@ struct StaticArrays {
struct Nested {
a: MatricesF32,
b: VectorsF32
};
};

struct VertexIn {
@location(0) position: vec4<f32>,
}
Loading

0 comments on commit 41a61eb

Please sign in to comment.