mirror of
https://github.com/cemu-project/cemu_graphic_packs.git
synced 2024-12-23 16:31:50 +01:00
124 lines
3.9 KiB
Plaintext
124 lines
3.9 KiB
Plaintext
<?php
|
|
include 'Source/functions.php';
|
|
$fullWidth = $argv[1];
|
|
$fullHeight = $argv[2];
|
|
$scaleFactorX = always_decimal_format($fullWidth / 1280.0);
|
|
$scaleFactorY = always_decimal_format($fullHeight / 720.0);
|
|
?>
|
|
#version 420
|
|
#extension GL_ARB_texture_gather : enable
|
|
#extension GL_ARB_separate_shader_objects : enable
|
|
// shader fe05aca8e186a5fd
|
|
// Used for: DoF backgrounds
|
|
const float resXScale = <?=$scaleFactorX?>;
|
|
const float resYScale = <?=$scaleFactorY?>;
|
|
|
|
layout(binding = 38, std140) uniform uniformBlockPS6
|
|
{
|
|
vec4 uf_blockPS6[1024];
|
|
};
|
|
|
|
layout(binding = 0) uniform sampler2D textureUnitPS0;// Tex0 addr 0x33659800 res 640x360x1 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 passParameterSem136;
|
|
layout(location = 1) in vec4 passParameterSem130;
|
|
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){ 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);
|
|
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;
|
|
bool activeMaskStack[1];
|
|
bool activeMaskStackC[2];
|
|
activeMaskStackC[0] = false;
|
|
activeMaskStack[0] = true;
|
|
activeMaskStackC[0] = true;
|
|
activeMaskStackC[1] = true;
|
|
vec3 cubeMapSTM;
|
|
int cubeMapFaceId;
|
|
R0i = floatBitsToInt(passParameterSem136);
|
|
R1i = floatBitsToInt(passParameterSem130);
|
|
if( activeMaskStackC[1] == true ) {
|
|
// 0
|
|
R4i.xyz = ivec3(0,0,0);
|
|
R4i.w = floatBitsToInt(1.0);
|
|
R1i.z = 0;
|
|
PS0i = R1i.z;
|
|
// 1
|
|
R1i.w = int(uf_blockPS6[0].x);
|
|
PS1i = R1i.w;
|
|
}
|
|
while( activeMaskStackC[1] == true )
|
|
{
|
|
if( activeMaskStackC[1] == true ) {
|
|
// 0
|
|
R2i.x = (R1i.w > R1i.z)?int(0xFFFFFFFF):int(0x0);
|
|
// 1
|
|
predResult = (R2i.x != 0);
|
|
if( predResult == false ) break;
|
|
}
|
|
if( activeMaskStackC[1] == true ) {
|
|
// 0
|
|
backupReg0i = R1i.z;
|
|
R1i.z = backupReg0i + int(1);
|
|
}
|
|
if( activeMaskStackC[1] == true ) {
|
|
R3i.xyz = floatBitsToInt(uf_blockPS6[R1i.z].xyz/resXScale); // Uses X, not sure if this shader is supposed to be widescreened.
|
|
}
|
|
if( activeMaskStackC[1] == true ) {
|
|
// 0
|
|
R2i.x = floatBitsToInt(intBitsToFloat(R1i.x) + intBitsToFloat(R3i.x));
|
|
R2i.y = floatBitsToInt(intBitsToFloat(R1i.y) + intBitsToFloat(R3i.y));
|
|
}
|
|
if( activeMaskStackC[1] == true ) {
|
|
R2i.xyz = floatBitsToInt(texture(textureUnitPS0, intBitsToFloat(R2i.xy)).xyz);
|
|
}
|
|
if( activeMaskStackC[1] == true ) {
|
|
// 0
|
|
backupReg0i = R3i.z;
|
|
R3i.x = floatBitsToInt((mul_nonIEEE(intBitsToFloat(R3i.z),intBitsToFloat(R2i.x)) + intBitsToFloat(R4i.x)));
|
|
R3i.y = floatBitsToInt((mul_nonIEEE(intBitsToFloat(R3i.z),intBitsToFloat(R2i.y)) + intBitsToFloat(R4i.y)));
|
|
R3i.z = floatBitsToInt((mul_nonIEEE(intBitsToFloat(backupReg0i),intBitsToFloat(R2i.z)) + intBitsToFloat(R4i.z)));
|
|
// 1
|
|
R2i.xyz = ivec3(R4i.x,R4i.y,R4i.z);
|
|
R2i.w = R4i.w;
|
|
// 2
|
|
backupReg0i = R4i.w;
|
|
R4i.xyz = ivec3(R3i.x,R3i.y,R3i.z);
|
|
R4i.w = backupReg0i;
|
|
}
|
|
}
|
|
if( activeMaskStackC[1] == true ) {
|
|
// 0
|
|
backupReg0i = R0i.x;
|
|
backupReg1i = R0i.y;
|
|
backupReg2i = R0i.z;
|
|
backupReg3i = R0i.w;
|
|
R0i.x = floatBitsToInt(mul_nonIEEE(intBitsToFloat(backupReg0i), intBitsToFloat(R4i.x)));
|
|
R0i.y = floatBitsToInt(mul_nonIEEE(intBitsToFloat(backupReg1i), intBitsToFloat(R4i.y)));
|
|
R0i.z = floatBitsToInt(mul_nonIEEE(intBitsToFloat(backupReg2i), intBitsToFloat(R4i.z)));
|
|
R0i.w = floatBitsToInt(mul_nonIEEE(intBitsToFloat(backupReg3i), intBitsToFloat(R4i.w)));
|
|
}
|
|
// export
|
|
passPixelColor0 = vec4(intBitsToFloat(R0i.x), intBitsToFloat(R0i.y), intBitsToFloat(R0i.z), intBitsToFloat(R0i.w));
|
|
}
|