mirror of
https://github.com/cemu-project/cemu_graphic_packs.git
synced 2024-11-23 01:59:18 +01:00
c1b904314d
This reverts commit 306da0b802
.
83 lines
3.3 KiB
Plaintext
83 lines
3.3 KiB
Plaintext
#version 420
|
|
#extension GL_ARB_texture_gather : enable
|
|
#extension GL_ARB_separate_shader_objects : enable
|
|
#ifdef VULKAN
|
|
#else
|
|
#endif
|
|
// shader 03c0659aacda420a
|
|
// Used for: Removing the position number from the HUD, black undertext
|
|
|
|
uniform ivec4 uf_remappedPS[3];
|
|
uniform vec2 uf_fragCoordScale;
|
|
layout(binding = 0) uniform sampler2D textureUnitPS0;
|
|
layout(binding = 1) uniform sampler2D textureUnitPS1;
|
|
layout(location = 0) in vec4 passParameterSem0;
|
|
layout(location = 1) in vec4 passParameterSem1;
|
|
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){ if( a == 0.0 || b == 0.0 ) return 0.0; return a*b; }
|
|
void main()
|
|
{
|
|
ivec4 R0i = ivec4(0);
|
|
ivec4 R1i = ivec4(0);
|
|
ivec4 R123i = ivec4(0);
|
|
ivec4 R127i = ivec4(0);
|
|
int backupReg0i, backupReg1i, backupReg2i, backupReg3i, backupReg4i;
|
|
ivec4 PV0i = ivec4(0), PV1i = ivec4(0);
|
|
int PS0i = 0, PS1i = 0;
|
|
ivec4 tempi = ivec4(0);
|
|
float tempResultf;
|
|
int tempResulti;
|
|
ivec4 ARi = ivec4(0);
|
|
bool predResult = true;
|
|
vec3 cubeMapSTM;
|
|
int cubeMapFaceId;
|
|
R0i = floatBitsToInt(passParameterSem0);
|
|
R1i = floatBitsToInt(passParameterSem1);
|
|
R1i.xyzw = floatBitsToInt(texture(textureUnitPS1, intBitsToFloat(R1i.xy)).xyzw);
|
|
R0i.xyzw = floatBitsToInt(texture(textureUnitPS0, intBitsToFloat(R0i.xy)).xyzw);
|
|
// 0
|
|
R127i.x = floatBitsToInt((mul_nonIEEE(-(intBitsToFloat(R1i.z)),intBitsToFloat(R1i.w)) + 1.0));
|
|
R127i.y = floatBitsToInt((mul_nonIEEE(-(intBitsToFloat(R1i.y)),intBitsToFloat(R1i.w)) + 1.0));
|
|
R123i.z = floatBitsToInt((mul_nonIEEE(-(intBitsToFloat(R1i.x)),intBitsToFloat(R1i.w)) + 1.0));
|
|
PV0i.z = R123i.z;
|
|
R127i.w = uf_remappedPS[0].x & 0x00000080;
|
|
R127i.z = floatBitsToInt(max(intBitsToFloat(R0i.w), intBitsToFloat(R1i.w)));
|
|
PS0i = R127i.z;
|
|
// 1
|
|
PV1i.y = floatBitsToInt(min(intBitsToFloat(R0i.w), intBitsToFloat(R1i.w)));
|
|
PS1i = floatBitsToInt(1.0 / intBitsToFloat(PV0i.z));
|
|
// 2
|
|
backupReg0i = R0i.x;
|
|
backupReg1i = R127i.y;
|
|
PV0i.x = floatBitsToInt(intBitsToFloat(backupReg0i) * intBitsToFloat(PS1i));
|
|
R127i.y = ((R127i.w == 0)?(R127i.z):(PV1i.y));
|
|
PS0i = floatBitsToInt(1.0 / intBitsToFloat(backupReg1i));
|
|
// 3
|
|
backupReg0i = R0i.y;
|
|
PV1i.y = floatBitsToInt(min(intBitsToFloat(PV0i.x), 1.0));
|
|
PV1i.w = floatBitsToInt(intBitsToFloat(backupReg0i) * intBitsToFloat(PS0i));
|
|
PS1i = floatBitsToInt(1.0 / intBitsToFloat(R127i.x));
|
|
// 4
|
|
backupReg0i = R0i.z;
|
|
PV0i.x = floatBitsToInt(min(intBitsToFloat(PV1i.w), 1.0));
|
|
PV0i.z = floatBitsToInt(intBitsToFloat(backupReg0i) * intBitsToFloat(PS1i));
|
|
R0i.x = floatBitsToInt((mul_nonIEEE(intBitsToFloat(PV1i.y),intBitsToFloat(uf_remappedPS[1].x)) + intBitsToFloat(uf_remappedPS[2].x)));
|
|
PS0i = R0i.x;
|
|
// 5
|
|
R0i.y = floatBitsToInt((mul_nonIEEE(intBitsToFloat(PV0i.x),intBitsToFloat(uf_remappedPS[1].y)) + intBitsToFloat(uf_remappedPS[2].y)));
|
|
PV1i.w = floatBitsToInt(min(intBitsToFloat(PV0i.z), 1.0));
|
|
// 6
|
|
R0i.z = floatBitsToInt((mul_nonIEEE(intBitsToFloat(PV1i.w),intBitsToFloat(uf_remappedPS[1].z)) + intBitsToFloat(uf_remappedPS[2].z)));
|
|
R0i.w = floatBitsToInt((mul_nonIEEE(intBitsToFloat(R127i.y),intBitsToFloat(uf_remappedPS[1].w)) + intBitsToFloat(uf_remappedPS[2].w)));
|
|
// export
|
|
passPixelColor0 = vec4(intBitsToFloat(R0i.x), intBitsToFloat(R0i.y), intBitsToFloat(R0i.z), 0.0);
|
|
}
|