cemu_graphic_packs/Source/XenobladeX/b253dca415790207_0000000000000079_ps.txt

134 lines
4.2 KiB
Plaintext
Raw Normal View History

#version 420
#extension GL_ARB_texture_gather : enable
// shader b253dca415790207
// motion blur fix - static /2 factor as a compromise. fx gets lost in blend on higher scaling
// To-do, review quarter scaling.
const float resScale = 2.0;
//const float resScale = 3;
uniform ivec4 uf_remappedPS[5];
layout(binding = 0) uniform sampler2D textureUnitPS0;// Tex0 addr 0xf4e12000 res 320x180x1 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) in vec4 passParameterSem0;
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){ return min(a*b,min(abs(a)*3.40282347E+38F,abs(b)*3.40282347E+38F)); }
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 R123f = 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 = passParameterSem0;
// 0
R1f.x = R0f.x + intBitsToFloat(uf_remappedPS[0].x)/ resScale;
R1f.y = R0f.y + intBitsToFloat(uf_remappedPS[0].y)/ resScale;
R0f.z = R0f.x + intBitsToFloat(uf_remappedPS[1].x)/ resScale;
R0f.w = R0f.y + intBitsToFloat(uf_remappedPS[1].y)/ resScale;
R5f.w = 1.0;
PS0f = R5f.w;
// 1
R2f.x = R0f.x + intBitsToFloat(uf_remappedPS[2].x)/ resScale;
R2f.y = R0f.y + intBitsToFloat(uf_remappedPS[2].y)/ resScale;
R1f.z = R0f.x + intBitsToFloat(uf_remappedPS[3].x)/ resScale;
R1f.w = R0f.y + intBitsToFloat(uf_remappedPS[3].y)/ resScale;
// 2
backupReg0f = R0f.x;
backupReg1f = R0f.y;
R0f.x = backupReg0f + intBitsToFloat(uf_remappedPS[4].x)/ resScale;
R0f.y = backupReg1f + intBitsToFloat(uf_remappedPS[4].y)/resScale;
R3f.xyz = (texture(textureUnitPS0, R1f.xy).xyz);
R4f.xyz = (texture(textureUnitPS0, R0f.zw).xyz);
R2f.xyz = (texture(textureUnitPS0, R2f.xy).xyz);
R1f.xyz = (texture(textureUnitPS0, R1f.zw).xyz);
R0f.xyz = (texture(textureUnitPS0, R0f.xy).xyz);
// 0
PV0f.x = R3f.y + -(0.5);
PV0f.x *= 2.0;
PV0f.y = R3f.x + -(0.5);
PV0f.y *= 2.0;
R127f.z = R4f.x + -(0.5);
R127f.z *= 2.0;
R127f.w = R4f.y + -(0.5);
R127f.w *= 2.0;
PS0f = R3f.z * intBitsToFloat(uf_remappedPS[0].z);
// 1
R123f.x = (R4f.z * intBitsToFloat(uf_remappedPS[1].z) + PS0f);
PV1f.x = R123f.x;
R127f.y = R2f.x + -(0.5);
R127f.y *= 2.0;
PV1f.z = PV0f.y * intBitsToFloat(uf_remappedPS[0].z);
PV1f.w = PV0f.x * intBitsToFloat(uf_remappedPS[0].z);
R126f.z = R2f.y + -(0.5);
R126f.z *= 2.0;
PS1f = R126f.z;
// 2
R123f.x = (R127f.z * intBitsToFloat(uf_remappedPS[1].z) + PV1f.z);
PV0f.x = R123f.x;
R126f.y = R1f.x + -(0.5);
R126f.y *= 2.0;
R123f.z = (R127f.w * intBitsToFloat(uf_remappedPS[1].z) + PV1f.w);
PV0f.z = R123f.z;
R123f.w = (R2f.z * intBitsToFloat(uf_remappedPS[2].z) + PV1f.x);
PV0f.w = R123f.w;
R127f.w = R1f.y + -(0.5);
R127f.w *= 2.0;
PS0f = R127f.w;
// 3
R123f.x = (R126f.z * intBitsToFloat(uf_remappedPS[2].z) + PV0f.z);
PV1f.x = R123f.x;
R123f.y = (R127f.y * intBitsToFloat(uf_remappedPS[2].z) + PV0f.x);
PV1f.y = R123f.y;
R126f.z = R0f.x + -(0.5);
R126f.z *= 2.0;
R123f.w = (R1f.z * intBitsToFloat(uf_remappedPS[3].z) + PV0f.w);
PV1f.w = R123f.w;
R126f.w = R0f.y + -(0.5);
R126f.w *= 2.0;
PS1f = R126f.w;
// 4
R123f.x = (R0f.z * intBitsToFloat(uf_remappedPS[4].z) + PV1f.w);
PV0f.x = R123f.x;
R123f.y = (R126f.y * intBitsToFloat(uf_remappedPS[3].z) + PV1f.y);
PV0f.y = R123f.y;
R123f.z = (R127f.w * intBitsToFloat(uf_remappedPS[3].z) + PV1f.x);
PV0f.z = R123f.z;
// 5
R123f.y = (R126f.w * intBitsToFloat(uf_remappedPS[4].z) + PV0f.z);
PV1f.y = R123f.y;
R123f.z = (R126f.z * intBitsToFloat(uf_remappedPS[4].z) + PV0f.y);
PV1f.z = R123f.z;
R5f.z = PV0f.x;
PS1f = R5f.z;
// 6
R5f.x = PV1f.z + 1.0;
R5f.x /= 2.0;
R5f.y = PV1f.y + 1.0;
R5f.y /= 2.0;
// export
passPixelColor0 = vec4(R5f.x, R5f.y, R5f.z, R5f.w);
}