Reestructura carpetes: src->source, third_party->source/external, shaders->data/shaders
This commit is contained in:
19
data/shaders/_common/passthrough.vert.msl
Normal file
19
data/shaders/_common/passthrough.vert.msl
Normal file
@@ -0,0 +1,19 @@
|
||||
#include <metal_stdlib>
|
||||
using namespace metal;
|
||||
|
||||
// Shared fullscreen-triangle vertex shader for the SDL3 GPU backend.
|
||||
// Emits uv in Shadertoy convention: (0,0) bottom-left, (1,1) top-right.
|
||||
|
||||
struct PassthroughVOut {
|
||||
float4 pos [[position]];
|
||||
float2 uv;
|
||||
};
|
||||
|
||||
vertex PassthroughVOut passthrough_vs(uint vid [[vertex_id]]) {
|
||||
const float2 positions[3] = { {-1.0, -1.0}, {3.0, -1.0}, {-1.0, 3.0} };
|
||||
PassthroughVOut out;
|
||||
float2 pos = positions[vid];
|
||||
out.uv = pos * 0.5 + 0.5;
|
||||
out.pos = float4(pos, 0.0, 1.0);
|
||||
return out;
|
||||
}
|
||||
BIN
data/shaders/_common/passthrough.vert.spv
Normal file
BIN
data/shaders/_common/passthrough.vert.spv
Normal file
Binary file not shown.
17
data/shaders/_common/passthrough.vk.glsl
Normal file
17
data/shaders/_common/passthrough.vk.glsl
Normal file
@@ -0,0 +1,17 @@
|
||||
#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.
|
||||
|
||||
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, 0.0, 1.0);
|
||||
}
|
||||
Reference in New Issue
Block a user