mirror of
https://github.com/cemu-project/cemu_graphic_packs.git
synced 2024-12-27 18:31:50 +01:00
190 lines
7.5 KiB
Plaintext
190 lines
7.5 KiB
Plaintext
#version 420
|
|
#extension GL_ARB_texture_gather : enable
|
|
#extension GL_ARB_shading_language_packing : enable
|
|
// shader 4721609a424e9a1f
|
|
// Used for: Restoring the native BotW Anti-Aliasing implementation
|
|
const float resXScale = $width/1280;
|
|
const float resYScale = $height/720;
|
|
|
|
uniform ivec4 uf_remappedVS[5];
|
|
uniform vec2 uf_windowSpaceToClipSpaceTransform;
|
|
layout(binding = 32) uniform sampler2D textureUnitVS0;// Tex0 addr 0x3db8b000 res 12x1x1 dim 1 tm: 2 format 0816 compSel: 0 1 2 5 mipView: 0x0 (num 0x1) sliceView: 0x0 (num 0x1) Sampler18 ClampX/Y/Z: 2 2 2 border: 1
|
|
layout(location = 0) in uvec4 attrDataSem0;
|
|
layout(location = 1) in uvec4 attrDataSem1;
|
|
out gl_PerVertex
|
|
{
|
|
vec4 gl_Position;
|
|
float gl_PointSize;
|
|
};
|
|
layout(location = 1) out vec4 passParameterSem4;
|
|
layout(location = 0) out vec4 passParameterSem0;
|
|
layout(location = 2) out vec4 passParameterSem6;
|
|
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 R2i = ivec4(0);
|
|
ivec4 R3i = ivec4(0);
|
|
ivec4 R4i = ivec4(0);
|
|
ivec4 R5i = ivec4(0);
|
|
ivec4 R6i = ivec4(0);
|
|
ivec4 R123i = ivec4(0);
|
|
ivec4 R124i = ivec4(0);
|
|
ivec4 R125i = ivec4(0);
|
|
ivec4 R126i = ivec4(0);
|
|
ivec4 R127i = ivec4(0);
|
|
uvec4 attrDecoder;
|
|
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 = ivec4(gl_VertexID, 0, 0, gl_InstanceID);
|
|
attrDecoder.xyzw = attrDataSem0.xyzw;
|
|
attrDecoder = ((attrDecoder>>8)&0xFF)|((attrDecoder<<8)&0xFF00);
|
|
attrDecoder.xyzw = floatBitsToInt(vec4(unpackHalf2x16(attrDecoder.x|(attrDecoder.y<<16)),unpackHalf2x16(attrDecoder.z|(attrDecoder.w<<16))));
|
|
R1i = ivec4(int(attrDecoder.x), int(attrDecoder.y), int(attrDecoder.z), int(attrDecoder.w));
|
|
attrDecoder.x = attrDataSem1.x;
|
|
attrDecoder.x = (attrDecoder.x>>24)|((attrDecoder.x>>8)&0xFF00)|((attrDecoder.x<<8)&0xFF0000)|((attrDecoder.x<<24));
|
|
attrDecoder.y = 0;
|
|
attrDecoder.z = 0;
|
|
attrDecoder.w = 0;
|
|
attrDecoder.xyzw = uvec4((attrDecoder.x>>0)&0x3FF,(attrDecoder.x>>10)&0x3FF,(attrDecoder.x>>20)&0x3FF,(attrDecoder.x>>30)&0x3);
|
|
if( (attrDecoder.x&0x200) != 0 ) attrDecoder.x |= 0xFFFFFC00;
|
|
if( (attrDecoder.y&0x200) != 0 ) attrDecoder.y |= 0xFFFFFC00;
|
|
if( (attrDecoder.z&0x200) != 0 ) attrDecoder.z |= 0xFFFFFC00;
|
|
attrDecoder.x = floatBitsToUint(max(float(int(attrDecoder.x))/511.0,-1.0));
|
|
attrDecoder.y = floatBitsToUint(max(float(int(attrDecoder.y))/511.0,-1.0));
|
|
attrDecoder.z = floatBitsToUint(max(float(int(attrDecoder.z))/511.0,-1.0));
|
|
attrDecoder.w = floatBitsToUint(float(attrDecoder.w));
|
|
R2i = ivec4(int(attrDecoder.x), int(attrDecoder.y), int(attrDecoder.z), int(attrDecoder.w));
|
|
// 0
|
|
backupReg0i = R0i.x;
|
|
PV0i.x = (backupReg0i == int(1))?int(0xFFFFFFFF):int(0x0);
|
|
R127i.y = 0x3f800000;
|
|
PV0i.z = 0x3f800000;
|
|
PV0i.w = 0x40400000;
|
|
R127i.z = 0xbf800000;
|
|
PS0i = R127i.z;
|
|
// 1
|
|
PV1i.x = floatBitsToInt(intBitsToFloat(uf_remappedVS[0].z) * intBitsToFloat(0x3b808081));
|
|
R123i.y = ((PV0i.x == 0)?(PV0i.w):(0xbf800000));
|
|
PV1i.y = R123i.y;
|
|
R0i.z = 0;
|
|
R123i.w = ((PV0i.x == 0)?(PV0i.z):(0xc0400000));
|
|
PV1i.w = R123i.w;
|
|
R1i.w = 0x3f800000;
|
|
PS1i = R1i.w;
|
|
// 2
|
|
R1i.x = ((R0i.x == 0)?(R127i.z):(PV1i.y));
|
|
PV0i.x = R1i.x;
|
|
R1i.y = ((R0i.x == 0)?(R127i.y):(PV1i.w));
|
|
PV0i.y = R1i.y;
|
|
R1i.z = floatBitsToInt(intBitsToFloat(PV1i.x) + -(0.5));
|
|
R1i.z = floatBitsToInt(intBitsToFloat(R1i.z) * 2.0);
|
|
R0i.w = 0x3d2aaaab;
|
|
R0i.x = 0x3e000000;
|
|
PS0i = R0i.x;
|
|
// 3
|
|
R5i.x = floatBitsToInt((intBitsToFloat(PV0i.x) * 0.5 + 0.5));
|
|
PV1i.x = R5i.x;
|
|
R0i.y = 0;
|
|
PV1i.z = floatBitsToInt(-(intBitsToFloat(PV0i.y)));
|
|
R4i.w = uf_remappedVS[1].z;
|
|
R4i.w = floatBitsToInt(intBitsToFloat(R4i.w) / 2.0);
|
|
PV1i.w = R4i.w;
|
|
R4i.x = floatBitsToInt(-(intBitsToFloat(uf_remappedVS[2].z)));
|
|
R4i.x = floatBitsToInt(intBitsToFloat(R4i.x) / 2.0);
|
|
PS1i = R4i.x;
|
|
// 4
|
|
R3i.x = floatBitsToInt(-(intBitsToFloat(R1i.y)));
|
|
R3i.x = floatBitsToInt(intBitsToFloat(R3i.x) / 2.0);
|
|
R5i.y = floatBitsToInt((intBitsToFloat(PV1i.z) * 0.5 + 0.5));
|
|
R6i.z = PV1i.x;
|
|
R3i.w = R1i.x;
|
|
R3i.w = floatBitsToInt(intBitsToFloat(R3i.w) / 2.0);
|
|
R3i.y = floatBitsToInt(intBitsToFloat(PV1i.w) + -(0.5));
|
|
PS0i = R3i.y;
|
|
R2i.w = floatBitsToInt(texture(textureUnitVS0, intBitsToFloat(R0i.wz)).x);
|
|
R2i.xyz = floatBitsToInt(texture(textureUnitVS0, intBitsToFloat(R0i.xy)).xyz);
|
|
// export
|
|
gl_Position = vec4(intBitsToFloat(R1i.x), intBitsToFloat(R1i.y), intBitsToFloat(R1i.z), intBitsToFloat(R1i.w));
|
|
// export
|
|
// skipped export to semanticId 255
|
|
// 0
|
|
R127i.x = floatBitsToInt(intBitsToFloat(R4i.x) + -(0.5));
|
|
R2i.y = floatBitsToInt(-(intBitsToFloat(uf_remappedVS[3].x)));
|
|
R2i.y = floatBitsToInt(intBitsToFloat(R2i.y) * 2.0);
|
|
PV0i.y = R2i.y;
|
|
R127i.z = uf_remappedVS[3].y;
|
|
R127i.z = floatBitsToInt(intBitsToFloat(R127i.z) * 2.0);
|
|
R6i.w = R5i.y;
|
|
PV0i.w = R6i.w;
|
|
PS0i = floatBitsToInt(intBitsToFloat(R3i.w) + intBitsToFloat(R4i.w));
|
|
// 1
|
|
PV1i.x = floatBitsToInt(intBitsToFloat(R3i.x) + intBitsToFloat(R4i.x));
|
|
R126i.y = floatBitsToInt(intBitsToFloat(R5i.x) + intBitsToFloat(R3i.y));
|
|
PV1i.z = floatBitsToInt(intBitsToFloat(PV0i.w) + intBitsToFloat(uf_remappedVS[4].w)/resYScale);
|
|
R127i.w = floatBitsToInt(intBitsToFloat(R6i.z) + intBitsToFloat(uf_remappedVS[4].z)/resXScale);
|
|
R127i.y = floatBitsToInt(mul_nonIEEE(intBitsToFloat(PV0i.y), intBitsToFloat(PS0i)));
|
|
PS1i = R127i.y;
|
|
// 2
|
|
PV0i.x = floatBitsToInt(intBitsToFloat(PV1i.z) + intBitsToFloat(R127i.x));
|
|
R125i.y = floatBitsToInt(mul_nonIEEE(intBitsToFloat(R127i.z), intBitsToFloat(PV1i.x)));
|
|
R126i.z = floatBitsToInt(intBitsToFloat(uf_remappedVS[4].y)*resYScale);
|
|
R126i.z = floatBitsToInt(intBitsToFloat(R126i.z) / 2.0);
|
|
R126i.w = floatBitsToInt(intBitsToFloat(uf_remappedVS[4].x)*resXScale);
|
|
R126i.w = floatBitsToInt(intBitsToFloat(R126i.w) / 2.0);
|
|
R124i.y = floatBitsToInt(intBitsToFloat(uf_remappedVS[4].z)/resXScale);
|
|
R124i.y = floatBitsToInt(intBitsToFloat(R124i.y) * 2.0);
|
|
PS0i = R124i.y;
|
|
// 3
|
|
backupReg0i = R127i.x;
|
|
backupReg1i = R127i.w;
|
|
backupReg2i = R127i.y;
|
|
R127i.x = floatBitsToInt(intBitsToFloat(uf_remappedVS[4].w)/resYScale);
|
|
R127i.x = floatBitsToInt(intBitsToFloat(R127i.x) * 2.0);
|
|
R127i.y = floatBitsToInt(mul_nonIEEE(intBitsToFloat(R127i.z), intBitsToFloat(PV0i.x)));
|
|
PV1i.z = floatBitsToInt(intBitsToFloat(R5i.y) + intBitsToFloat(backupReg0i));
|
|
R127i.w = floatBitsToInt(intBitsToFloat(backupReg1i) + intBitsToFloat(R3i.y));
|
|
R5i.z = backupReg2i;
|
|
PS1i = R5i.z;
|
|
// 4
|
|
R3i.x = floatBitsToInt((mul_nonIEEE(intBitsToFloat(R5i.x),intBitsToFloat(R126i.w)) + 0.5));
|
|
R4i.y = floatBitsToInt(mul_nonIEEE(intBitsToFloat(R127i.z), intBitsToFloat(PV1i.z)));
|
|
PV0i.w = floatBitsToInt(mul_nonIEEE(intBitsToFloat(R2i.y), intBitsToFloat(R126i.y)));
|
|
R5i.w = R125i.y;
|
|
PS0i = R5i.w;
|
|
// 5
|
|
R4i.x = floatBitsToInt(mul_nonIEEE(intBitsToFloat(R2i.y), intBitsToFloat(R127i.w)));
|
|
R3i.y = floatBitsToInt((mul_nonIEEE(intBitsToFloat(R5i.y),intBitsToFloat(R126i.z)) + 0.5));
|
|
R3i.z = R124i.y;
|
|
R3i.w = R127i.x;
|
|
R4i.z = PV0i.w;
|
|
PS1i = R4i.z;
|
|
// 6
|
|
R4i.w = R127i.y;
|
|
// export
|
|
passParameterSem4 = vec4(intBitsToFloat(R3i.x), intBitsToFloat(R3i.y), intBitsToFloat(R3i.z), intBitsToFloat(R3i.w));
|
|
// export
|
|
// skipped export to semanticId 255
|
|
// export
|
|
passParameterSem0 = vec4(intBitsToFloat(R5i.x), intBitsToFloat(R5i.y), intBitsToFloat(R5i.z), intBitsToFloat(R5i.w));
|
|
// export
|
|
passParameterSem6 = vec4(intBitsToFloat(R6i.x), intBitsToFloat(R6i.x), intBitsToFloat(R6i.z), intBitsToFloat(R6i.w));
|
|
}
|