Skip to content

Commit f9af32f

Browse files
committed
GS: Clean trailing whitespace from shaders
1 parent 6c8148e commit f9af32f

File tree

8 files changed

+50
-50
lines changed

8 files changed

+50
-50
lines changed

bin/resources/shaders/opengl/convert.glsl

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -271,15 +271,15 @@ void ps_convert_rgb5a1_8i()
271271
// 1: 16 R5G2
272272
// 2: 16 G2B5A1
273273
// 3: 16 G2B5A1
274-
274+
275275
uvec2 pos = uvec2(gl_FragCoord.xy);
276276

277277
// Collapse separate R G B A areas into their base pixel
278278
uvec2 column = (pos & ~uvec2(0u, 3u)) / uvec2(1u, 2u);
279279
uvec2 subcolumn = (pos & uvec2(0u, 1u));
280280
column.x -= (column.x / 128u) * 64u;
281281
column.y += (column.y / 32u) * 32u;
282-
282+
283283
// Deal with swizzling differences
284284
if ((PSM & 0x8u) != 0u) // PSMCT16S
285285
{
@@ -288,18 +288,18 @@ void ps_convert_rgb5a1_8i()
288288
column.y += 32u; // 4 columns high times 4 to get bottom 4 blocks
289289
column.x &= ~32u;
290290
}
291-
291+
292292
if ((pos.x & 64u) != 0u)
293293
{
294294
column.x -= 32u;
295295
}
296-
296+
297297
if (((pos.x & 16u) != 0u) != ((pos.y & 16u) != 0u))
298298
{
299-
column.x ^= 16u;
299+
column.x ^= 16u;
300300
column.y ^= 8u;
301301
}
302-
302+
303303
if ((PSM & 0x30u) != 0u) // PSMZ16S - Untested but hopefully ok if anything uses it.
304304
{
305305
column.x ^= 32u;
@@ -313,28 +313,28 @@ void ps_convert_rgb5a1_8i()
313313
column.y -= 16u;
314314
column.x += 32u;
315315
}
316-
316+
317317
if ((pos.x & 96u) != 0u)
318318
{
319319
uint multi = (pos.x & 96u) / 32u;
320320
column.y += 16u * multi; // 4 columns high times 4 to get bottom 4 blocks
321321
column.x -= (pos.x & 96u);
322322
}
323-
323+
324324
if (((pos.x & 16u) != 0u) != ((pos.y & 16u) != 0u))
325325
{
326-
column.x ^= 16u;
326+
column.x ^= 16u;
327327
column.y ^= 8u;
328328
}
329-
329+
330330
if ((PSM & 0x30u) != 0u) // PSMZ16 - Untested but hopefully ok if anything uses it.
331331
{
332332
column.x ^= 32u;
333333
column.y ^= 32u;
334334
}
335335
}
336336
uvec2 coord = column | subcolumn;
337-
337+
338338
// Compensate for potentially differing page pitch.
339339
uvec2 block_xy = coord / uvec2(64u, 64u);
340340
uint block_num = (block_xy.y * (DBW / 128u)) + block_xy.x;
@@ -353,13 +353,13 @@ void ps_convert_rgb5a1_8i()
353353
coord *= uvec2(ScaleFactor);
354354

355355
vec4 pixel = texelFetch(TextureSampler, ivec2(coord), 0);
356-
356+
357357
uvec4 denorm_c = uvec4(pixel * 255.5f);
358358
if ((pos.y & 2u) == 0u)
359359
{
360360
uint red = (denorm_c.r >> 3) & 0x1Fu;
361361
uint green = (denorm_c.g >> 3) & 0x1Fu;
362-
362+
363363
SV_Target0 = vec4(float(((green << 5) | red) & 0xFFu) / 255.0f);
364364
}
365365
else

bin/resources/shaders/opengl/interlace.glsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,10 @@ void ps_main4()
181181
// compared to the new centre line and the high line (with some threshold of about 25 color steps), then reconstruct.
182182
vec3 mhln = hn.rgb - ln.rgb;
183183
vec3 mchn = hn.rgb - cn.rgb;
184-
184+
185185
mhln = max(mhln, -mhln) - motion_thr;
186186
mchn = max(mchn, -mchn) - motion_thr;
187-
187+
188188
float mhln_max = max(max(mhln.x, mhln.y), mhln.z);
189189
float mchn_max = max(max(mchn.x, mchn.y), mchn.z);
190190

