add uv to vertex format and remove it from instance
This commit is contained in:
+3
-11
@@ -3,11 +3,10 @@ struct VertexShaderInput {
|
||||
@builtin(vertex_index) vertex_index: u32,
|
||||
|
||||
@location(0) pos: vec3<f32>,
|
||||
@location(1) uv: vec2<f32>,
|
||||
|
||||
// Per Instance
|
||||
@location(1) pos_size: vec4<f32>,
|
||||
@location(2) uv0uv1: vec4<f32>,
|
||||
@location(3) uv2uv3: vec4<f32>,
|
||||
@location(2) pos_size: vec4<f32>,
|
||||
};
|
||||
|
||||
struct VertexShaderOutput {
|
||||
@@ -26,14 +25,7 @@ struct FragmentShaderOutput {
|
||||
var output: VertexShaderOutput;
|
||||
|
||||
output.pos = vec4<f32>(input.pos_size.xy + input.pos.xy, 0, 1) * view_projection_matrix;
|
||||
|
||||
switch (input.vertex_index) {
|
||||
case 0: { output.uv = input.uv0uv1.xy; }
|
||||
case 1: { output.uv = input.uv2uv3.zw; }
|
||||
case 2: { output.uv = input.uv2uv3.xy; }
|
||||
case 3: { output.uv = input.uv0uv1.zw; }
|
||||
default: {}
|
||||
}
|
||||
output.uv = input.uv;
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user