GS interlace: Fix Wreturn-type, Wunused-variable, Wsometimes-uninitialized warnings.

This commit is contained in:
lightningterror 2022-11-19 09:48:22 +01:00
parent bfcd5c84ca
commit 0988b08f7a
4 changed files with 18 additions and 27 deletions

View File

@ -89,7 +89,6 @@ float4 ps_main4(PS_INPUT input) : SV_Target0
// field.
const int idx = int(ZrH.x); // buffer index passed from CPU
const int bank = idx >> 1; // current bank
const int field = idx & 1; // current field
const int vpos = int(input.p.y); // vertical position of destination texture
const float sensitivity = ZrH.w; // passed from CPU, higher values mean more likely to use weave
@ -106,12 +105,6 @@ float4 ps_main4(PS_INPUT input) : SV_Target0
switch (idx)
{
case 0:
p_t0 = iptr;
p_t1 = iptr + bofs;
p_t2 = iptr + bofs;
p_t3 = iptr;
break;
case 1:
p_t0 = iptr;
p_t1 = iptr;
@ -131,6 +124,10 @@ float4 ps_main4(PS_INPUT input) : SV_Target0
p_t3 = iptr;
break;
default:
p_t0 = iptr;
p_t1 = iptr + bofs;
p_t2 = iptr + bofs;
p_t3 = iptr;
break;
}

View File

@ -80,7 +80,6 @@ void ps_main4()
// we use the contents of the MAD frame buffer to reconstruct the missing lines from the current field.
const int idx = int(ZrH.x); // buffer index passed from CPU
const int bank = idx >> 1; // current bank
const int field = idx & 1; // current field
const int vpos = int(gl_FragCoord.y); // vertical position of destination texture
const float sensitivity = ZrH.w; // passed from CPU, higher values mean more likely to use weave
@ -97,12 +96,6 @@ void ps_main4()
switch (idx)
{
case 0:
p_t0 = iptr;
p_t1 = iptr + bofs;
p_t2 = iptr + bofs;
p_t3 = iptr;
break;
case 1:
p_t0 = iptr;
p_t1 = iptr;
@ -122,6 +115,10 @@ void ps_main4()
p_t3 = iptr;
break;
default:
p_t0 = iptr;
p_t1 = iptr + bofs;
p_t2 = iptr + bofs;
p_t3 = iptr;
break;
}

View File

@ -122,12 +122,6 @@ void ps_main4()
switch (idx)
{
case 0:
p_t0 = iptr;
p_t1 = iptr + bofs;
p_t2 = iptr + bofs;
p_t3 = iptr;
break;
case 1:
p_t0 = iptr;
p_t1 = iptr;
@ -147,6 +141,10 @@ void ps_main4()
p_t3 = iptr;
break;
default:
p_t0 = iptr;
p_t1 = iptr + bofs;
p_t2 = iptr + bofs;
p_t3 = iptr;
break;
}

View File

@ -30,6 +30,8 @@ fragment float4 ps_interlace0(ConvertShaderData data [[stage_in]], ConvertPSRes
return res.sample(data.t);
else
discard_fragment();
return float4(0.0f, 0.0f, 0.0f, 0.0f);
}
@ -90,7 +92,6 @@ fragment float4 ps_interlace4(ConvertShaderData data [[stage_in]], ConvertPSRes
constant GSMTLInterlacePSUniform& uniform [[buffer(GSMTLBufferIndexUniforms)]])
{
const int idx = int(uniform.ZrH.x); // buffer index passed from CPU
const int bank = idx >> 1; // current bank
const int field = idx & 1; // current field
const int vpos = int(data.p.y); // vertical position of destination texture
const float sensitivity = uniform.ZrH.w; // passed from CPU, higher values mean more likely to use weave
@ -108,12 +109,6 @@ fragment float4 ps_interlace4(ConvertShaderData data [[stage_in]], ConvertPSRes
switch (idx)
{
case 0:
p_t0 = iptr;
p_t1 = iptr + bofs;
p_t2 = iptr + bofs;
p_t3 = iptr;
break;
case 1:
p_t0 = iptr;
p_t1 = iptr;
@ -133,6 +128,10 @@ fragment float4 ps_interlace4(ConvertShaderData data [[stage_in]], ConvertPSRes
p_t3 = iptr;
break;
default:
p_t0 = iptr;
p_t1 = iptr + bofs;
p_t2 = iptr + bofs;
p_t3 = iptr;
break;
}