bin/resources/shaders/opengl/present.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ vec3 Bloom(vec2 pos)
293293
vec3 e = Horz5(pos, 2.0);
294294

295295
float wa = BloomScan(pos,-2.0);
296-
float wb = BloomScan(pos,-1.0);
296+
float wb = BloomScan(pos,-1.0);
297297
float wc = BloomScan(pos, 0.0);
298298
float wd = BloomScan(pos, 1.0);
299299
float we = BloomScan(pos, 2.0);

bin/resources/shaders/opengl/tfx_fs.glsl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,8 @@ uvec4 sample_4_index(vec4 uv)
331331
c.y = sample_c(uv.zy).a;
332332
c.z = sample_c(uv.xw).a;
333333
c.w = sample_c(uv.zw).a;
334-
335-
#if PS_RTA_SRC_CORRECTION
334+
335+
#if PS_RTA_SRC_CORRECTION
336336
uvec4 i = uvec4(round(c * 128.25f)); // Denormalize value
337337
#else
338338
uvec4 i = uvec4(c * 255.5f); // Denormalize value
@@ -760,10 +760,10 @@ vec4 ps_color()
760760
T.b = float((denorm_c_before.g << 1) & 0xF8u);
761761
T.a = float(denorm_c_before.g & 0x80u);
762762
#endif
763-
763+
764764
T.a = ((T.a >= 127.5f) ? TA.y : ((PS_AEM == 0 || any(bvec3(ivec3(T.rgb) & ivec3(0xF8)))) ? TA.x : 0.0f)) * 255.0f;
765765
#endif
766-
766+
767767
vec4 C = tfx(T, PSin.c);
768768

