- Nou: shaders/sprite.vert|frag, postfx.vert|frag, ball.vert (GLSL) - Nou: cmake/spv_to_header.cmake — converteix .spv → uint8_t C header - CMakeLists.txt: bloc non-Apple troba glslc, compila GLSL → SPIRV en build-time i genera headers embeguts a build/generated_shaders/ - gpu_context.cpp: MSL|METALLIB en Apple, SPIRV en la resta - gpu_pipeline.cpp: createShaderSPIRV() + branques #ifdef __APPLE__ per sprite/ball/postfx pipelines - Corregeix crash a engine.cpp:821 (Windows/Linux) causat per pipelines null quan init() fallava en no trobar suport MSL Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
11 lines
481 B
GLSL
11 lines
481 B
GLSL
#version 450
|
|
layout(location=0) out vec2 v_uv;
|
|
void main() {
|
|
// Full-screen triangle from vertex index (no vertex buffer needed)
|
|
// NDC/UV mapping matches the MSL version (SDL3 GPU normalizes Y-up on all backends)
|
|
vec2 positions[3] = vec2[3](vec2(-1.0,-1.0), vec2(3.0,-1.0), vec2(-1.0,3.0));
|
|
vec2 uvs[3] = vec2[3](vec2(0.0, 1.0), vec2(2.0, 1.0), vec2(0.0,-1.0));
|
|
gl_Position = vec4(positions[gl_VertexIndex], 0.0, 1.0);
|
|
v_uv = uvs[gl_VertexIndex];
|
|
}
|