cemu_graphic_packs/Enhancements/DrLuigi_!AntiAliasing/9e9abde99f9510dc_000000000000001c_ps.txt
Crementif f3d35c75dc Convert a lot of graphic packs to V4 (#417)
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.
2020-01-17 20:31:42 -08:00

252 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 9e9abde99f9510dc
#ifdef VULKAN
layout(set = 1, binding = 1) uniform ufBlock
{
uniform float uf_alphaTestRef;
uniform vec4 uf_fragCoordScale;
};
#else
uniform float uf_alphaTestRef;
uniform vec2 uf_fragCoordScale;
#endif
TEXTURE_LAYOUT(0, 1, 0) uniform sampler2D textureUnitPS0;
layout(location = 0) in vec4 passParameterSem129;
layout(location = 1) in vec4 passParameterSem128;
layout(location = 0) out vec4 passPixelColor0;
// uf_fragCoordScale was moved to the ufBlock
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 R7i = ivec4(0);
ivec4 R8i = ivec4(0);
ivec4 R122i = ivec4(0);
ivec4 R123i = ivec4(0);
ivec4 R126i = 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(passParameterSem129);
R1i = floatBitsToInt(passParameterSem128);
R5i.xyz = floatBitsToInt(texture(textureUnitPS0, intBitsToFloat(R1i.zw)).xyz);
R6i.xyz = floatBitsToInt(texture(textureUnitPS0, intBitsToFloat(R1i.xy)).xyz);
ivec2 resolution = textureSize(textureUnitPS0,0);
float iresX = float(resolution.x)/float(1280);
float iresY = float(resolution.y)/float(720);
// 0
backupReg0i = R0i.y;
backupReg1i = R0i.x;
PV0i.x = 0;
PV0i.y = floatBitsToInt(intBitsToFloat(backupReg0i) / iresY);
PV0i.z = 0;
R127i.w = floatBitsToInt(intBitsToFloat(backupReg1i) / iresX);
PV0i.w = R127i.w;
R8i.w = 0x3f800000;
PS0i = R8i.w;
// 1
R2i.x = floatBitsToInt(intBitsToFloat(R1i.z) + intBitsToFloat(PV0i.w));
R2i.y = floatBitsToInt(intBitsToFloat(R1i.w) + intBitsToFloat(PV0i.x));
R3i.z = floatBitsToInt(intBitsToFloat(PV0i.z) + intBitsToFloat(R1i.z));
PV1i.w = PV0i.y;
R3i.y = floatBitsToInt(intBitsToFloat(PV0i.y) + intBitsToFloat(R1i.w));
PS1i = R3i.y;
// 2
R4i.x = floatBitsToInt(intBitsToFloat(R1i.z) + intBitsToFloat(R127i.w));
R4i.y = floatBitsToInt(intBitsToFloat(R1i.w) + intBitsToFloat(PV1i.w));
R0i.z = floatBitsToInt(intBitsToFloat(R6i.z) * intBitsToFloat(0x3de978d5));
R3i.x = floatBitsToInt(intBitsToFloat(R5i.z) * intBitsToFloat(0x3de978d5));
PS0i = R3i.x;
R2i.xyz = floatBitsToInt(texture(textureUnitPS0, intBitsToFloat(R2i.xy)).xyz);
R7i.xyz = floatBitsToInt(texture(textureUnitPS0, intBitsToFloat(R3i.zy)).xyz);
R4i.xyz = floatBitsToInt(texture(textureUnitPS0, intBitsToFloat(R4i.xy)).xyz);
// 0
tempi.x = floatBitsToInt(dot(vec4(intBitsToFloat(R5i.x),intBitsToFloat(R5i.y),intBitsToFloat(R3i.x),-0.0),vec4(intBitsToFloat(0x3e991687),intBitsToFloat(0x3f1645a2),1.0,0.0)));
PV0i.x = tempi.x;
PV0i.y = tempi.x;
PV0i.z = tempi.x;
PV0i.w = tempi.x;
R127i.z = tempi.x;
R122i.x = floatBitsToInt((intBitsToFloat(R6i.y) * intBitsToFloat(0x3f1645a2) + intBitsToFloat(R0i.z)));
PS0i = R122i.x;
// 1
tempi.x = floatBitsToInt(dot(vec4(intBitsToFloat(R2i.x),intBitsToFloat(R2i.y),intBitsToFloat(R2i.z),-0.0),vec4(intBitsToFloat(0x3e991687),intBitsToFloat(0x3f1645a2),intBitsToFloat(0x3de978d5),0.0)));
PV1i.x = tempi.x;
PV1i.y = tempi.x;
PV1i.z = tempi.x;
PV1i.w = tempi.x;
R127i.y = tempi.x;
R126i.z = floatBitsToInt((intBitsToFloat(R6i.x) * intBitsToFloat(0x3e991687) + intBitsToFloat(PS0i)));
PS1i = R126i.z;
// 2
R126i.x = floatBitsToInt(dot(vec4(intBitsToFloat(R7i.x),intBitsToFloat(R7i.y),intBitsToFloat(R7i.z),-0.0),vec4(intBitsToFloat(0x3e991687),intBitsToFloat(0x3f1645a2),intBitsToFloat(0x3de978d5),0.0)));
PV0i.x = R126i.x;
PV0i.y = R126i.x;
PV0i.z = R126i.x;
PV0i.w = R126i.x;
R127i.x = floatBitsToInt(intBitsToFloat(R127i.z) + intBitsToFloat(PV1i.x));
PS0i = R127i.x;
// 3
tempi.x = floatBitsToInt(dot(vec4(intBitsToFloat(R4i.x),intBitsToFloat(R4i.y),intBitsToFloat(R4i.z),-0.0),vec4(intBitsToFloat(0x3e991687),intBitsToFloat(0x3f1645a2),intBitsToFloat(0x3de978d5),0.0)));
PV1i.x = tempi.x;
PV1i.y = tempi.x;
PV1i.z = tempi.x;
PV1i.w = tempi.x;
R127i.w = tempi.x;
PS1i = floatBitsToInt(intBitsToFloat(PV0i.x) + intBitsToFloat(PS0i));
// 4
PV0i.x = floatBitsToInt(intBitsToFloat(R127i.y) + intBitsToFloat(PV1i.x));
PV0i.y = floatBitsToInt(intBitsToFloat(R126i.x) + intBitsToFloat(PV1i.x));
PV0i.z = floatBitsToInt(intBitsToFloat(R127i.z) + intBitsToFloat(R126i.x));
PV0i.w = floatBitsToInt(intBitsToFloat(PV1i.x) + intBitsToFloat(PS1i));
R126i.y = floatBitsToInt(min(intBitsToFloat(R127i.z), intBitsToFloat(R127i.y)));
PS0i = R126i.y;
// 5
backupReg0i = R127i.x;
backupReg1i = R127i.z;
backupReg2i = R127i.y;
R127i.x = floatBitsToInt(-(intBitsToFloat(PV0i.x)) + intBitsToFloat(PV0i.z));
PV1i.x = R127i.x;
PV1i.y = floatBitsToInt(intBitsToFloat(PV0i.w) * intBitsToFloat(0x3d000000));
R127i.z = floatBitsToInt(min(intBitsToFloat(R126i.x), intBitsToFloat(R127i.w)));
PV1i.w = floatBitsToInt(-(intBitsToFloat(PV0i.y)) + intBitsToFloat(backupReg0i));
R127i.y = floatBitsToInt(max(intBitsToFloat(backupReg1i), intBitsToFloat(backupReg2i)));
PS1i = R127i.y;
// 6
backupReg0i = R126i.x;
backupReg1i = R127i.w;
R126i.x = floatBitsToInt(-(intBitsToFloat(PV1i.w)));
PV0i.y = floatBitsToInt(max(intBitsToFloat(PV1i.x), -(intBitsToFloat(PV1i.x))));
PV0i.z = floatBitsToInt(max(-(intBitsToFloat(PV1i.w)), intBitsToFloat(PV1i.w)));
R127i.w = floatBitsToInt(max(intBitsToFloat(PV1i.y), intBitsToFloat(0x3c000000)));
PS0i = floatBitsToInt(max(intBitsToFloat(backupReg0i), intBitsToFloat(backupReg1i)));
// 7
PV1i.x = floatBitsToInt(min(intBitsToFloat(PV0i.z), intBitsToFloat(PV0i.y)));
PV1i.y = floatBitsToInt(max(intBitsToFloat(R127i.y), intBitsToFloat(PS0i)));
PV1i.w = floatBitsToInt(min(intBitsToFloat(R126i.y), intBitsToFloat(R127i.z)));
// 8
R2i.x = floatBitsToInt(max(intBitsToFloat(R126i.z), intBitsToFloat(PV1i.y)));
R2i.z = floatBitsToInt(min(intBitsToFloat(R126i.z), intBitsToFloat(PV1i.w)));
PV0i.w = floatBitsToInt(intBitsToFloat(R127i.w) + intBitsToFloat(PV1i.x));
// 9
PS1i = floatBitsToInt(1.0 / intBitsToFloat(PV0i.w));
// 10
PV0i.x = floatBitsToInt(mul_nonIEEE(intBitsToFloat(R127i.x), intBitsToFloat(PS1i)));
PV0i.y = floatBitsToInt(mul_nonIEEE(intBitsToFloat(R126i.x), intBitsToFloat(PS1i)));
// 11
PV1i.z = floatBitsToInt(max(intBitsToFloat(PV0i.x), intBitsToFloat(0xc1000000)));
PV1i.w = floatBitsToInt(max(intBitsToFloat(PV0i.y), intBitsToFloat(0xc1000000)));
// 12
PV0i.y = floatBitsToInt(min(intBitsToFloat(PV1i.w), intBitsToFloat(0x41000000)));
PV0i.w = floatBitsToInt(min(intBitsToFloat(PV1i.z), intBitsToFloat(0x41000000)));
// 13
R126i.z = floatBitsToInt(mul_nonIEEE(intBitsToFloat(R0i.x), intBitsToFloat(PV0i.y)));
PV1i.z = R126i.z;
R127i.w = floatBitsToInt(mul_nonIEEE(intBitsToFloat(R0i.y), intBitsToFloat(PV0i.w)));
PV1i.w = R127i.w;
// 14
R0i.x = floatBitsToInt((intBitsToFloat(PV1i.z) * intBitsToFloat(0x3e2aaaac) + intBitsToFloat(R1i.x)));
R0i.y = floatBitsToInt((intBitsToFloat(PV1i.w) * intBitsToFloat(0x3e2aaaac) + intBitsToFloat(R1i.y)));
R4i.z = floatBitsToInt((intBitsToFloat(PV1i.z) * intBitsToFloat(0xbe2aaaaa) + intBitsToFloat(R1i.x)));
R4i.w = floatBitsToInt((intBitsToFloat(PV1i.w) * intBitsToFloat(0xbe2aaaaa) + intBitsToFloat(R1i.y)));
R4i.x = floatBitsToInt((intBitsToFloat(PV1i.z) * 0.5 + intBitsToFloat(R1i.x)));
PS0i = R4i.x;
// 15
backupReg0i = R1i.x;
R1i.x = floatBitsToInt((-(intBitsToFloat(R126i.z)) * 0.5 + intBitsToFloat(backupReg0i)));
R4i.y = floatBitsToInt((intBitsToFloat(R127i.w) * 0.5 + intBitsToFloat(R1i.y)));
R1i.z = floatBitsToInt((-(intBitsToFloat(R127i.w)) * 0.5 + intBitsToFloat(R1i.y)));
R0i.xyz = floatBitsToInt(texture(textureUnitPS0, intBitsToFloat(R0i.xy)).xyz);
R7i.xyz = floatBitsToInt(texture(textureUnitPS0, intBitsToFloat(R4i.zw)).xyz);
R4i.xyz = floatBitsToInt(texture(textureUnitPS0, intBitsToFloat(R4i.xy)).xyz);
R1i.xyz = floatBitsToInt(texture(textureUnitPS0, intBitsToFloat(R1i.xz)).xyz);
// 0
R126i.x = floatBitsToInt(intBitsToFloat(R0i.z) + intBitsToFloat(R7i.z));
R126i.x = floatBitsToInt(intBitsToFloat(R126i.x) / 2.0);
R127i.z = floatBitsToInt(intBitsToFloat(R0i.y) + intBitsToFloat(R7i.y));
R127i.z = floatBitsToInt(intBitsToFloat(R127i.z) / 2.0);
PV0i.z = R127i.z;
R127i.w = floatBitsToInt(intBitsToFloat(R0i.x) + intBitsToFloat(R7i.x));
R127i.w = floatBitsToInt(intBitsToFloat(R127i.w) / 2.0);
PV0i.w = R127i.w;
// 1
PV1i.x = floatBitsToInt(intBitsToFloat(R4i.x) + intBitsToFloat(R1i.x));
PV1i.y = PV0i.w;
PV1i.y = floatBitsToInt(intBitsToFloat(PV1i.y) / 2.0);
R126i.z = floatBitsToInt(intBitsToFloat(R4i.z) + intBitsToFloat(R1i.z));
PV1i.w = floatBitsToInt(intBitsToFloat(R4i.y) + intBitsToFloat(R1i.y));
PS1i = PV0i.z;
PS1i = floatBitsToInt(intBitsToFloat(PS1i) / 2.0);
// 2
R127i.x = floatBitsToInt((intBitsToFloat(PV1i.x) * 0.25 + intBitsToFloat(PV1i.y)));
R127i.y = floatBitsToInt((intBitsToFloat(PV1i.w) * 0.25 + intBitsToFloat(PS1i)));
PV0i.w = R126i.x;
PV0i.w = floatBitsToInt(intBitsToFloat(PV0i.w) / 2.0);
// 3
backupReg0i = R126i.z;
R126i.z = floatBitsToInt((intBitsToFloat(backupReg0i) * 0.25 + intBitsToFloat(PV0i.w)));
PV1i.z = R126i.z;
// 4
tempi.x = floatBitsToInt(dot(vec4(intBitsToFloat(R127i.x),intBitsToFloat(R127i.y),intBitsToFloat(PV1i.z),-0.0),vec4(intBitsToFloat(0x3e991687),intBitsToFloat(0x3f1645a2),intBitsToFloat(0x3de978d5),0.0)));
PV0i.x = tempi.x;
PV0i.y = tempi.x;
PV0i.z = tempi.x;
PV0i.w = tempi.x;
// 5
PV1i.y = ((intBitsToFloat(PV0i.x) > intBitsToFloat(R2i.x))?int(0xFFFFFFFF):int(0x0));
PV1i.z = ((intBitsToFloat(R2i.z) > intBitsToFloat(PV0i.x))?int(0xFFFFFFFF):int(0x0));
// 6
R123i.x = ((PV1i.z == 0)?(PV1i.y):(int(-1)));
PV0i.x = R123i.x;
// 7
R8i.x = ((PV0i.x == 0)?(R127i.x):(R127i.w));
R8i.y = ((PV0i.x == 0)?(R127i.y):(R127i.z));
R8i.z = ((PV0i.x == 0)?(R126i.z):(R126i.x));
// export
if( ((vec4(intBitsToFloat(R8i.x), intBitsToFloat(R8i.y), intBitsToFloat(R8i.z), intBitsToFloat(R8i.w))).a > uf_alphaTestRef) == false) discard;
passPixelColor0 = vec4(intBitsToFloat(R8i.x), intBitsToFloat(R8i.y), intBitsToFloat(R8i.z), intBitsToFloat(R8i.w));
}