Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DrLuigi] Fix undefined shader behavior, merge AA mod into graphics mod #664

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
6 changes: 0 additions & 6 deletions Enhancements/DrLuigi_!AntiAliasing/rules.txt

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#version 420
#version 430
#extension GL_ARB_texture_gather : enable
#extension GL_ARB_separate_shader_objects : enable
#ifdef VULKAN
Expand Down Expand Up @@ -29,6 +29,10 @@ uniform vec4 uf_fragCoordScale;
uniform float uf_alphaTestRef;
uniform vec2 uf_fragCoordScale;
#endif

#define AAENABLE $AAEnable


TEXTURE_LAYOUT(0, 1, 0) uniform sampler2D textureUnitPS0;
layout(location = 0) in vec4 passParameterSem129;
layout(location = 1) in vec4 passParameterSem128;
Expand Down Expand Up @@ -68,22 +72,34 @@ ivec4 ARi = ivec4(0);
bool predResult = true;
vec3 cubeMapSTM;
int cubeMapFaceId;
R0i = floatBitsToInt(passParameterSem129);
#if (AAENABLE == 1)
R0i = floatBitsToInt(passParameterSem129);
#endif
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);
#if (AAENABLE == 1)
ivec2 resolution = textureSize(textureUnitPS0,0);
float iresX = float(resolution.x)/float(1280);
float iresY = float(resolution.y)/float(720);
#endif

// 0
backupReg0i = R0i.y;
backupReg1i = R0i.x;
PV0i.x = 0;
PV0i.y = floatBitsToInt(intBitsToFloat(backupReg0i) / iresY);
#if (AAENABLE == 1)
PV0i.y = floatBitsToInt(intBitsToFloat(backupReg0i) / iresY);
#else
PV0i.y = floatBitsToInt(intBitsToFloat(backupReg0i) * 1.0);
#endif
PV0i.z = 0;
R127i.w = floatBitsToInt(intBitsToFloat(backupReg1i) / iresX);
#if (AAENABLE == 1)
R127i.w = floatBitsToInt(intBitsToFloat(backupReg1i) / iresX);
#else
R127i.w = floatBitsToInt(intBitsToFloat(backupReg1i) * 1.0);
#endif
PV0i.w = R127i.w;
R8i.w = 0x3f800000;
PS0i = R8i.w;
Expand Down
Loading