add img-flip param to metaCRT

for use with hardware-rendered cores
This commit is contained in:
hizzlekizzle 2023-04-18 08:27:18 -05:00 committed by GitHub
parent 5cc1d51b8e
commit 0b33b2cf9c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,6 +6,7 @@ layout(push_constant) uniform Push
vec4 OriginalSize; vec4 OriginalSize;
vec4 OutputSize; vec4 OutputSize;
uint FrameCount; uint FrameCount;
float flip_image;
} params; } params;
#define vFragCoord vTexCoord.xy * params.OutputSize.xy #define vFragCoord vTexCoord.xy * params.OutputSize.xy
@ -18,6 +19,8 @@ layout(push_constant) uniform Push
#define vFragColor FragColor #define vFragColor FragColor
#define fragColor FragColor #define fragColor FragColor
#pragma parameter flip_image "Flip Image (for hardware-rendered cores)" 0.0 0.0 1.0 1.0
layout(std140, set = 0, binding = 0) uniform UBO layout(std140, set = 0, binding = 0) uniform UBO
{ {
mat4 MVP; mat4 MVP;
@ -31,7 +34,7 @@ layout(location = 0) out vec2 vTexCoord;
void main() void main()
{ {
gl_Position = global.MVP * Position; gl_Position = global.MVP * Position;
vTexCoord = TexCoord; vTexCoord = (bool(params.flip_image)) ? vec2(TexCoord.x, 1.0 - TexCoord.y) : TexCoord.xy;
} }
#pragma stage fragment #pragma stage fragment