Skip to content

Commit

Permalink
GS/HW: Fix line width factor when upscaling.
Browse files Browse the repository at this point in the history
  • Loading branch information
refractionpcsx2 committed Jun 22, 2024
1 parent 5e9b31d commit a4ffc6c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pcsx2/GS/Renderers/HW/GSRendererHW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4771,8 +4771,11 @@ __ri void GSRendererHW::EmulateTextureSampler(const GSTextureCache::Target* rt,
HandleTextureHazards(rt, ds, tex, tmm, source_region, target_region, unscaled_size, scale, src_copy);

// This is used for reading depth sources, so we should go off the source scale.
float scale_factor = scale;
m_conf.cb_ps.ScaleFactor = GSVector4(scale_factor * (1.0f / 16.0f), 1.0f / scale_factor, scale_factor, 0.0f);
// the Z vector contains line width which will be based on the target draw, where XY are used for source reading.
const float scale_factor = scale;
const float scale_rt = rt ? rt->GetScale() : ds->GetScale();

m_conf.cb_ps.ScaleFactor = GSVector4(scale_factor * (1.0f / 16.0f), 1.0f / scale_factor, scale_rt, 0.0f);

if ((m_conf.ps.tex_is_fb && rt->m_rt_alpha_scale) || (tex->m_target && tex->m_from_target && tex->m_target_direct && tex->m_from_target->m_rt_alpha_scale))
m_conf.ps.rta_source_correction = 1;
Expand Down

0 comments on commit a4ffc6c

Please sign in to comment.