mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-18 15:29:19 +01:00
395f665a13
It is desirable for us to use a shader for blits to allow easily emulating out of bounds blits and blits between different swizzled colour formats. The helper shader infrastructure is designed to be generic so it can be reused by any other helper shaders that we may need in the future.
23 lines
486 B
GLSL
23 lines
486 B
GLSL
#version 460
|
|
|
|
layout (location = 0) out vec2 dstPosition;
|
|
|
|
layout (push_constant) uniform constants {
|
|
vec2 dstOriginClipSpace;
|
|
vec2 dstDimensionsClipSpace;
|
|
} PC;
|
|
|
|
void main() {
|
|
const vec2 lut[6] = vec2[6](
|
|
vec2(1, 0),
|
|
vec2(1, 1),
|
|
vec2(0, 1),
|
|
vec2(0, 1),
|
|
vec2(0, 0),
|
|
vec2(1, 0)
|
|
);
|
|
|
|
dstPosition = lut[gl_VertexIndex];
|
|
gl_Position = vec4(PC.dstOriginClipSpace + PC.dstDimensionsClipSpace * lut[gl_VertexIndex], 0, 1);
|
|
}
|