mirror of
https://github.com/cemu-project/cemu_graphic_packs.git
synced 2024-12-23 16:31:50 +01:00
336 lines
12 KiB
Plaintext
336 lines
12 KiB
Plaintext
#version 420
|
|
#extension GL_ARB_texture_gather : enable
|
|
const float bloomFactor = 0.4;
|
|
// shader 95a5a89d62998e0d
|
|
uniform ivec4 uf_remappedPS[3];
|
|
layout(binding = 0) uniform sampler2D textureUnitPS0;// Tex0 addr 0xf59ff000 res 480x270x1 dim 1 tm: 4 format 001a compSel: 0 1 2 3 mipView: 0x0 (num 0x1) sliceView: 0x0 (num 0x1) Sampler0 ClampX/Y/Z: 2 2 2 border: 0
|
|
layout(location = 0) out vec4 passPixelColor0;
|
|
uniform vec2 uf_fragCoordScale;
|
|
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){ if( a == 0.0 || b == 0.0 ) return 0.0; return a*b; }
|
|
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 R123f = 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 = vec4(gl_FragCoord.xy*uf_fragCoordScale,gl_FragCoord.zw);
|
|
// 0
|
|
R7f.x = R0f.x * intBitsToFloat(0x3b088889);
|
|
PV0f.x = R7f.x;
|
|
R7f.y = R0f.y * intBitsToFloat(0x3b72b9d6);
|
|
PV0f.y = R7f.y;
|
|
// 1
|
|
R0f.x = PV0f.x;
|
|
R0f.y = PV0f.y + intBitsToFloat(0x3b72b9d6);
|
|
R1f.z = PV0f.x;
|
|
R1f.y = PV0f.y + intBitsToFloat(0xbb72b9d6);
|
|
PS1f = R1f.y;
|
|
// 2
|
|
R2f.x = R7f.x;
|
|
R2f.y = R7f.y + intBitsToFloat(0x3bf2b9d6);
|
|
R4f.z = R7f.x;
|
|
R4f.y = R7f.y + intBitsToFloat(0xbbf2b9d6);
|
|
PS0f = R4f.y;
|
|
R3f.xyzw = (textureLod(textureUnitPS0, R7f.xy,0.0).xyzw);
|
|
R0f.xyzw = (textureLod(textureUnitPS0, R0f.xy,0.0).xyzw);
|
|
R1f.xyzw = (textureLod(textureUnitPS0, R1f.zy,0.0).xyzw);
|
|
R2f.xyzw = (textureLod(textureUnitPS0, R2f.xy,0.0).xyzw);
|
|
// 0
|
|
backupReg0f = R0f.x;
|
|
backupReg1f = R0f.w;
|
|
PV0f.x = mul_nonIEEE(intBitsToFloat(uf_remappedPS[0].y), R0f.y);
|
|
PV0f.y = mul_nonIEEE(intBitsToFloat(uf_remappedPS[0].y), R0f.z);
|
|
PV0f.z = mul_nonIEEE(intBitsToFloat(uf_remappedPS[0].y), backupReg0f);
|
|
PV0f.w = mul_nonIEEE(intBitsToFloat(uf_remappedPS[0].y), backupReg1f);
|
|
R0f.y = R7f.y + intBitsToFloat(0x3c360b60);
|
|
PS0f = R0f.y;
|
|
// 1
|
|
R123f.x = (R3f.y * intBitsToFloat(uf_remappedPS[0].x) + PV0f.x);
|
|
PV1f.x = R123f.x;
|
|
R123f.y = (R3f.w * intBitsToFloat(uf_remappedPS[0].x) + PV0f.w);
|
|
PV1f.y = R123f.y;
|
|
R123f.z = (R3f.x * intBitsToFloat(uf_remappedPS[0].x) + PV0f.z);
|
|
PV1f.z = R123f.z;
|
|
R123f.w = (R3f.z * intBitsToFloat(uf_remappedPS[0].x) + PV0f.y);
|
|
PV1f.w = R123f.w;
|
|
R0f.x = R7f.x;
|
|
PS1f = R0f.x;
|
|
// 2
|
|
R123f.x = (intBitsToFloat(uf_remappedPS[0].y) * R1f.y + PV1f.x);
|
|
PV0f.x = R123f.x;
|
|
R123f.y = (intBitsToFloat(uf_remappedPS[0].y) * R1f.x + PV1f.z);
|
|
PV0f.y = R123f.y;
|
|
R123f.z = (intBitsToFloat(uf_remappedPS[0].y) * R1f.w + PV1f.y);
|
|
PV0f.z = R123f.z;
|
|
R123f.w = (intBitsToFloat(uf_remappedPS[0].y) * R1f.z + PV1f.w);
|
|
PV0f.w = R123f.w;
|
|
R1f.y = R7f.y + intBitsToFloat(0xbc360b60);
|
|
PS0f = R1f.y;
|
|
// 3
|
|
backupReg0f = R2f.z;
|
|
R3f.x = (intBitsToFloat(uf_remappedPS[0].z) * R2f.x + PV0f.y);
|
|
R3f.y = (intBitsToFloat(uf_remappedPS[0].z) * R2f.y + PV0f.x);
|
|
R2f.z = (intBitsToFloat(uf_remappedPS[0].z) * R2f.w + PV0f.z);
|
|
R2f.w = (intBitsToFloat(uf_remappedPS[0].z) * backupReg0f + PV0f.w);
|
|
R1f.x = R7f.x;
|
|
PS1f = R1f.x;
|
|
// 4
|
|
R2f.x = R7f.x;
|
|
R2f.y = R7f.y + intBitsToFloat(0x3c72b9d6);
|
|
R6f.z = R7f.x;
|
|
R6f.y = R7f.y + intBitsToFloat(0xbc72b9d6);
|
|
PS0f = R6f.y;
|
|
R4f.xyzw = (textureLod(textureUnitPS0, R4f.zy,0.0).xyzw);
|
|
R0f.xyzw = (textureLod(textureUnitPS0, R0f.xy,0.0).xyzw);
|
|
R1f.xyzw = (textureLod(textureUnitPS0, R1f.xy,0.0).xyzw);
|
|
R5f.xyzw = (textureLod(textureUnitPS0, R2f.xy,0.0).xyzw);
|
|
// 0
|
|
R123f.x = (intBitsToFloat(uf_remappedPS[0].z) * R4f.x + R3f.x);
|
|
PV0f.x = R123f.x;
|
|
R123f.y = (intBitsToFloat(uf_remappedPS[0].z) * R4f.w + R2f.z);
|
|
PV0f.y = R123f.y;
|
|
R123f.z = (intBitsToFloat(uf_remappedPS[0].z) * R4f.z + R2f.w);
|
|
PV0f.z = R123f.z;
|
|
R123f.w = (intBitsToFloat(uf_remappedPS[0].z) * R4f.y + R3f.y);
|
|
PV0f.w = R123f.w;
|
|
R3f.y = R7f.y + intBitsToFloat(0x3c97b426);
|
|
PS0f = R3f.y;
|
|
// 1
|
|
R123f.x = (intBitsToFloat(uf_remappedPS[0].w) * R0f.w + PV0f.y);
|
|
PV1f.x = R123f.x;
|
|
R123f.y = (intBitsToFloat(uf_remappedPS[0].w) * R0f.x + PV0f.x);
|
|
PV1f.y = R123f.y;
|
|
R123f.z = (intBitsToFloat(uf_remappedPS[0].w) * R0f.z + PV0f.z);
|
|
PV1f.z = R123f.z;
|
|
R123f.w = (intBitsToFloat(uf_remappedPS[0].w) * R0f.y + PV0f.w);
|
|
PV1f.w = R123f.w;
|
|
R3f.x = R7f.x;
|
|
PS1f = R3f.x;
|
|
// 2
|
|
R123f.x = (intBitsToFloat(uf_remappedPS[0].w) * R1f.w + PV1f.x);
|
|
PV0f.x = R123f.x;
|
|
R123f.y = (intBitsToFloat(uf_remappedPS[0].w) * R1f.z + PV1f.z);
|
|
PV0f.y = R123f.y;
|
|
R123f.z = (intBitsToFloat(uf_remappedPS[0].w) * R1f.y + PV1f.w);
|
|
PV0f.z = R123f.z;
|
|
R123f.w = (intBitsToFloat(uf_remappedPS[0].w) * R1f.x + PV1f.y);
|
|
PV0f.w = R123f.w;
|
|
R1f.y = R7f.y + intBitsToFloat(0xbc97b426);
|
|
PS0f = R1f.y;
|
|
// 3
|
|
R0f.x = (R5f.z * intBitsToFloat(uf_remappedPS[1].x) + PV0f.y);
|
|
R0f.y = (R5f.w * intBitsToFloat(uf_remappedPS[1].x) + PV0f.x);
|
|
R5f.z = (R5f.y * intBitsToFloat(uf_remappedPS[1].x) + PV0f.z);
|
|
R5f.w = (R5f.x * intBitsToFloat(uf_remappedPS[1].x) + PV0f.w);
|
|
R1f.x = R7f.x;
|
|
PS1f = R1f.x;
|
|
// 4
|
|
R5f.x = R7f.x;
|
|
R5f.y = R7f.y + intBitsToFloat(0x3cb60b60);
|
|
R4f.z = R7f.x;
|
|
R4f.y = R7f.y + intBitsToFloat(0xbcb60b60);
|
|
PS0f = R4f.y;
|
|
R6f.xyzw = (textureLod(textureUnitPS0, R6f.zy,0.0).xyzw);
|
|
R3f.xyzw = (textureLod(textureUnitPS0, R3f.xy,0.0).xyzw);
|
|
R1f.xyzw = (textureLod(textureUnitPS0, R1f.xy,0.0).xyzw);
|
|
R2f.xyzw = (textureLod(textureUnitPS0, R5f.xy,0.0).xyzw);
|
|
// 0
|
|
R123f.x = (intBitsToFloat(uf_remappedPS[1].x) * R6f.z + R0f.x);
|
|
PV0f.x = R123f.x;
|
|
R123f.y = (intBitsToFloat(uf_remappedPS[1].x) * R6f.y + R5f.z);
|
|
PV0f.y = R123f.y;
|
|
R123f.z = (intBitsToFloat(uf_remappedPS[1].x) * R6f.x + R5f.w);
|
|
PV0f.z = R123f.z;
|
|
R123f.w = (intBitsToFloat(uf_remappedPS[1].x) * R6f.w + R0f.y);
|
|
PV0f.w = R123f.w;
|
|
R0f.y = R7f.y + intBitsToFloat(0x3cd4629b);
|
|
PS0f = R0f.y;
|
|
// 1
|
|
R123f.x = (intBitsToFloat(uf_remappedPS[1].y) * R3f.y + PV0f.y);
|
|
PV1f.x = R123f.x;
|
|
R123f.y = (intBitsToFloat(uf_remappedPS[1].y) * R3f.w + PV0f.w);
|
|
PV1f.y = R123f.y;
|
|
R123f.z = (intBitsToFloat(uf_remappedPS[1].y) * R3f.x + PV0f.z);
|
|
PV1f.z = R123f.z;
|
|
R123f.w = (intBitsToFloat(uf_remappedPS[1].y) * R3f.z + PV0f.x);
|
|
PV1f.w = R123f.w;
|
|
R0f.x = R7f.x;
|
|
PS1f = R0f.x;
|
|
// 2
|
|
R123f.x = (intBitsToFloat(uf_remappedPS[1].y) * R1f.y + PV1f.x);
|
|
PV0f.x = R123f.x;
|
|
R123f.y = (intBitsToFloat(uf_remappedPS[1].y) * R1f.x + PV1f.z);
|
|
PV0f.y = R123f.y;
|
|
R123f.z = (intBitsToFloat(uf_remappedPS[1].y) * R1f.w + PV1f.y);
|
|
PV0f.z = R123f.z;
|
|
R123f.w = (intBitsToFloat(uf_remappedPS[1].y) * R1f.z + PV1f.w);
|
|
PV0f.w = R123f.w;
|
|
R1f.y = R7f.y + intBitsToFloat(0xbcd4629b);
|
|
PS0f = R1f.y;
|
|
// 3
|
|
backupReg0f = R2f.z;
|
|
R3f.x = (intBitsToFloat(uf_remappedPS[1].z) * R2f.x + PV0f.y);
|
|
R3f.y = (intBitsToFloat(uf_remappedPS[1].z) * R2f.y + PV0f.x);
|
|
R2f.z = (intBitsToFloat(uf_remappedPS[1].z) * R2f.w + PV0f.z);
|
|
R2f.w = (intBitsToFloat(uf_remappedPS[1].z) * backupReg0f + PV0f.w);
|
|
R1f.x = R7f.x;
|
|
PS1f = R1f.x;
|
|
// 4
|
|
R2f.x = R7f.x;
|
|
R2f.y = R7f.y + intBitsToFloat(0x3cf2b9d6);
|
|
R6f.z = R7f.x;
|
|
R6f.y = R7f.y + intBitsToFloat(0xbcf2b9d6);
|
|
PS0f = R6f.y;
|
|
R4f.xyzw = (textureLod(textureUnitPS0, R4f.zy,0.0).xyzw);
|
|
R0f.xyzw = (textureLod(textureUnitPS0, R0f.xy,0.0).xyzw);
|
|
R1f.xyzw = (textureLod(textureUnitPS0, R1f.xy,0.0).xyzw);
|
|
R5f.xyzw = (textureLod(textureUnitPS0, R2f.xy,0.0).xyzw);
|
|
// 0
|
|
R123f.x = (intBitsToFloat(uf_remappedPS[1].z) * R4f.x + R3f.x);
|
|
PV0f.x = R123f.x;
|
|
R123f.y = (intBitsToFloat(uf_remappedPS[1].z) * R4f.w + R2f.z);
|
|
PV0f.y = R123f.y;
|
|
R123f.z = (intBitsToFloat(uf_remappedPS[1].z) * R4f.z + R2f.w);
|
|
PV0f.z = R123f.z;
|
|
R123f.w = (intBitsToFloat(uf_remappedPS[1].z) * R4f.y + R3f.y);
|
|
PV0f.w = R123f.w;
|
|
R3f.y = R7f.y + intBitsToFloat(0x3d088888);
|
|
PS0f = R3f.y;
|
|
// 1
|
|
R123f.x = (intBitsToFloat(uf_remappedPS[1].w) * R0f.w + PV0f.y);
|
|
PV1f.x = R123f.x;
|
|
R123f.y = (intBitsToFloat(uf_remappedPS[1].w) * R0f.x + PV0f.x);
|
|
PV1f.y = R123f.y;
|
|
R123f.z = (intBitsToFloat(uf_remappedPS[1].w) * R0f.z + PV0f.z);
|
|
PV1f.z = R123f.z;
|
|
R123f.w = (intBitsToFloat(uf_remappedPS[1].w) * R0f.y + PV0f.w);
|
|
PV1f.w = R123f.w;
|
|
R3f.x = R7f.x;
|
|
PS1f = R3f.x;
|
|
// 2
|
|
R123f.x = (intBitsToFloat(uf_remappedPS[1].w) * R1f.w + PV1f.x);
|
|
PV0f.x = R123f.x;
|
|
R123f.y = (intBitsToFloat(uf_remappedPS[1].w) * R1f.z + PV1f.z);
|
|
PV0f.y = R123f.y;
|
|
R123f.z = (intBitsToFloat(uf_remappedPS[1].w) * R1f.y + PV1f.w);
|
|
PV0f.z = R123f.z;
|
|
R123f.w = (intBitsToFloat(uf_remappedPS[1].w) * R1f.x + PV1f.y);
|
|
PV0f.w = R123f.w;
|
|
R1f.y = R7f.y + intBitsToFloat(0xbd088888);
|
|
PS0f = R1f.y;
|
|
// 3
|
|
R0f.x = (R5f.z * intBitsToFloat(uf_remappedPS[2].x) + PV0f.y);
|
|
R0f.y = (R5f.w * intBitsToFloat(uf_remappedPS[2].x) + PV0f.x);
|
|
R5f.z = (R5f.y * intBitsToFloat(uf_remappedPS[2].x) + PV0f.z);
|
|
R5f.w = (R5f.x * intBitsToFloat(uf_remappedPS[2].x) + PV0f.w);
|
|
R1f.x = R7f.x;
|
|
PS1f = R1f.x;
|
|
// 4
|
|
R5f.x = R7f.x;
|
|
R5f.y = R7f.y + intBitsToFloat(0x3d17b426);
|
|
R4f.z = R7f.x;
|
|
R4f.y = R7f.y + intBitsToFloat(0xbd17b426);
|
|
PS0f = R4f.y;
|
|
R6f.xyzw = (textureLod(textureUnitPS0, R6f.zy,0.0).xyzw);
|
|
R3f.xyzw = (textureLod(textureUnitPS0, R3f.xy,0.0).xyzw);
|
|
R1f.xyzw = (textureLod(textureUnitPS0, R1f.xy,0.0).xyzw);
|
|
R2f.xyzw = (textureLod(textureUnitPS0, R5f.xy,0.0).xyzw);
|
|
// 0
|
|
R123f.x = (intBitsToFloat(uf_remappedPS[2].x) * R6f.z + R0f.x);
|
|
PV0f.x = R123f.x;
|
|
R123f.y = (intBitsToFloat(uf_remappedPS[2].x) * R6f.y + R5f.z);
|
|
PV0f.y = R123f.y;
|
|
R123f.z = (intBitsToFloat(uf_remappedPS[2].x) * R6f.x + R5f.w);
|
|
PV0f.z = R123f.z;
|
|
R123f.w = (intBitsToFloat(uf_remappedPS[2].x) * R6f.w + R0f.y);
|
|
PV0f.w = R123f.w;
|
|
R0f.y = R7f.y + intBitsToFloat(0x3d26dfc3);
|
|
PS0f = R0f.y;
|
|
// 1
|
|
R123f.x = (intBitsToFloat(uf_remappedPS[2].y) * R3f.y + PV0f.y);
|
|
PV1f.x = R123f.x;
|
|
R123f.y = (intBitsToFloat(uf_remappedPS[2].y) * R3f.w + PV0f.w);
|
|
PV1f.y = R123f.y;
|
|
R123f.z = (intBitsToFloat(uf_remappedPS[2].y) * R3f.x + PV0f.z);
|
|
PV1f.z = R123f.z;
|
|
R123f.w = (intBitsToFloat(uf_remappedPS[2].y) * R3f.z + PV0f.x);
|
|
PV1f.w = R123f.w;
|
|
R0f.x = R7f.x;
|
|
PS1f = R0f.x;
|
|
// 2
|
|
backupReg0f = R7f.y;
|
|
R123f.x = (intBitsToFloat(uf_remappedPS[2].y) * R1f.y + PV1f.x);
|
|
PV0f.x = R123f.x;
|
|
R123f.y = (intBitsToFloat(uf_remappedPS[2].y) * R1f.x + PV1f.z);
|
|
PV0f.y = R123f.y;
|
|
R123f.z = (intBitsToFloat(uf_remappedPS[2].y) * R1f.w + PV1f.y);
|
|
PV0f.z = R123f.z;
|
|
R123f.w = (intBitsToFloat(uf_remappedPS[2].y) * R1f.z + PV1f.w);
|
|
PV0f.w = R123f.w;
|
|
R7f.y = backupReg0f + intBitsToFloat(0xbd26dfc3);
|
|
PS0f = R7f.y;
|
|
// 3
|
|
backupReg0f = R2f.x;
|
|
backupReg1f = R2f.y;
|
|
backupReg2f = R2f.z;
|
|
R2f.x = (intBitsToFloat(uf_remappedPS[2].z) * backupReg0f + PV0f.y);
|
|
R2f.y = (intBitsToFloat(uf_remappedPS[2].z) * backupReg1f + PV0f.x);
|
|
R2f.z = (intBitsToFloat(uf_remappedPS[2].z) * R2f.w + PV0f.z);
|
|
R2f.w = (intBitsToFloat(uf_remappedPS[2].z) * backupReg2f + PV0f.w);
|
|
R4f.xyzw = (textureLod(textureUnitPS0, R4f.zy,0.0).xyzw);
|
|
R0f.xyzw = (textureLod(textureUnitPS0, R0f.xy,0.0).xyzw);
|
|
R7f.xyzw = (textureLod(textureUnitPS0, R7f.xy,0.0).xyzw);
|
|
// 0
|
|
R123f.x = (intBitsToFloat(uf_remappedPS[2].z) * R4f.x + R2f.x);
|
|
PV0f.x = R123f.x;
|
|
R123f.y = (intBitsToFloat(uf_remappedPS[2].z) * R4f.w + R2f.z);
|
|
PV0f.y = R123f.y;
|
|
R123f.z = (intBitsToFloat(uf_remappedPS[2].z) * R4f.z + R2f.w);
|
|
PV0f.z = R123f.z;
|
|
R123f.w = (intBitsToFloat(uf_remappedPS[2].z) * R4f.y + R2f.y);
|
|
PV0f.w = R123f.w;
|
|
// 1
|
|
R123f.x = (intBitsToFloat(uf_remappedPS[2].w) * R0f.w + PV0f.y);
|
|
PV1f.x = R123f.x;
|
|
R123f.y = (intBitsToFloat(uf_remappedPS[2].w) * R0f.x + PV0f.x);
|
|
PV1f.y = R123f.y;
|
|
R123f.z = (intBitsToFloat(uf_remappedPS[2].w) * R0f.z + PV0f.z);
|
|
PV1f.z = R123f.z;
|
|
R123f.w = (intBitsToFloat(uf_remappedPS[2].w) * R0f.y + PV0f.w);
|
|
PV1f.w = R123f.w;
|
|
// 2
|
|
backupReg0f = R7f.x;
|
|
backupReg1f = R7f.y;
|
|
backupReg2f = R7f.z;
|
|
backupReg3f = R7f.w;
|
|
R7f.x = (intBitsToFloat(uf_remappedPS[2].w) * backupReg0f + PV1f.y * bloomFactor);
|
|
R7f.y = (intBitsToFloat(uf_remappedPS[2].w) * backupReg1f + PV1f.w * bloomFactor);
|
|
R7f.z = (intBitsToFloat(uf_remappedPS[2].w) * backupReg2f + PV1f.z * bloomFactor);
|
|
R7f.w = (intBitsToFloat(uf_remappedPS[2].w) * backupReg3f + PV1f.x * bloomFactor);
|
|
// export
|
|
passPixelColor0 = vec4(R7f.x, R7f.y, R7f.z, R7f.w);
|
|
}
|