769769
fog(C, PSin.t_float.z);
@@ -894,7 +894,7 @@ float As = As_rgba.a;
894894
RT.a = float(denorm_rt.g & 0x80u);
895895
#endif
896896
#endif
897-
897+
898898
// Let the compiler do its jobs !
899899
#if PS_COLCLIP_HW == 1
900900
vec3 Cd = trunc(RT.rgb * 65535.0f);
@@ -1170,7 +1170,7 @@ void ps_main()
11701170
#elif PS_READ16_SRC
11711171
uvec4 denorm_c = uvec4(C);
11721172
uvec2 denorm_TA = uvec2(vec2(TA.xy) * 255.0f + 0.5f);
1173-
1173+
11741174
C.rb = vec2(float((denorm_c.r >> 3) | (((denorm_c.g >> 3) & 0x7u) << 5)));
11751175
if (bool(denorm_c.a & 0x80u))
11761176
C.ga = vec2(float((denorm_c.g >> 6) | ((denorm_c.b >> 3) << 2) | (denorm_TA.y & 0x80u)));
@@ -1213,15 +1213,15 @@ void ps_main()
12131213
#else
12141214
C.rgb = C.rgb / 255.0f;
12151215
#endif
1216-
1216+
12171217
// Alpha test with feedback
12181218
#if (PS_AFAIL == AFAIL_FB_ONLY) && NEEDS_DEPTH && PS_ZWRITE
12191219
if (!atst_pass)
12201220
input_z = sample_from_depth().r;
12211221
#elif (PS_AFAIL == AFAIL_ZB_ONLY) && NEEDS_RT
12221222
if (!atst_pass)
12231223
C = sample_from_rt();
1224-
#elif (PS_AFAIL == AFAIL_RGB_ONLY)
1224+
#elif (PS_AFAIL == AFAIL_RGB_ONLY)
12251225
if (!atst_pass)
12261226
{
12271227
#if NEEDS_RT

bin/resources/shaders/vulkan/convert.glsl

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -347,15 +347,15 @@ void ps_convert_rgb5a1_8i()
347347
// 1: 16 R5G2
348348
// 2: 16 G2B5A1
349349
// 3: 16 G2B5A1
350-
350+
351351
uvec2 pos = uvec2(gl_FragCoord.xy);
352352

353353
// Collapse separate R G B A areas into their base pixel
354354
uvec2 column = (pos & ~uvec2(0u, 3u)) / uvec2(1u, 2u);
355355
uvec2 subcolumn = (pos & uvec2(0u, 1u));
356356
column.x -= (column.x / 128u) * 64u;
357357
column.y += (column.y / 32u) * 32u;
358-
358+
359359
// Deal with swizzling differences
360360
if ((PSM & 0x8u) != 0u) // PSMCT16S
361361
{
@@ -364,18 +364,18 @@ void ps_convert_rgb5a1_8i()
364364
column.y += 32u; // 4 columns high times 4 to get bottom 4 blocks
365365
column.x &= ~32u;
366366
}
367-
367+
368368
if ((pos.x & 64u) != 0u)
369369
{
370370
column.x -= 32u;
371371
}
372-
372+
373373
if (((pos.x & 16u) != 0u) != ((pos.y & 16u) != 0u))
374374
{
375-
column.x ^= 16u;
375+
column.x ^= 16u;
376376
column.y ^= 8u;
377377
}
378-
378+
379379
if ((PSM & 0x30u) != 0u) // PSMZ16S - Untested but hopefully ok if anything uses it.
380380
{
381381
column.x ^= 32u;
@@ -389,28 +389,28 @@ void ps_convert_rgb5a1_8i()
389389
column.y -= 16u;
390390
column.x += 32u;
391391
}
392-
392+
393393
if ((pos.x & 96u) != 0u)
394394
{
395395
uint multi = (pos.x & 96u) / 32u;
396396
column.y += 16u * multi; // 4 columns high times 4 to get bottom 4 blocks
397397
column.x -= (pos.x & 96u);
398398
}
399-
399+
400400
if (((pos.x & 16u) != 0u) != ((pos.y & 16u) != 0u))
401401
{
402-
column.x ^= 16u;
402+
column.x ^= 16u;
403403
column.y ^= 8u;
404404
}
405-
405+
406406
if ((PSM & 0x30u) != 0u) // PSMZ16 - Untested but hopefully ok if anything uses it.
407407
{
408408
column.x ^= 32u;
409409
column.y ^= 32u;
410410
}
411411
}
412412
uvec2 coord = column | subcolumn;
413-
413+
414414
// Compensate for potentially differing page pitch.
415415
uvec2 block_xy = coord / uvec2(64u, 64u);
416416
uint block_num = (block_xy.y * (DBW / 128u)) + block_xy.x;
@@ -429,13 +429,13 @@ void ps_convert_rgb5a1_8i()
429429
coord *= uvec2(ScaleFactor);
430430

431431
vec4 pixel = texelFetch(samp0, ivec2(coord), 0);
432-
432+
433433
uvec4 denorm_c = uvec4(pixel * 255.5f);
434434
if ((pos.y & 2u) == 0u)
435435
{
436436
uint red = (denorm_c.r >> 3) & 0x1Fu;
437437
uint green = (denorm_c.g >> 3) & 0x1Fu;
438-
438+
439439
o_col0 = vec4(float(((green << 5) | red) & 0xFFu) / 255.0f);
440440
}
441441
else

bin/resources/shaders/vulkan/interlace.glsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,10 @@ void ps_main4()
202202
// compared to the new centre line and the high line (with some threshold of about 25 color steps), then reconstruct.
203203
vec3 mhln = hn.rgb - ln.rgb;
204204
vec3 mchn = hn.rgb - cn.rgb;
205-
205+
206206
mhln = max(mhln, -mhln) - motion_thr;
207207
mchn = max(mchn, -mchn) - motion_thr;
208-
208+
209209
float mhln_max = max(max(mhln.x, mhln.y), mhln.z);
210210
float mchn_max = max(max(mchn.x, mchn.y), mchn.z);
211211

bin/resources/shaders/vulkan/present.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ vec3 Bloom(vec2 pos)
264264
vec3 e = Horz5(pos, 2.0);
265265

266266
float wa = BloomScan(pos,-2.0);
267-
float wb = BloomScan(pos,-1.0);
267+
float wb = BloomScan(pos,-1.0);
268268
float wc = BloomScan(pos, 0.0);
269269
float wd = BloomScan(pos, 1.0);
270270
float we = BloomScan(pos, 2.0);

