mirror of
https://github.com/PCSX2/pcsx2.git
synced 2026-10-11 22:49:56 +00:00
GS: Clean trailing whitespace from shaders
This commit is contained in:
committed by
lightningterror
parent
2be7f168ce
commit
95b50e7f81
@@ -271,7 +271,7 @@ void ps_convert_rgb5a1_8i()
|
||||
// 1: 16 R5G2
|
||||
// 2: 16 G2B5A1
|
||||
// 3: 16 G2B5A1
|
||||
|
||||
|
||||
uvec2 pos = uvec2(gl_FragCoord.xy);
|
||||
|
||||
// Collapse separate R G B A areas into their base pixel
|
||||
@@ -279,7 +279,7 @@ void ps_convert_rgb5a1_8i()
|
||||
uvec2 subcolumn = (pos & uvec2(0u, 1u));
|
||||
column.x -= (column.x / 128u) * 64u;
|
||||
column.y += (column.y / 32u) * 32u;
|
||||
|
||||
|
||||
// Deal with swizzling differences
|
||||
if ((PSM & 0x8u) != 0u) // PSMCT16S
|
||||
{
|
||||
@@ -288,18 +288,18 @@ void ps_convert_rgb5a1_8i()
|
||||
column.y += 32u; // 4 columns high times 4 to get bottom 4 blocks
|
||||
column.x &= ~32u;
|
||||
}
|
||||
|
||||
|
||||
if ((pos.x & 64u) != 0u)
|
||||
{
|
||||
column.x -= 32u;
|
||||
}
|
||||
|
||||
|
||||
if (((pos.x & 16u) != 0u) != ((pos.y & 16u) != 0u))
|
||||
{
|
||||
column.x ^= 16u;
|
||||
column.x ^= 16u;
|
||||
column.y ^= 8u;
|
||||
}
|
||||
|
||||
|
||||
if ((PSM & 0x30u) != 0u) // PSMZ16S - Untested but hopefully ok if anything uses it.
|
||||
{
|
||||
column.x ^= 32u;
|
||||
@@ -313,20 +313,20 @@ void ps_convert_rgb5a1_8i()
|
||||
column.y -= 16u;
|
||||
column.x += 32u;
|
||||
}
|
||||
|
||||
|
||||
if ((pos.x & 96u) != 0u)
|
||||
{
|
||||
uint multi = (pos.x & 96u) / 32u;
|
||||
column.y += 16u * multi; // 4 columns high times 4 to get bottom 4 blocks
|
||||
column.x -= (pos.x & 96u);
|
||||
}
|
||||
|
||||
|
||||
if (((pos.x & 16u) != 0u) != ((pos.y & 16u) != 0u))
|
||||
{
|
||||
column.x ^= 16u;
|
||||
column.x ^= 16u;
|
||||
column.y ^= 8u;
|
||||
}
|
||||
|
||||
|
||||
if ((PSM & 0x30u) != 0u) // PSMZ16 - Untested but hopefully ok if anything uses it.
|
||||
{
|
||||
column.x ^= 32u;
|
||||
@@ -334,7 +334,7 @@ void ps_convert_rgb5a1_8i()
|
||||
}
|
||||
}
|
||||
uvec2 coord = column | subcolumn;
|
||||
|
||||
|
||||
// Compensate for potentially differing page pitch.
|
||||
uvec2 block_xy = coord / uvec2(64u, 64u);
|
||||
uint block_num = (block_xy.y * (DBW / 128u)) + block_xy.x;
|
||||
@@ -353,13 +353,13 @@ void ps_convert_rgb5a1_8i()
|
||||
coord *= uvec2(ScaleFactor);
|
||||
|
||||
vec4 pixel = texelFetch(TextureSampler, ivec2(coord), 0);
|
||||
|
||||
|
||||
uvec4 denorm_c = uvec4(pixel * 255.5f);
|
||||
if ((pos.y & 2u) == 0u)
|
||||
{
|
||||
uint red = (denorm_c.r >> 3) & 0x1Fu;
|
||||
uint green = (denorm_c.g >> 3) & 0x1Fu;
|
||||
|
||||
|
||||
SV_Target0 = vec4(float(((green << 5) | red) & 0xFFu) / 255.0f);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -181,10 +181,10 @@ void ps_main4()
|
||||
// compared to the new centre line and the high line (with some threshold of about 25 color steps), then reconstruct.
|
||||
vec3 mhln = hn.rgb - ln.rgb;
|
||||
vec3 mchn = hn.rgb - cn.rgb;
|
||||
|
||||
|
||||
mhln = max(mhln, -mhln) - motion_thr;
|
||||
mchn = max(mchn, -mchn) - motion_thr;
|
||||
|
||||
|
||||
float mhln_max = max(max(mhln.x, mhln.y), mhln.z);
|
||||
float mchn_max = max(max(mchn.x, mchn.y), mchn.z);
|
||||
|
||||
|
||||
@@ -293,7 +293,7 @@ vec3 Bloom(vec2 pos)
|
||||
vec3 e = Horz5(pos, 2.0);
|
||||
|
||||
float wa = BloomScan(pos,-2.0);
|
||||
float wb = BloomScan(pos,-1.0);
|
||||
float wb = BloomScan(pos,-1.0);
|
||||
float wc = BloomScan(pos, 0.0);
|
||||
float wd = BloomScan(pos, 1.0);
|
||||
float we = BloomScan(pos, 2.0);
|
||||
|
||||
@@ -331,8 +331,8 @@ uvec4 sample_4_index(vec4 uv)
|
||||
c.y = sample_c(uv.zy).a;
|
||||
c.z = sample_c(uv.xw).a;
|
||||
c.w = sample_c(uv.zw).a;
|
||||
|
||||
#if PS_RTA_SRC_CORRECTION
|
||||
|
||||
#if PS_RTA_SRC_CORRECTION
|
||||
uvec4 i = uvec4(round(c * 128.25f)); // Denormalize value
|
||||
#else
|
||||
uvec4 i = uvec4(c * 255.5f); // Denormalize value
|
||||
@@ -760,10 +760,10 @@ vec4 ps_color()
|
||||
T.b = float((denorm_c_before.g << 1) & 0xF8u);
|
||||
T.a = float(denorm_c_before.g & 0x80u);
|
||||
#endif
|
||||
|
||||
|
||||
T.a = ((T.a >= 127.5f) ? TA.y : ((PS_AEM == 0 || any(bvec3(ivec3(T.rgb) & ivec3(0xF8)))) ? TA.x : 0.0f)) * 255.0f;
|
||||
#endif
|
||||
|
||||
|
||||
vec4 C = tfx(T, PSin.c);
|
||||
|
||||
fog(C, PSin.t_float.z);
|
||||
@@ -894,7 +894,7 @@ float As = As_rgba.a;
|
||||
RT.a = float(denorm_rt.g & 0x80u);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
// Let the compiler do its jobs !
|
||||
#if PS_COLCLIP_HW == 1
|
||||
vec3 Cd = trunc(RT.rgb * 65535.0f);
|
||||
@@ -1170,7 +1170,7 @@ void ps_main()
|
||||
#elif PS_READ16_SRC
|
||||
uvec4 denorm_c = uvec4(C);
|
||||
uvec2 denorm_TA = uvec2(vec2(TA.xy) * 255.0f + 0.5f);
|
||||
|
||||
|
||||
C.rb = vec2(float((denorm_c.r >> 3) | (((denorm_c.g >> 3) & 0x7u) << 5)));
|
||||
if (bool(denorm_c.a & 0x80u))
|
||||
C.ga = vec2(float((denorm_c.g >> 6) | ((denorm_c.b >> 3) << 2) | (denorm_TA.y & 0x80u)));
|
||||
@@ -1213,7 +1213,7 @@ void ps_main()
|
||||
#else
|
||||
C.rgb = C.rgb / 255.0f;
|
||||
#endif
|
||||
|
||||
|
||||
// Alpha test with feedback
|
||||
#if (PS_AFAIL == AFAIL_FB_ONLY) && NEEDS_DEPTH && PS_ZWRITE
|
||||
if (!atst_pass)
|
||||
@@ -1221,7 +1221,7 @@ void ps_main()
|
||||
#elif (PS_AFAIL == AFAIL_ZB_ONLY) && NEEDS_RT
|
||||
if (!atst_pass)
|
||||
C = sample_from_rt();
|
||||
#elif (PS_AFAIL == AFAIL_RGB_ONLY)
|
||||
#elif (PS_AFAIL == AFAIL_RGB_ONLY)
|
||||
if (!atst_pass)
|
||||
{
|
||||
#if NEEDS_RT
|
||||
|
||||
@@ -347,7 +347,7 @@ void ps_convert_rgb5a1_8i()
|
||||
// 1: 16 R5G2
|
||||
// 2: 16 G2B5A1
|
||||
// 3: 16 G2B5A1
|
||||
|
||||
|
||||
uvec2 pos = uvec2(gl_FragCoord.xy);
|
||||
|
||||
// Collapse separate R G B A areas into their base pixel
|
||||
@@ -355,7 +355,7 @@ void ps_convert_rgb5a1_8i()
|
||||
uvec2 subcolumn = (pos & uvec2(0u, 1u));
|
||||
column.x -= (column.x / 128u) * 64u;
|
||||
column.y += (column.y / 32u) * 32u;
|
||||
|
||||
|
||||
// Deal with swizzling differences
|
||||
if ((PSM & 0x8u) != 0u) // PSMCT16S
|
||||
{
|
||||
@@ -364,18 +364,18 @@ void ps_convert_rgb5a1_8i()
|
||||
column.y += 32u; // 4 columns high times 4 to get bottom 4 blocks
|
||||
column.x &= ~32u;
|
||||
}
|
||||
|
||||
|
||||
if ((pos.x & 64u) != 0u)
|
||||
{
|
||||
column.x -= 32u;
|
||||
}
|
||||
|
||||
|
||||
if (((pos.x & 16u) != 0u) != ((pos.y & 16u) != 0u))
|
||||
{
|
||||
column.x ^= 16u;
|
||||
column.x ^= 16u;
|
||||
column.y ^= 8u;
|
||||
}
|
||||
|
||||
|
||||
if ((PSM & 0x30u) != 0u) // PSMZ16S - Untested but hopefully ok if anything uses it.
|
||||
{
|
||||
column.x ^= 32u;
|
||||
@@ -389,20 +389,20 @@ void ps_convert_rgb5a1_8i()
|
||||
column.y -= 16u;
|
||||
column.x += 32u;
|
||||
}
|
||||
|
||||
|
||||
if ((pos.x & 96u) != 0u)
|
||||
{
|
||||
uint multi = (pos.x & 96u) / 32u;
|
||||
column.y += 16u * multi; // 4 columns high times 4 to get bottom 4 blocks
|
||||
column.x -= (pos.x & 96u);
|
||||
}
|
||||
|
||||
|
||||
if (((pos.x & 16u) != 0u) != ((pos.y & 16u) != 0u))
|
||||
{
|
||||
column.x ^= 16u;
|
||||
column.x ^= 16u;
|
||||
column.y ^= 8u;
|
||||
}
|
||||
|
||||
|
||||
if ((PSM & 0x30u) != 0u) // PSMZ16 - Untested but hopefully ok if anything uses it.
|
||||
{
|
||||
column.x ^= 32u;
|
||||
@@ -410,7 +410,7 @@ void ps_convert_rgb5a1_8i()
|
||||
}
|
||||
}
|
||||
uvec2 coord = column | subcolumn;
|
||||
|
||||
|
||||
// Compensate for potentially differing page pitch.
|
||||
uvec2 block_xy = coord / uvec2(64u, 64u);
|
||||
uint block_num = (block_xy.y * (DBW / 128u)) + block_xy.x;
|
||||
@@ -429,13 +429,13 @@ void ps_convert_rgb5a1_8i()
|
||||
coord *= uvec2(ScaleFactor);
|
||||
|
||||
vec4 pixel = texelFetch(samp0, ivec2(coord), 0);
|
||||
|
||||
|
||||
uvec4 denorm_c = uvec4(pixel * 255.5f);
|
||||
if ((pos.y & 2u) == 0u)
|
||||
{
|
||||
uint red = (denorm_c.r >> 3) & 0x1Fu;
|
||||
uint green = (denorm_c.g >> 3) & 0x1Fu;
|
||||
|
||||
|
||||
o_col0 = vec4(float(((green << 5) | red) & 0xFFu) / 255.0f);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -202,10 +202,10 @@ void ps_main4()
|
||||
// compared to the new centre line and the high line (with some threshold of about 25 color steps), then reconstruct.
|
||||
vec3 mhln = hn.rgb - ln.rgb;
|
||||
vec3 mchn = hn.rgb - cn.rgb;
|
||||
|
||||
|
||||
mhln = max(mhln, -mhln) - motion_thr;
|
||||
mchn = max(mchn, -mchn) - motion_thr;
|
||||
|
||||
|
||||
float mhln_max = max(max(mhln.x, mhln.y), mhln.z);
|
||||
float mchn_max = max(max(mchn.x, mchn.y), mchn.z);
|
||||
|
||||
|
||||
@@ -264,7 +264,7 @@ vec3 Bloom(vec2 pos)
|
||||
vec3 e = Horz5(pos, 2.0);
|
||||
|
||||
float wa = BloomScan(pos,-2.0);
|
||||
float wb = BloomScan(pos,-1.0);
|
||||
float wb = BloomScan(pos,-1.0);
|
||||
float wc = BloomScan(pos, 0.0);
|
||||
float wd = BloomScan(pos, 1.0);
|
||||
float we = BloomScan(pos, 2.0);
|
||||
|
||||
@@ -165,7 +165,7 @@ void main()
|
||||
|
||||
vtx = load_vertex(vid >> 2);
|
||||
|
||||
vtx.p.x += ((vid & 1u) != 0u) ? PointSize.x : 0.0f;
|
||||
vtx.p.x += ((vid & 1u) != 0u) ? PointSize.x : 0.0f;
|
||||
vtx.p.y += ((vid & 2u) != 0u) ? PointSize.y : 0.0f;
|
||||
|
||||
#elif VS_EXPAND == 2 // Line
|
||||
@@ -175,7 +175,7 @@ void main()
|
||||
bool is_bottom = (vid & 2u) != 0u;
|
||||
bool is_right = (vid & 1u) != 0u;
|
||||
uint vid_other = is_bottom ? vid_base - 1 : vid_base + 1;
|
||||
|
||||
|
||||
vtx = load_vertex(vid_base);
|
||||
ProcessedVertex other = load_vertex(vid_other);
|
||||
|
||||
@@ -575,7 +575,7 @@ uvec4 sample_4_index(vec4 uv)
|
||||
c.w = sample_c(uv.zw).a;
|
||||
|
||||
// Denormalize value
|
||||
|
||||
|
||||
#if PS_RTA_SRC_CORRECTION
|
||||
uvec4 i = uvec4(round(c * 128.25f));
|
||||
#else
|
||||
@@ -1010,10 +1010,10 @@ vec4 ps_color()
|
||||
T.b = float((denorm_c_before.g << 1) & 0xF8u);
|
||||
T.a = float(denorm_c_before.g & 0x80u);
|
||||
#endif
|
||||
|
||||
|
||||
T.a = ((T.a >= 127.5f) ? TA.y : ((PS_AEM == 0 || any(bvec3(ivec3(T.rgb) & ivec3(0xF8)))) ? TA.x : 0.0f)) * 255.0f;
|
||||
#endif
|
||||
|
||||
|
||||
vec4 C = tfx(T, vsIn.c);
|
||||
|
||||
C = fog(C, vsIn.t.z);
|
||||
@@ -1045,7 +1045,7 @@ void ps_dither(inout vec3 C, float As)
|
||||
#endif
|
||||
|
||||
float value = DitherMatrix[fpos.y & 3][fpos.x & 3];
|
||||
|
||||
|
||||
// The idea here is we add on the dither amount adjusted by the alpha before it goes to the hw blend
|
||||
// so after the alpha blend the resulting value should be the same as (Cs - Cd) * As + Cd + Dither.
|
||||
#if PS_DITHER_ADJUST
|
||||
@@ -1057,7 +1057,7 @@ void ps_dither(inout vec3 C, float As)
|
||||
|
||||
value *= Alpha > 0.0f ? min(1.0f / Alpha, 1.0f) : 1.0f;
|
||||
#endif
|
||||
|
||||
|
||||
#if PS_ROUND_INV
|
||||
C -= value;
|
||||
#else
|
||||
@@ -1131,7 +1131,7 @@ void ps_blend(inout vec4 Color, inout vec4 As_rgba)
|
||||
#else
|
||||
float Ad = trunc(RT.a * 255.0f + 0.1f) / 128.0f;
|
||||
#endif
|
||||
|
||||
|
||||
#if PS_SHUFFLE && PS_FEEDBACK_LOOP_IS_NEEDED_RT
|
||||
uvec4 denorm_rt = uvec4(RT);
|
||||
#if (PS_PROCESS_BA & SHUFFLE_WRITE)
|
||||
@@ -1472,7 +1472,7 @@ void main()
|
||||
#elif (PS_AFAIL == AFAIL_ZB_ONLY) && PS_FEEDBACK_LOOP_IS_NEEDED_RT
|
||||
if (!atst_pass)
|
||||
o_col0 = sample_from_rt();
|
||||
#elif (PS_AFAIL == AFAIL_RGB_ONLY)
|
||||
#elif (PS_AFAIL == AFAIL_RGB_ONLY)
|
||||
if (!atst_pass)
|
||||
{
|
||||
#if PS_FEEDBACK_LOOP_IS_NEEDED_RT
|
||||
@@ -1488,7 +1488,7 @@ void main()
|
||||
#if PS_ZCLAMP
|
||||
input_z = min(input_z, MaxDepthPS);
|
||||
#endif
|
||||
|
||||
|
||||
#if PS_ZWRITE
|
||||
gl_FragDepth = input_z;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user