gsdx:hw: Move TC offset variables to GSRendererHW

Also rename them for consistency.
This commit is contained in:
Jonathan Li 2018-09-10 17:22:27 +01:00
parent 728fa2c1a4
commit 2f5ba10e6b
6 changed files with 14 additions and 19 deletions

View File

@ -33,17 +33,12 @@ GSRendererDX::GSRendererDX(GSTextureCache* tc, const GSVector2& pixelcenter)
if (theApp.GetConfigB("UserHacks")) {
UserHacks_AlphaHack = theApp.GetConfigB("UserHacks_AlphaHack");
UserHacks_AlphaStencil = theApp.GetConfigB("UserHacks_AlphaStencil");
UserHacks_TCOffset = theApp.GetConfigI("UserHacks_TCOffset");
UserHacks_HPO = theApp.GetConfigI("UserHacks_HalfPixelOffset");
} else {
UserHacks_AlphaHack = false;
UserHacks_AlphaStencil = false;
UserHacks_TCOffset = 0;
UserHacks_HPO = 0;
}
UserHacks_TCO_x = (UserHacks_TCOffset & 0xFFFF) / -1000.0f;
UserHacks_TCO_y = ((UserHacks_TCOffset >> 16) & 0xFFFF) / -1000.0f;
}
GSRendererDX::~GSRendererDX()
@ -320,8 +315,8 @@ void GSRendererDX::EmulateTextureSampler(const GSTextureCache::Source* tex)
}
// TC Offset Hack
m_ps_sel.tcoffsethack = !!UserHacks_TCOffset;
ps_cb.TC_OffsetHack = GSVector4(UserHacks_TCO_x, UserHacks_TCO_y).xyxy() / WH.xyxy();
m_ps_sel.tcoffsethack = !!m_userhacks_tcoffset;
ps_cb.TC_OffsetHack = GSVector4(m_userhacks_tcoffset_x, m_userhacks_tcoffset_y).xyxy() / WH.xyxy();
// Only enable clamping in CLAMP mode. REGION_CLAMP will be done manually in the shader
m_ps_ssel.tau = (wms != CLAMP_CLAMP);

View File

@ -44,8 +44,6 @@ protected:
virtual void SetupIA(const float& sx, const float& sy) = 0;
virtual void UpdateFBA(GSTexture* rt) {}
unsigned int UserHacks_TCOffset;
float UserHacks_TCO_x, UserHacks_TCO_y;
int UserHacks_HPO;
bool DATE;

View File

@ -30,6 +30,9 @@ GSRendererHW::GSRendererHW(GSTextureCache* tc)
, m_reset(false)
, m_upscale_multiplier(1)
, m_tc(tc)
, m_userhacks_tcoffset(0)
, m_userhacks_tcoffset_x(0)
, m_userhacks_tcoffset_y(0)
, m_channel_shuffle(false)
, m_lod(GSVector2i(0,0))
{
@ -42,6 +45,9 @@ GSRendererHW::GSRendererHW(GSTextureCache* tc)
m_userhacks_disable_gs_mem_clear = theApp.GetConfigB("UserHacks_DisableGsMemClear");
m_userHacks_HPO = theApp.GetConfigI("UserHacks_HalfPixelOffset");
m_userHacks_merge_sprite = theApp.GetConfigB("UserHacks_merge_pp_sprite");
m_userhacks_tcoffset = theApp.GetConfigI("UserHacks_TCOffset");
m_userhacks_tcoffset_x = (m_userhacks_tcoffset & 0xFFFF) / -1000.0f;
m_userhacks_tcoffset_y = ((m_userhacks_tcoffset >> 16) & 0xFFFF) / -1000.0f;
} else {
m_userhacks_align_sprite_X = false;
m_userhacks_round_sprite_offset = 0;

View File

@ -150,6 +150,10 @@ protected:
int m_userhacks_round_sprite_offset;
int m_userHacks_HPO;
unsigned int m_userhacks_tcoffset;
float m_userhacks_tcoffset_x;
float m_userhacks_tcoffset_y;
bool m_channel_shuffle;
GSVector2i m_lod; // Min & Max level of detail

View File

@ -34,9 +34,6 @@ GSRendererOGL::GSRendererOGL()
// Hope nothing requires too many draw calls.
m_drawlist.reserve(2048);
UserHacks_TCOffset = theApp.GetConfigI("UserHacks_TCOffset");
UserHacks_TCO_x = (UserHacks_TCOffset & 0xFFFF) / -1000.0f;
UserHacks_TCO_y = ((UserHacks_TCOffset >> 16) & 0xFFFF) / -1000.0f;
UserHacks_unscale_pt_ln = theApp.GetConfigB("UserHacks_unscale_point_line");
UserHacks_HPO = theApp.GetConfigI("UserHacks_HalfPixelOffset");
UserHacks_tri_filter = static_cast<TriFiltering>(theApp.GetConfigI("UserHacks_TriFilter"));
@ -45,9 +42,6 @@ GSRendererOGL::GSRendererOGL()
ResetStates();
if (!theApp.GetConfigB("UserHacks")) {
UserHacks_TCOffset = 0;
UserHacks_TCO_x = 0;
UserHacks_TCO_y = 0;
UserHacks_unscale_pt_ln = false;
UserHacks_HPO = 0;
UserHacks_tri_filter = TriFiltering::None;
@ -844,8 +838,8 @@ void GSRendererOGL::EmulateTextureSampler(const GSTextureCache::Source* tex)
}
// TC Offset Hack
m_ps_sel.tcoffsethack = !!UserHacks_TCOffset;
ps_cb.TC_OH_TS = GSVector4(1/16.0f, 1/16.0f, UserHacks_TCO_x, UserHacks_TCO_y) / WH.xyxy();
m_ps_sel.tcoffsethack = !!m_userhacks_tcoffset;
ps_cb.TC_OH_TS = GSVector4(1/16.0f, 1/16.0f, m_userhacks_tcoffset_x, m_userhacks_tcoffset_y) / WH.xyxy();
// Only enable clamping in CLAMP mode. REGION_CLAMP will be done manually in the shader

View File

@ -50,8 +50,6 @@ class GSRendererOGL final : public GSRendererHW
PRIM_OVERLAP m_prim_overlap;
std::vector<size_t> m_drawlist;
unsigned int UserHacks_TCOffset;
float UserHacks_TCO_x, UserHacks_TCO_y;
bool UserHacks_unscale_pt_ln;
int UserHacks_HPO;
TriFiltering UserHacks_tri_filter;