Skip to content

Commit 4a59a80

Browse files
GS: Cleanup some casts, nullptr check, compare warning.
1 parent 501088b commit 4a59a80

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pcsx2/GS/GSState.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1874,7 +1874,7 @@ void GSState::CheckWriteOverlap(bool req_write, bool req_read)
18741874
// Tex rect could be invalid showing 1024x1024 when it isn't. If the frame is only 1 page wide, it's either a big strip or a single page draw.
18751875
// This large texture causes misdetection of overlapping writes, causing our heuristics in the hardware renderer for future draws to be missing.
18761876
// Either way if we check the queued up coordinates, it should give us a fair idea. (Cabela's Trophy Bucks)
1877-
if (prev_ctx.FRAME.FBW == 1 && tex_rect.width() > (prev_ctx.TEX0.TBW * 64))
1877+
if (prev_ctx.FRAME.FBW == 1 && static_cast<u32>(tex_rect.width()) > (prev_ctx.TEX0.TBW * 64))
18781878
{
18791879
GSVector4i tex_draw_rect = GSVector4i::zero();
18801880
for (u32 i = 0; i < m_index.tail; i++)

pcsx2/GS/Renderers/DX11/GSDevice11.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2712,20 +2712,20 @@ void GSDevice11::RenderHW(GSHWDrawConfig& config)
27122712
// Make sure no tex is bound as both rtv and srv at the same time.
27132713
// All conflicts should've been taken care of by PSUnbindConflictingSRVs.
27142714
// It is fine to do the optimiation when on slot 0 tex is fb, tex is ds, and slot 2 sw blend as they are copies bound to srv.
2715-
if (!draw_rt && draw_ds && m_state.rt_view && m_state.cached_rt_view && m_state.rt_view == *(GSTexture11*)m_state.cached_rt_view &&
2715+
if (!draw_rt && draw_ds && m_state.rt_view && m_state.cached_rt_view && m_state.rt_view == *static_cast<GSTexture11*>(m_state.cached_rt_view) &&
27162716
m_state.cached_dsv == draw_ds && config.tex != m_state.cached_rt_view && m_state.cached_rt_view->GetSize() == draw_ds->GetSize())
27172717
{
27182718
draw_rt = m_state.cached_rt_view;
27192719
}
2720-
else if (!draw_ds && draw_rt && m_state.dsv && m_state.cached_dsv && m_state.dsv == *(GSTexture11*)m_state.cached_dsv &&
2720+
else if (!draw_ds && draw_rt && m_state.dsv && m_state.cached_dsv && m_state.dsv == *static_cast<GSTexture11*>(m_state.cached_dsv) &&
27212721
m_state.cached_rt_view == draw_rt && config.tex != m_state.cached_dsv && m_state.cached_dsv->GetSize() == draw_rt->GetSize())
27222722
{
27232723
draw_ds = m_state.cached_dsv;
27242724
}
27252725

27262726
GSTexture* draw_rt_clone = nullptr;
27272727

2728-
if (config.require_one_barrier || (config.require_full_barrier && m_features.multidraw_fb_copy) || (config.tex && config.tex == config.rt))
2728+
if (draw_rt && (config.require_one_barrier || (config.require_full_barrier && m_features.multidraw_fb_copy) || (config.tex && config.tex == config.rt)))
27292729
{
27302730
// Requires a copy of the RT.
27312731
// Used as "bind rt" flag when texture barrier is unsupported for tex is fb.

0 commit comments

Comments
 (0)