bin/resources/shaders/vulkan/tfx.glsl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ void main()
165165

166166
vtx = load_vertex(vid >> 2);
167167

168-
vtx.p.x += ((vid & 1u) != 0u) ? PointSize.x : 0.0f;
168+
vtx.p.x += ((vid & 1u) != 0u) ? PointSize.x : 0.0f;
169169
vtx.p.y += ((vid & 2u) != 0u) ? PointSize.y : 0.0f;
170170

171171
#elif VS_EXPAND == 2 // Line
@@ -175,7 +175,7 @@ void main()
175175
bool is_bottom = (vid & 2u) != 0u;
176176
bool is_right = (vid & 1u) != 0u;
177177
uint vid_other = is_bottom ? vid_base - 1 : vid_base + 1;
178-
178+
179179
vtx = load_vertex(vid_base);
180180
ProcessedVertex other = load_vertex(vid_other);
181181

@@ -575,7 +575,7 @@ uvec4 sample_4_index(vec4 uv)
575575
c.w = sample_c(uv.zw).a;
576576

577577
// Denormalize value
578-
578+
579579
#if PS_RTA_SRC_CORRECTION
580580
uvec4 i = uvec4(round(c * 128.25f));
581581
#else
@@ -1010,10 +1010,10 @@ vec4 ps_color()
10101010
T.b = float((denorm_c_before.g << 1) & 0xF8u);
10111011
T.a = float(denorm_c_before.g & 0x80u);
10121012
#endif
1013-
1013+
10141014
T.a = ((T.a >= 127.5f) ? TA.y : ((PS_AEM == 0 || any(bvec3(ivec3(T.rgb) & ivec3(0xF8)))) ? TA.x : 0.0f)) * 255.0f;
10151015
#endif
1016-
1016+
10171017
vec4 C = tfx(T, vsIn.c);
10181018

10191019
C = fog(C, vsIn.t.z);
@@ -1045,7 +1045,7 @@ void ps_dither(inout vec3 C, float As)
10451045
#endif
10461046

10471047
float value = DitherMatrix[fpos.y & 3][fpos.x & 3];
1048-
1048+
10491049
// The idea here is we add on the dither amount adjusted by the alpha before it goes to the hw blend
10501050
// so after the alpha blend the resulting value should be the same as (Cs - Cd) * As + Cd + Dither.
10511051
#if PS_DITHER_ADJUST
@@ -1057,7 +1057,7 @@ void ps_dither(inout vec3 C, float As)
10571057

10581058
value *= Alpha > 0.0f ? min(1.0f / Alpha, 1.0f) : 1.0f;
10591059
#endif
1060-
1060+
10611061
#if PS_ROUND_INV
10621062
C -= value;
10631063
#else
@@ -1131,7 +1131,7 @@ void ps_blend(inout vec4 Color, inout vec4 As_rgba)
11311131
#else
11321132
float Ad = trunc(RT.a * 255.0f + 0.1f) / 128.0f;
11331133
#endif
1134-
1134+
11351135
#if PS_SHUFFLE && PS_FEEDBACK_LOOP_IS_NEEDED_RT
11361136
uvec4 denorm_rt = uvec4(RT);
11371137
#if (PS_PROCESS_BA & SHUFFLE_WRITE)
@@ -1472,7 +1472,7 @@ void main()
14721472
#elif (PS_AFAIL == AFAIL_ZB_ONLY) && PS_FEEDBACK_LOOP_IS_NEEDED_RT
14731473
if (!atst_pass)
14741474
o_col0 = sample_from_rt();
1475-
#elif (PS_AFAIL == AFAIL_RGB_ONLY)
1475+
#elif (PS_AFAIL == AFAIL_RGB_ONLY)
14761476
if (!atst_pass)
14771477
{
14781478
#if PS_FEEDBACK_LOOP_IS_NEEDED_RT
@@ -1488,7 +1488,7 @@ void main()
14881488
#if PS_ZCLAMP
14891489
input_z = min(input_z, MaxDepthPS);
14901490
#endif
1491-
1491+
14921492
#if PS_ZWRITE
14931493
gl_FragDepth = input_z;
14941494
#endif

0 commit comments

Comments
 (0)