Add SDL3 GPU backend (Vulkan/Metal) with OpenGL fallback
This commit is contained in:
18
shaders/_common/passthrough.vk.glsl
Normal file
18
shaders/_common/passthrough.vk.glsl
Normal file
@@ -0,0 +1,18 @@
|
||||
#version 450
|
||||
|
||||
// Shared fullscreen-triangle vertex shader for the SDL3 GPU backend.
|
||||
// Emits vUV in Shadertoy convention: (0,0) bottom-left, (1,1) top-right.
|
||||
// Y flipped in NDC because Vulkan/Metal point Y down by default.
|
||||
|
||||
layout(location = 0) out vec2 vUV;
|
||||
|
||||
void main() {
|
||||
const vec2 positions[3] = vec2[3](
|
||||
vec2(-1.0, -1.0),
|
||||
vec2( 3.0, -1.0),
|
||||
vec2(-1.0, 3.0)
|
||||
);
|
||||
vec2 pos = positions[gl_VertexIndex];
|
||||
vUV = pos * 0.5 + 0.5;
|
||||
gl_Position = vec4(pos.x, -pos.y, 0.0, 1.0);
|
||||
}
|
||||
Reference in New Issue
Block a user