Skip to content

Commit cb63269

Browse files
GS: Fix a bunch of compiler warnings.
Type comparisons, unused variables, missing return value.
1 parent 903e859 commit cb63269

File tree

4 files changed

+10
-15
lines changed

4 files changed

+10
-15
lines changed

pcsx2/GS/GSState.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3900,8 +3900,8 @@ GSState::PRIM_OVERLAP GSState::GetPrimitiveOverlapDrawlistImpl(bool save_drawlis
39003900

39013901
// For the end triangle only consider the last edge of the triangle.
39023902
// For the start triangle only consider the first edge of the triangle.
3903-
const u32 base0 = end0 ? 1 : 0;
3904-
const u32 base1 = end1 ? 1 : 0;
3903+
constexpr int base0 = end0 ? 1 : 0;
3904+
constexpr int base1 = end1 ? 1 : 0;
39053905

39063906
for (int i0 = base0; i0 < base0 + 2; i0++)
39073907
{

pcsx2/GS/Renderers/Common/GSDevice.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,6 +1354,7 @@ static const char* GetBlendFactorFormula(GSDevice::BlendFactor blendfactor)
13541354
case GSDevice::CONST_ONE: return "1";
13551355
case GSDevice::CONST_ZERO: return "0";
13561356
}
1357+
return "Unknown";
13571358
}
13581359

13591360
static const char* GetDestinationAlphaModeName(GSHWDrawConfig::DestinationAlphaMode datm)

pcsx2/GS/Renderers/HW/GSRendererHW.cpp

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -335,12 +335,9 @@ GSRendererHW::TextureShuffleInfo GSRendererHW::DetectTextureShuffleImpl()
335335
const GIFRegCLAMP& clamp = m_context->CLAMP;
336336
const GSLocalMemory::psm_t& frame_psm = GSLocalMemory::m_psm[frame.PSM];
337337
const GSLocalMemory::psm_t& tex_psm = GSLocalMemory::m_psm[tex0.PSM];
338-
const float tw = static_cast<float>(1 << tex0.TW);
339-
const float th = static_cast<float>(1 << tex0.TH);
340338

341339
const GSVertex* RESTRICT verts = m_vertex.buff;
342340
const u16* RESTRICT index = m_index.buff;
343-
const GSVector4i xyof = m_context->scissor.xyof.xyxy();
344341
constexpr u32 verts_per_quad = primclass == GS_SPRITE_CLASS ? 2 : 6;
345342
const u32 num_quads = m_index.tail / verts_per_quad;
346343

@@ -436,7 +433,7 @@ GSRendererHW::TextureShuffleInfo GSRendererHW::DetectTextureShuffleImpl()
436433
return false;
437434

438435
// Position and texture coords must be moving in opposite axes to swizzle.
439-
GSVector4i xy_1, uv_1;
436+
GSVector4i xy_1(GSVector4i::zero()), uv_1(GSVector4i::zero());
440437
if (!GetQuadXYUV(first_quad + 1, xy_1, uv_1))
441438
return false;
442439

@@ -447,7 +444,7 @@ GSRendererHW::TextureShuffleInfo GSRendererHW::DetectTextureShuffleImpl()
447444
};
448445

449446
const auto CheckQuadOffsetXU = [&](
450-
u32 offset, const GSVector4i& xy0, const GSVector4i& uv0,
447+
int offset, const GSVector4i& xy0, const GSVector4i& uv0,
451448
const GSVector4i& xy1, const GSVector4i& uv1) {
452449
// Check whether the two quads are offset by the given number of pixels.
453450
return
@@ -456,8 +453,8 @@ GSRendererHW::TextureShuffleInfo GSRendererHW::DetectTextureShuffleImpl()
456453
};
457454

458455
// Checks that the next quad is offset by the specified pixels.
459-
const auto CheckNextQuadOffsetXU = [&](u32 offset) {
460-
GSVector4i xy_1, uv_1;
456+
const auto CheckNextQuadOffsetXU = [&](int offset) {
457+
GSVector4i xy_1(GSVector4i::zero()), uv_1(GSVector4i::zero());
461458
if (!GetQuadXYUV(first_quad + 1, xy_1, uv_1))
462459
return false;
463460

@@ -470,7 +467,7 @@ GSRendererHW::TextureShuffleInfo GSRendererHW::DetectTextureShuffleImpl()
470467
if (!CheckSwizzleShuffle())
471468
return false;
472469

473-
GSVector4i xy_1, uv_1, xy_2, uv_2;
470+
GSVector4i xy_1(GSVector4i::zero()), uv_1(GSVector4i::zero()), xy_2(GSVector4i::zero()), uv_2(GSVector4i::zero());
474471
if (!GetQuadXYUV(first_quad + 1, xy_1, uv_1))
475472
return false;
476473
if (!GetQuadXYUV(first_quad + 2, xy_2, uv_2))
@@ -4395,7 +4392,6 @@ void GSRendererHW::Draw()
43954392
if (m_process_texture)
43964393
{
43974394
GIFRegCLAMP MIP_CLAMP = m_cached_ctx.CLAMP;
4398-
const GSVertex* v = &m_vertex.buff[0];
43994395

44004396
if (rt)
44014397
{
@@ -8675,8 +8671,6 @@ __ri void GSRendererHW::DrawPrims(GSTextureCache::Target* rt, GSTextureCache::Ta
86758671
}
86768672
}
86778673

8678-
const GSDevice::FeatureSupport features = g_gs_device->Features();
8679-
86808674
if (EmulateDATEEarlyFail(date_options, rt))
86818675
return;
86828676

pcsx2/GS/Renderers/HW/GSTextureCache.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3942,7 +3942,7 @@ GSTextureCache::Target* GSTextureCache::LookupDisplayTarget(GIFRegTEX0 TEX0, con
39423942

39433943
std::vector<GSState::GSUploadQueue>::reverse_iterator iter;
39443944
GSVector4i eerect = GSVector4i::zero();
3945-
const int last_draw = GSRendererHW::GetInstance()->m_draw_transfers.back().draw;
3945+
const u64 last_draw = GSRendererHW::GetInstance()->m_draw_transfers.back().draw;
39463946

39473947
for (iter = GSRendererHW::GetInstance()->m_draw_transfers.rbegin(); iter != GSRendererHW::GetInstance()->m_draw_transfers.rend();)
39483948
{
@@ -3955,7 +3955,7 @@ GSTextureCache::Target* GSTextureCache::LookupDisplayTarget(GIFRegTEX0 TEX0, con
39553955
// If the format, and location doesn't overlap
39563956
if (transfer_end >= TEX0.TBP0 && iter->blit.DBP <= rect_end && GSUtil::HasCompatibleBits(iter->blit.DPSM, TEX0.PSM))
39573957
{
3958-
GSVector4i targetr = iter->rect;
3958+
const GSVector4i targetr = iter->rect;
39593959

39603960
if (eerect.rempty())
39613961
eerect = targetr;

0 commit comments

Comments
 (0)