mirror of
https://github.com/cemu-project/cemu_graphic_packs.git
synced 2024-12-30 20:01:50 +01:00
139 lines
5.3 KiB
Plaintext
139 lines
5.3 KiB
Plaintext
#version 430
|
|
#extension GL_ARB_texture_gather : enable
|
|
#extension GL_ARB_separate_shader_objects : enable
|
|
// shader bfe12dca99a601f2
|
|
// start of shader inputs/outputs, predetermined by Cemu. Do not touch
|
|
#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 gl_VertexID gl_VertexIndex
|
|
#define gl_InstanceID gl_InstanceIndex
|
|
#define SET_POSITION(_v) gl_Position = _v; gl_Position.z = (gl_Position.z + gl_Position.w) / 2.0
|
|
#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
|
|
#endif
|
|
#ifdef VULKAN
|
|
layout(set = 0, binding = 0) uniform ufBlock
|
|
{
|
|
uniform ivec4 uf_remappedVS[5];
|
|
};
|
|
#else
|
|
uniform ivec4 uf_remappedVS[5];
|
|
#endif
|
|
ATTR_LAYOUT(0, 0) in uvec4 attrDataSem0;
|
|
ATTR_LAYOUT(0, 1) in uvec4 attrDataSem1;
|
|
out gl_PerVertex
|
|
{
|
|
vec4 gl_Position;
|
|
};
|
|
layout(location = 0) out vec4 passParameterSem4;
|
|
// end of shader inputs/outputs
|
|
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 R123i = 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.xy = attrDataSem0.xy;
|
|
attrDecoder.xy = (attrDecoder.xy>>24)|((attrDecoder.xy>>8)&0xFF00)|((attrDecoder.xy<<8)&0xFF0000)|((attrDecoder.xy<<24));
|
|
attrDecoder.z = 0;
|
|
attrDecoder.w = 0;
|
|
R1i = ivec4(int(attrDecoder.x), int(attrDecoder.y), floatBitsToInt(0.0), floatBitsToInt(1.0));
|
|
attrDecoder.xy = attrDataSem1.xy;
|
|
attrDecoder.xy = (attrDecoder.xy>>24)|((attrDecoder.xy>>8)&0xFF00)|((attrDecoder.xy<<8)&0xFF0000)|((attrDecoder.xy<<24));
|
|
attrDecoder.z = 0;
|
|
attrDecoder.w = 0;
|
|
R2i = ivec4(int(attrDecoder.x), int(attrDecoder.y), floatBitsToInt(0.0), floatBitsToInt(1.0));
|
|
// 0
|
|
R3i.x = floatBitsToInt((mul_nonIEEE(-(intBitsToFloat(R2i.x)),intBitsToFloat(uf_remappedVS[0].w)) + intBitsToFloat(uf_remappedVS[0].w)));
|
|
R3i.x = clampFI32(R3i.x);
|
|
R0i.z = 0xbf800000;
|
|
R0i.w = 0x3f800000;
|
|
PS0i = int(intBitsToFloat(R2i.y));
|
|
// 1
|
|
PV1i.x = 0xfffffffd + PS0i;
|
|
PV1i.y = 0xfffffffe + PS0i;
|
|
PV1i.z = int(-1) + PS0i;
|
|
R127i.w = ((PS0i == 0)?(uf_remappedVS[1].x):(0));
|
|
R3i.z = floatBitsToInt((mul_nonIEEE(-(intBitsToFloat(R2i.x)),intBitsToFloat(uf_remappedVS[2].z)) + intBitsToFloat(uf_remappedVS[2].z)));
|
|
R3i.z = clampFI32(R3i.z);
|
|
PS1i = R3i.z;
|
|
// 2
|
|
R127i.x = ((PV1i.x == 0)?(uf_remappedVS[1].w):(0));
|
|
R127i.y = ((PV1i.y == 0)?(uf_remappedVS[1].z):(0));
|
|
R123i.z = ((PV1i.z == 0)?(uf_remappedVS[1].y):(0));
|
|
PV0i.z = R123i.z;
|
|
R3i.w = floatBitsToInt(-(intBitsToFloat(PS1i)) + 1.0);
|
|
R3i.y = floatBitsToInt(-(intBitsToFloat(R3i.x)) + 1.0);
|
|
PS0i = R3i.y;
|
|
// 3
|
|
PV1i.w = floatBitsToInt(intBitsToFloat(R127i.w) + intBitsToFloat(PV0i.z));
|
|
// 4
|
|
PV0i.z = floatBitsToInt(intBitsToFloat(R127i.y) + intBitsToFloat(PV1i.w));
|
|
// 5
|
|
PV1i.y = floatBitsToInt(intBitsToFloat(R127i.x) + intBitsToFloat(PV0i.z));
|
|
// 6
|
|
PV0i.x = floatBitsToInt(mul_nonIEEE(intBitsToFloat(uf_remappedVS[2].x), intBitsToFloat(PV1i.y)));
|
|
PV0i.w = floatBitsToInt(mul_nonIEEE(intBitsToFloat(uf_remappedVS[2].y), intBitsToFloat(PV1i.y)));
|
|
// 7
|
|
PV1i.z = floatBitsToInt(mul_nonIEEE(intBitsToFloat(R1i.x), intBitsToFloat(PV0i.x)));
|
|
PV1i.w = floatBitsToInt(mul_nonIEEE(intBitsToFloat(R1i.y), intBitsToFloat(PV0i.w)));
|
|
// 8
|
|
R0i.x = floatBitsToInt(intBitsToFloat(PV1i.z) + intBitsToFloat(uf_remappedVS[3].x));
|
|
PV0i.x = R0i.x;
|
|
R0i.y = floatBitsToInt(intBitsToFloat(PV1i.w) + intBitsToFloat(uf_remappedVS[3].y));
|
|
PV0i.y = R0i.y;
|
|
// 9
|
|
R2i.x = floatBitsToInt((intBitsToFloat(PV0i.x) * 0.5 + 0.5));
|
|
PV1i.x = R2i.x;
|
|
R123i.z = floatBitsToInt((intBitsToFloat(PV0i.y) * 0.5 + 0.5));
|
|
PV1i.z = R123i.z;
|
|
// 10
|
|
PV0i.x = floatBitsToInt(intBitsToFloat(PV1i.x) + -(intBitsToFloat(uf_remappedVS[4].x)));
|
|
R2i.y = floatBitsToInt(-(intBitsToFloat(PV1i.z)) + 1.0);
|
|
PV0i.y = R2i.y;
|
|
R1i.x = floatBitsToInt(intBitsToFloat(PV1i.x) + intBitsToFloat(uf_remappedVS[4].x));
|
|
PS0i = R1i.x;
|
|
// 11
|
|
PV1i.x = floatBitsToInt(intBitsToFloat(PV0i.y) + -(intBitsToFloat(uf_remappedVS[4].y)));
|
|
R1i.y = floatBitsToInt(intBitsToFloat(PV0i.y) + intBitsToFloat(uf_remappedVS[4].y));
|
|
R1i.z = PV0i.x;
|
|
// 12
|
|
R1i.w = PV1i.x;
|
|
// export
|
|
SET_POSITION(vec4(intBitsToFloat(R0i.x), intBitsToFloat(R0i.y), intBitsToFloat(R0i.z), intBitsToFloat(R0i.w)));
|
|
// export
|
|
// skipped export to semanticId 255
|
|
// export
|
|
// passParameterSem4 = vec4(intBitsToFloat(R3i.x), intBitsToFloat(R3i.y), intBitsToFloat(R3i.z), intBitsToFloat(R3i.w));
|
|
// export
|
|
// skipped export to semanticId 255
|
|
}
|