mirror of
https://github.com/cemu-project/cemu_graphic_packs.git
synced 2024-12-18 14:11:48 +01:00
f3d35c75dc
Didn't update the docs (will do that tomorrow), but I manually checked (didn't verify things, but I basically checked if it contained "uf_windowSpaceToClipSpaceTransform" and if the shader was made after a certain Cemu change was made due to how they're left out) to see if any graphic pack in here was *probably* safe. I also didn't convert 5 graphic packs since they contained signs that needed to be manually checked or at least examined more: - \Enhancements\TwilightPrincessHD_Bicubic - \Resolutions\DevilsThird_Resolution - \Resolutions\TwilightPrincessHD_Resolution (this one just needs to be fully verified since it's popular enough and has like 27 shaders) - \Resolutions\LegoStarWars_Resolution - \Resolutions\TokyoMirage_Resolution (this one could also be manually verified) I hope I didn't make too many mistakes with this one.
342 lines
11 KiB
Plaintext
342 lines
11 KiB
Plaintext
#version 420
|
|
#extension GL_ARB_texture_gather : enable
|
|
#extension GL_ARB_separate_shader_objects : enable
|
|
#ifdef VULKAN
|
|
#define ATTR_LAYOUT(__vkSet, __location) layout(set = __vkSet, location = __location)
|
|
#define UNIFORM_BUFFER_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(set = __vkSet, binding = __vkLocation, std140)
|
|
#define TEXTURE_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(set = __vkSet, binding = __vkLocation)
|
|
#define SET_POSITION(_v) gl_Position = _v; gl_Position.z = (gl_Position.z + gl_Position.w) / 2.0
|
|
#define GET_FRAGCOORD() vec4(gl_FragCoord.xy*uf_fragCoordScale.xy,gl_FragCoord.zw)
|
|
#define gl_VertexID gl_VertexIndex
|
|
#define gl_InstanceID gl_InstanceIndex
|
|
#else
|
|
#define ATTR_LAYOUT(__vkSet, __location) layout(location = __location)
|
|
#define UNIFORM_BUFFER_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(binding = __glLocation, std140)
|
|
#define TEXTURE_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(binding = __glLocation)
|
|
#define SET_POSITION(_v) gl_Position = _v
|
|
#define GET_FRAGCOORD() vec4(gl_FragCoord.xy*uf_fragCoordScale,gl_FragCoord.zw)
|
|
#endif
|
|
// This shader was automatically converted to be cross-compatible with Vulkan and OpenGL.
|
|
|
|
// shader 4fe1bb2bc0611f15
|
|
// Used for: Horizontal and vertical background blur
|
|
float resScale = float($width)/float($gameWidth);
|
|
|
|
#ifdef VULKAN
|
|
layout(set = 1, binding = 1) uniform ufBlock
|
|
{
|
|
uniform ivec4 uf_remappedPS[1];
|
|
uniform vec4 uf_fragCoordScale;
|
|
};
|
|
#else
|
|
uniform ivec4 uf_remappedPS[1];
|
|
uniform vec2 uf_fragCoordScale;
|
|
#endif
|
|
// uf_fragCoordScale was moved to the ufBlock
|
|
TEXTURE_LAYOUT(0, 1, 0) uniform sampler2D textureUnitPS0;
|
|
layout(location = 0) out vec4 passPixelColor0;
|
|
int clampFI32(int v)
|
|
{
|
|
if( v == 0x7FFFFFFF )
|
|
return floatBitsToInt(1.0);
|
|
else if( v == 0xFFFFFFFF )
|
|
return floatBitsToInt(0.0);
|
|
return floatBitsToInt(clamp(intBitsToFloat(v), 0.0, 1.0));
|
|
}
|
|
float mul_nonIEEE(float a, float b){return mix(0.0, a*b, (a != 0.0) && (b != 0.0));}
|
|
void main()
|
|
{
|
|
vec4 R0f = vec4(0.0);
|
|
vec4 R1f = vec4(0.0);
|
|
vec4 R2f = vec4(0.0);
|
|
vec4 R3f = vec4(0.0);
|
|
vec4 R4f = vec4(0.0);
|
|
vec4 R5f = vec4(0.0);
|
|
vec4 R6f = vec4(0.0);
|
|
vec4 R7f = vec4(0.0);
|
|
vec4 R8f = vec4(0.0);
|
|
vec4 R9f = vec4(0.0);
|
|
vec4 R10f = vec4(0.0);
|
|
vec4 R11f = vec4(0.0);
|
|
vec4 R123f = vec4(0.0);
|
|
vec4 R124f = vec4(0.0);
|
|
vec4 R125f = vec4(0.0);
|
|
vec4 R126f = vec4(0.0);
|
|
vec4 R127f = vec4(0.0);
|
|
float backupReg0f, backupReg1f, backupReg2f, backupReg3f, backupReg4f;
|
|
vec4 PV0f = vec4(0.0), PV1f = vec4(0.0);
|
|
float PS0f = 0.0, PS1f = 0.0;
|
|
vec4 tempf = vec4(0.0);
|
|
float tempResultf;
|
|
int tempResulti;
|
|
ivec4 ARi = ivec4(0);
|
|
bool predResult = true;
|
|
vec3 cubeMapSTM;
|
|
int cubeMapFaceId;
|
|
R0f = GET_FRAGCOORD();
|
|
// 0
|
|
PV0f.z = R0f.x + 0.5;
|
|
PV0f.w = R0f.y + 0.5;
|
|
// 1
|
|
R4f.x = mul_nonIEEE(PV0f.z, intBitsToFloat(uf_remappedPS[0].x));
|
|
PV1f.x = R4f.x;
|
|
R4f.y = mul_nonIEEE(PV0f.w, intBitsToFloat(uf_remappedPS[0].y));
|
|
PV1f.y = R4f.y;
|
|
// 2
|
|
R0f.xyz = vec3(PV1f.x,PV1f.y,PV1f.x) + vec3(intBitsToFloat(0xba99999a)/resScale,0.0,0.0);
|
|
R0f.w = PV1f.y + intBitsToFloat(0xbb088889)/resScale;
|
|
R1f.x = PV1f.x + intBitsToFloat(0x3a99999a)/resScale;
|
|
PS0f = R1f.x;
|
|
// 3
|
|
R2f.x = R4f.x + 0.0;
|
|
R1f.y = R4f.y + 0.0;
|
|
R2f.zwy = vec3(R4f.y,R4f.x,R4f.y) + vec3(intBitsToFloat(0x3b088889)/resScale,intBitsToFloat(0xba99999a)/resScale,intBitsToFloat(0xbb088889)/resScale);
|
|
PS1f = R2f.y;
|
|
// 4
|
|
R3f.x = R4f.x + intBitsToFloat(0xba99999a)/resScale;
|
|
R3f.y = R4f.y + intBitsToFloat(0x3b088889)/resScale;
|
|
R1f.z = R4f.x + intBitsToFloat(0x3a99999a)/resScale;
|
|
R1f.w = R4f.y + intBitsToFloat(0xbb088889)/resScale;
|
|
R6f.x = R4f.x + intBitsToFloat(0x3a99999a)/resScale;
|
|
PS0f = R6f.x;
|
|
R11f.xyzw = (texture(textureUnitPS0, R4f.xy).xyzw);
|
|
R5f.xyzw = (texture(textureUnitPS0, R0f.xy).xyzw);
|
|
R0f.xyzw = (texture(textureUnitPS0, R0f.zw).xyzw);
|
|
R7f.xyzw = (texture(textureUnitPS0, R1f.xy).xyzw);
|
|
R8f.xyzw = (texture(textureUnitPS0, R2f.xz).xyzw);
|
|
R9f.xyzw = (texture(textureUnitPS0, R2f.wy).xyzw);
|
|
R3f.xyzw = (texture(textureUnitPS0, R3f.xy).xyzw);
|
|
R10f.xyzw = (texture(textureUnitPS0, R1f.zw).xyzw);
|
|
// 0
|
|
R127f.x = -(R11f.x) + R5f.x;
|
|
R6f.y = R4f.y + intBitsToFloat(0x3b088889)/resScale;
|
|
R123f.z = (R11f.w * 2.0 + -(1.0));
|
|
PV0f.z = R123f.z;
|
|
PV0f.w = R5f.w + intBitsToFloat(0x3c23d70a)/resScale;
|
|
R127f.w = -(R11f.y) + R5f.y;
|
|
PS0f = R127f.w;
|
|
// 1
|
|
R126f.x = -(R11f.z) + R5f.z;
|
|
PV1f.y = max(PV0f.z, -(PV0f.z));
|
|
PV1f.z = -(R11f.w) + PV0f.w;
|
|
R126f.w = -(R11f.w) + R5f.w;
|
|
PS1f = R0f.w + intBitsToFloat(0x3c23d70a)/resScale;
|
|
// 2
|
|
backupReg0f = R0f.x;
|
|
PV0f.x = -(PV1f.y) + 1.0;
|
|
R123f.y = intBitsToFloat(((PV1f.z >= 0.0)?(floatBitsToInt(1.0)):(0)));
|
|
PV0f.y = R123f.y;
|
|
R127f.z = -(R11f.w) + PS1f;
|
|
R5f.w = R7f.w + intBitsToFloat(0x3c23d70a)/resScale;
|
|
R1f.w = -(R11f.x) + backupReg0f;
|
|
PS0f = R1f.w;
|
|
// 3
|
|
R5f.x = (mul_nonIEEE(R127f.x,PV0f.y) + R11f.x);
|
|
R5f.y = (mul_nonIEEE(R127f.w,PV0f.y) + R11f.y);
|
|
R5f.z = (mul_nonIEEE(R126f.x,PV0f.y) + R11f.z);
|
|
R2f.w = max(PV0f.x, intBitsToFloat(0x3de38e39)/resScale);
|
|
PV1f.w = R2f.w;
|
|
R4f.y = (mul_nonIEEE(R126f.w,PV0f.y) + R11f.w);
|
|
PS1f = R4f.y;
|
|
// 4
|
|
backupReg0f = R0f.y;
|
|
backupReg1f = R0f.z;
|
|
backupReg2f = R0f.w;
|
|
R4f.x = intBitsToFloat(((R127f.z >= 0.0)?(floatBitsToInt(1.0)):(0)));
|
|
R0f.yzw = vec3(-(R11f.y),-(PV1f.w),-(R11f.z)) + vec3(backupReg0f,1.0,backupReg1f);
|
|
R0f.x = -(R11f.w) + backupReg2f;
|
|
PS0f = R0f.x;
|
|
R6f.xyzw = (texture(textureUnitPS0, R6f.xy).xyzw);
|
|
// 0
|
|
backupReg0f = R0f.y;
|
|
R127f.x = R8f.w + intBitsToFloat(0x3c23d70a);
|
|
R0f.y = R0f.z * intBitsToFloat(0x3e15f619);
|
|
PV0f.y = R0f.y;
|
|
R127f.z = -(R11f.w) + R5f.w;
|
|
R126f.w = (mul_nonIEEE(backupReg0f,R4f.x) + R11f.y);
|
|
R125f.x = (mul_nonIEEE(R0f.x,R4f.x) + R11f.w);
|
|
PS0f = R125f.x;
|
|
// 1
|
|
PV1f.x = mul_nonIEEE(PV0f.y, R5f.x);
|
|
PV1f.y = mul_nonIEEE(PV0f.y, R4f.y);
|
|
PV1f.z = mul_nonIEEE(PV0f.y, R5f.z);
|
|
PV1f.w = mul_nonIEEE(PV0f.y, R5f.y);
|
|
R127f.w = (mul_nonIEEE(R1f.w,R4f.x) + R11f.x);
|
|
PS1f = R127f.w;
|
|
// 2
|
|
R126f.x = (mul_nonIEEE(R11f.x,R2f.w) + PV1f.x);
|
|
R126f.y = (mul_nonIEEE(R11f.w,R2f.w) + PV1f.y);
|
|
R126f.z = (mul_nonIEEE(R11f.z,R2f.w) + PV1f.z);
|
|
R125f.w = (mul_nonIEEE(R11f.y,R2f.w) + PV1f.w);
|
|
R127f.y = (mul_nonIEEE(R0f.w,R4f.x) + R11f.z);
|
|
PS0f = R127f.y;
|
|
// 3
|
|
R124f.x = -(R11f.x) + R7f.x;
|
|
R124f.y = intBitsToFloat(((R127f.z >= 0.0)?(floatBitsToInt(1.0)):(0)));
|
|
R127f.z = -(R11f.z) + R7f.z;
|
|
R124f.w = -(R11f.y) + R7f.y;
|
|
R125f.y = -(R11f.w) + R7f.w;
|
|
PS1f = R125f.y;
|
|
// 4
|
|
backupReg0f = R127f.x;
|
|
backupReg1f = R0f.y;
|
|
backupReg2f = R126f.z;
|
|
backupReg1f = R0f.y;
|
|
R127f.x = (mul_nonIEEE(R0f.y,R127f.w) + R126f.x);
|
|
PV0f.y = -(R11f.w) + backupReg0f;
|
|
R126f.z = (mul_nonIEEE(backupReg1f,R127f.y) + backupReg2f);
|
|
R127f.w = R9f.w + intBitsToFloat(0x3c23d70a);
|
|
R126f.x = (mul_nonIEEE(backupReg1f,R125f.x) + R126f.y);
|
|
PS0f = R126f.x;
|
|
// 5
|
|
backupReg0f = R124f.x;
|
|
R124f.x = (mul_nonIEEE(backupReg0f,R124f.y) + R11f.x);
|
|
R127f.y = (mul_nonIEEE(R127f.z,R124f.y) + R11f.z);
|
|
R127f.z = (mul_nonIEEE(R0f.y,R126f.w) + R125f.w);
|
|
R126f.w = (mul_nonIEEE(R124f.w,R124f.y) + R11f.y);
|
|
R7f.x = intBitsToFloat(((PV0f.y >= 0.0)?(floatBitsToInt(1.0)):(0)));
|
|
PS1f = R7f.x;
|
|
// 6
|
|
backupReg0f = R127f.w;
|
|
R125f.x = -(R11f.z) + R8f.z;
|
|
R123f.y = (mul_nonIEEE(R125f.y,R124f.y) + R11f.w);
|
|
PV0f.y = R123f.y;
|
|
R125f.z = -(R11f.w) + R8f.w;
|
|
R127f.w = -(R11f.x) + R8f.x;
|
|
R124f.z = -(R11f.w) + backupReg0f;
|
|
PS0f = R124f.z;
|
|
// 7
|
|
backupReg0f = R127f.x;
|
|
backupReg1f = R126f.w;
|
|
R127f.x = R3f.w + intBitsToFloat(0x3c23d70a);
|
|
R125f.y = (mul_nonIEEE(R0f.y,R124f.x) + backupReg0f);
|
|
PV1f.z = -(R11f.y) + R8f.y;
|
|
R126f.w = (mul_nonIEEE(R0f.y,backupReg1f) + R127f.z);
|
|
R125f.w = (mul_nonIEEE(R0f.y,PV0f.y) + R126f.x);
|
|
PS1f = R125f.w;
|
|
// 8
|
|
backupReg0f = R125f.x;
|
|
backupReg1f = R127f.y;
|
|
backupReg2f = R126f.z;
|
|
backupReg3f = R127f.w;
|
|
R125f.x = (mul_nonIEEE(PV1f.z,R7f.x) + R11f.y);
|
|
R127f.y = (mul_nonIEEE(backupReg0f,R7f.x) + R11f.z);
|
|
R126f.z = (mul_nonIEEE(R0f.y,backupReg1f) + backupReg2f);
|
|
R127f.w = (mul_nonIEEE(backupReg3f,R7f.x) + R11f.x);
|
|
R126f.x = (mul_nonIEEE(R125f.z,R7f.x) + R11f.w);
|
|
PS0f = R126f.x;
|
|
// 9
|
|
R124f.x = -(R11f.x) + R9f.x;
|
|
R126f.y = intBitsToFloat(((R124f.z >= 0.0)?(floatBitsToInt(1.0)):(0)));
|
|
R124f.zwy = vec3(-(R11f.z),-(R11f.y),-(R11f.w)) + vec3(R9f.z,R9f.y,R9f.w);
|
|
PS1f = R124f.y;
|
|
// 10
|
|
backupReg0f = R127f.x;
|
|
backupReg1f = R0f.y;
|
|
backupReg2f = R126f.z;
|
|
backupReg1f = R0f.y;
|
|
R127f.x = (mul_nonIEEE(R0f.y,R127f.w) + R125f.y);
|
|
PV0f.y = -(R11f.w) + backupReg0f;
|
|
R126f.z = (mul_nonIEEE(backupReg1f,R127f.y) + backupReg2f);
|
|
R127f.w = R10f.w + intBitsToFloat(0x3c23d70a);
|
|
R9f.x = backupReg1f * intBitsToFloat(0x3f3504f3);
|
|
PS0f = R9f.x;
|
|
// 11
|
|
backupReg0f = R126f.x;
|
|
R126f.x = (mul_nonIEEE(R0f.y,backupReg0f) + R125f.w);
|
|
R127f.y = (mul_nonIEEE(R124f.z,R126f.y) + R11f.z);
|
|
R124f.z = (mul_nonIEEE(R0f.y,R125f.x) + R126f.w);
|
|
R126f.w = (mul_nonIEEE(R124f.w,R126f.y) + R11f.y);
|
|
R125f.x = intBitsToFloat(((PV0f.y >= 0.0)?(floatBitsToInt(1.0)):(0)));
|
|
PS1f = R125f.x;
|
|
// 12
|
|
backupReg0f = R126f.y;
|
|
R123f.x = (mul_nonIEEE(R124f.x,R126f.y) + R11f.x);
|
|
PV0f.x = R123f.x;
|
|
R126f.y = (mul_nonIEEE(R124f.y,backupReg0f) + R11f.w);
|
|
R125f.z = -(R11f.z) + R3f.z;
|
|
R125f.w = -(R11f.x) + R3f.x;
|
|
R124f.x = -(R11f.w) + R3f.w;
|
|
PS0f = R124f.x;
|
|
// 13
|
|
backupReg0f = R127f.y;
|
|
backupReg1f = R126f.z;
|
|
PV1f.x = -(R11f.w) + R127f.w;
|
|
R127f.y = R6f.w + intBitsToFloat(0x3c23d70a);
|
|
PV1f.z = -(R11f.y) + R3f.y;
|
|
R127f.w = (mul_nonIEEE(R9f.x,PV0f.x) + R127f.x);
|
|
R126f.z = (mul_nonIEEE(R9f.x,backupReg0f) + backupReg1f);
|
|
PS1f = R126f.z;
|
|
// 14
|
|
backupReg0f = R126f.x;
|
|
backupReg1f = R126f.w;
|
|
R126f.x = (mul_nonIEEE(R9f.x,R126f.y) + backupReg0f);
|
|
R126f.y = (mul_nonIEEE(R125f.z,R125f.x) + R11f.z);
|
|
R125f.z = (mul_nonIEEE(PV1f.z,R125f.x) + R11f.y);
|
|
R126f.w = (mul_nonIEEE(R9f.x,backupReg1f) + R124f.z);
|
|
R3f.y = intBitsToFloat(((PV1f.x >= 0.0)?(floatBitsToInt(1.0)):(0)));
|
|
PS0f = R3f.y;
|
|
// 15
|
|
backupReg0f = R125f.x;
|
|
backupReg0f = R125f.x;
|
|
R125f.x = (mul_nonIEEE(R124f.x,backupReg0f) + R11f.w);
|
|
R124f.y = -(R11f.y) + R10f.y;
|
|
R124f.z = -(R11f.z) + R10f.z;
|
|
R123f.w = (mul_nonIEEE(R125f.w,backupReg0f) + R11f.x);
|
|
PV1f.w = R123f.w;
|
|
R125f.y = -(R11f.w) + R10f.w;
|
|
PS1f = R125f.y;
|
|
// 16
|
|
backupReg0f = R127f.w;
|
|
backupReg1f = R126f.z;
|
|
R124f.x = -(R11f.x) + R10f.x;
|
|
PV0f.y = -(R11f.w) + R127f.y;
|
|
R126f.z = (mul_nonIEEE(R9f.x,R125f.z) + R126f.w);
|
|
R127f.w = (mul_nonIEEE(R9f.x,PV1f.w) + backupReg0f);
|
|
R127f.y = (mul_nonIEEE(R9f.x,R126f.y) + backupReg1f);
|
|
PS0f = R127f.y;
|
|
// 17
|
|
backupReg0f = R126f.x;
|
|
backupReg1f = R124f.z;
|
|
backupReg2f = R124f.y;
|
|
R126f.x = (mul_nonIEEE(R9f.x,R125f.x) + backupReg0f);
|
|
R124f.y = intBitsToFloat(((PV0f.y >= 0.0)?(floatBitsToInt(1.0)):(0)));
|
|
PV1f.y = R124f.y;
|
|
R124f.z = (mul_nonIEEE(backupReg1f,R3f.y) + R11f.z);
|
|
R126f.w = (mul_nonIEEE(backupReg2f,R3f.y) + R11f.y);
|
|
PS1f = -(R11f.z) + R6f.z;
|
|
// 18
|
|
R123f.x = (mul_nonIEEE(R124f.x,R3f.y) + R11f.x);
|
|
PV0f.x = R123f.x;
|
|
R123f.y = (mul_nonIEEE(R125f.y,R3f.y) + R11f.w);
|
|
PV0f.y = R123f.y;
|
|
R125f.z = -(R11f.w) + R6f.w;
|
|
R125f.w = -(R11f.x) + R6f.x;
|
|
R125f.y = (mul_nonIEEE(PS1f,PV1f.y) + R11f.z);
|
|
PS0f = R125f.y;
|
|
// 19
|
|
backupReg0f = R126f.x;
|
|
R126f.x = (mul_nonIEEE(R9f.x,PV0f.x) + R127f.w);
|
|
R123f.y = (mul_nonIEEE(R9f.x,R124f.z) + R127f.y);
|
|
PV1f.y = R123f.y;
|
|
PV1f.z = -(R11f.y) + R6f.y;
|
|
R127f.w = (mul_nonIEEE(R9f.x,R126f.w) + R126f.z);
|
|
R126f.w = (mul_nonIEEE(R9f.x,PV0f.y) + backupReg0f);
|
|
PS1f = R126f.w;
|
|
// 20
|
|
R123f.x = (mul_nonIEEE(R125f.z,R124f.y) + R11f.w);
|
|
PV0f.x = R123f.x;
|
|
R123f.z = (mul_nonIEEE(PV1f.z,R124f.y) + R11f.y);
|
|
PV0f.z = R123f.z;
|
|
R123f.w = (mul_nonIEEE(R125f.w,R124f.y) + R11f.x);
|
|
PV0f.w = R123f.w;
|
|
R11f.z = (mul_nonIEEE(R9f.x,R125f.y) + PV1f.y);
|
|
PS0f = R11f.z;
|
|
// 21
|
|
R11f.x = (mul_nonIEEE(R9f.x,PV0f.w) + R126f.x);
|
|
R11f.y = (mul_nonIEEE(R9f.x,PV0f.z) + R127f.w);
|
|
R11f.w = (mul_nonIEEE(R9f.x,PV0f.x) + R126f.w);
|
|
// export
|
|
passPixelColor0 = vec4(R11f.x, R11f.y, R11f.z, R11f.w);
|
|
}
|