@@ -8,7 +8,7 @@ struct Globals {
8
8
9
9
// Vertex input structure - matches Vertex struct exactly
10
10
struct VertexInput {
11
- float4 v_pos [[attribute(0 )]]; // Position (first 16 bytes)
11
+ float3 v_pos [[attribute(0 )]]; // Position (first 12 bytes) - FIXED to float3
12
12
float4 v_color [[attribute(1 )]]; // Color (next 16 bytes)
13
13
float2 v_uv [[attribute(2 )]]; // UV coords (next 8 bytes)
14
14
int2 layers [[attribute(3 )]]; // Layers (next 8 bytes)
@@ -34,8 +34,7 @@ vertex VertexOutput vs_main(
34
34
out.color_layer = input.layers .x ;
35
35
out.mask_layer = input.layers .y ;
36
36
37
- // Transform position - match WGSL exactly:
38
- // out.position = globals.transform * vec4<f32>(input.v_pos.xy, 0.0, 1.0);
37
+ // Transform position - use float4 constructor with z=0.0, w=1.0
39
38
out.position = globals.transform * float4 (input.v_pos .xy , 0.0 , 1.0 );
40
39
41
40
return out;
@@ -50,23 +49,14 @@ fragment float4 fs_main(
50
49
) {
51
50
float4 out = input.f_color ;
52
51
53
- // Match WGSL logic exactly:
54
- // if input.color_layer > 0 {
55
- // out = textureSampleLevel(color_texture, font_sampler, input.f_uv, 0.0);
56
- // }
57
52
if (input.color_layer > 0 ) {
58
53
out = color_texture.sample (font_sampler, input.f_uv , level (0.0 ));
59
54
}
60
55
61
- // if input.mask_layer > 0 {
62
- // out = vec4<f32>(out.xyz, input.f_color.a * textureSampleLevel(mask_texture, font_sampler, input.f_uv, 0.0).x);
63
- // }
64
56
if (input.mask_layer > 0 ) {
65
57
float mask_alpha = mask_texture.sample (font_sampler, input.f_uv , level (0.0 )).x ;
66
58
out = float4 (out.xyz , input.f_color .a * mask_alpha);
67
59
}
68
60
69
61
return out;
70
- }
71
- // Force all pixels to be bright green to test if shader is running at all
72
- // return float4(0.0, 1.0, 0.0, 1.0);
62
+ }
0 commit comments