mirror of https://github.com/PCSX2/pcsx2.git
GSdx:
- Allow filtering setting for native resolution hardware rendering, as it's not tied to the resolution. - Add ST / UV coordinate tweaking defines to more easily debug small rendering glitches. - Add a define to bypass the hardware renderer texture cache. With this enabled, speed drops to slower than software rendering. It fixes nearly all hardware rendering issues though and can be used to see how games *would* look if we had a new cache ;) Thanks for the help, sudonim :) git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4635 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
cae7e38848
commit
5785ba7914
|
@ -556,7 +556,9 @@ protected:
|
|||
|
||||
void Draw()
|
||||
{
|
||||
#ifndef HW_NO_TEXTURE_CACHE
|
||||
if(IsBadFrame(m_skip, m_userhacks_skipdraw)) return;
|
||||
#endif
|
||||
|
||||
GSDrawingEnvironment& env = m_env;
|
||||
GSDrawingContext* context = m_context;
|
||||
|
@ -715,6 +717,9 @@ protected:
|
|||
|
||||
s_n++;
|
||||
}
|
||||
#ifdef HW_NO_TEXTURE_CACHE
|
||||
m_tc->Read(rt, r);
|
||||
#endif
|
||||
}
|
||||
|
||||
virtual void Draw(GSTexture* rt, GSTexture* ds, GSTextureCache::Source* tex) = 0;
|
||||
|
@ -748,11 +753,7 @@ public:
|
|||
m_upscale_multiplier = theApp.GetConfig("upscale_multiplier", 1);
|
||||
m_userhacks_skipdraw = theApp.GetConfig("UserHacks_SkipDraw", 0);
|
||||
|
||||
if(m_nativeres)
|
||||
{
|
||||
m_filter = 2;
|
||||
}
|
||||
else
|
||||
if(!m_nativeres)
|
||||
{
|
||||
m_width = theApp.GetConfig("resx", m_width);
|
||||
m_height = theApp.GetConfig("resy", m_height);
|
||||
|
|
|
@ -309,7 +309,7 @@ void GSSettingsDlg::UpdateControls()
|
|||
EnableWindow(GetDlgItem(m_hWnd, IDC_RESY_EDIT), hw && !native && scaling == 1);
|
||||
EnableWindow(GetDlgItem(m_hWnd, IDC_UPSCALE_MULTIPLIER), hw && !native);
|
||||
EnableWindow(GetDlgItem(m_hWnd, IDC_NATIVERES), hw);
|
||||
EnableWindow(GetDlgItem(m_hWnd, IDC_FILTER), hw && !native);
|
||||
EnableWindow(GetDlgItem(m_hWnd, IDC_FILTER), hw);
|
||||
EnableWindow(GetDlgItem(m_hWnd, IDC_PALTEX), hw);
|
||||
EnableWindow(GetDlgItem(m_hWnd, IDC_LOGZ), dx9 && hw && GSDevice9::GetMaxDepth(m_lastValidMsaa) < 32);
|
||||
EnableWindow(GetDlgItem(m_hWnd, IDC_FBA), dx9 && hw);
|
||||
|
|
|
@ -25,6 +25,10 @@
|
|||
//#define DISABLE_BITMASKING
|
||||
//#define DISABLE_COLCLAMP
|
||||
//#define DISABLE_DATE
|
||||
//see stdafx.h for #define HW_NO_TEXTURE_CACHE
|
||||
|
||||
//#define Offset_ST // Fixes Persona3 mini map alignment which is off even in software rendering
|
||||
//#define Offset_UV // Fixes / breaks various titles
|
||||
|
||||
GSState::GSState()
|
||||
: m_version(6)
|
||||
|
@ -431,6 +435,12 @@ __forceinline void GSState::GIFPackedRegHandlerSTQ(const GIFPackedReg* r)
|
|||
#endif
|
||||
|
||||
m_q = r->STQ.Q;
|
||||
|
||||
#ifdef Offset_ST
|
||||
GIFRegTEX0 TEX0 = m_context->TEX0;
|
||||
m_v.ST.S -= 0.02f * m_q / (1 << TEX0.TW);
|
||||
m_v.ST.T -= 0.02f * m_q / (1 << TEX0.TH);
|
||||
#endif
|
||||
}
|
||||
|
||||
__forceinline void GSState::GIFPackedRegHandlerUV(const GIFPackedReg* r)
|
||||
|
@ -446,6 +456,11 @@ __forceinline void GSState::GIFPackedRegHandlerUV(const GIFPackedReg* r)
|
|||
m_v.UV.V = r->UV.V;
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef Offset_UV
|
||||
m_v.UV.U = min((uint16)m_v.UV.U, (uint16)(m_v.UV.U - 4U));
|
||||
m_v.UV.V = min((uint16)m_v.UV.V, (uint16)(m_v.UV.V - 4U));
|
||||
#endif
|
||||
}
|
||||
|
||||
__forceinline void GSState::GIFPackedRegHandlerXYZF2(const GIFPackedReg* r)
|
||||
|
@ -529,11 +544,22 @@ __forceinline void GSState::GIFRegHandlerRGBAQ(const GIFReg* r)
|
|||
__forceinline void GSState::GIFRegHandlerST(const GIFReg* r)
|
||||
{
|
||||
m_v.ST = (GSVector4i)r->ST;
|
||||
|
||||
#ifdef Offset_ST
|
||||
GIFRegTEX0 TEX0 = m_context->TEX0;
|
||||
m_v.ST.S -= 0.02f * m_q / (1 << TEX0.TW);
|
||||
m_v.ST.T -= 0.02f * m_q / (1 << TEX0.TH);
|
||||
#endif
|
||||
}
|
||||
|
||||
__forceinline void GSState::GIFRegHandlerUV(const GIFReg* r)
|
||||
{
|
||||
m_v.UV.u32[0] = r->UV.u32[0] & 0x3fff3fff;
|
||||
|
||||
#ifdef Offset_UV
|
||||
m_v.UV.U = min((uint16)m_v.UV.U, (uint16)(m_v.UV.U - 4U));
|
||||
m_v.UV.V = min((uint16)m_v.UV.V, (uint16)(m_v.UV.V - 4U));
|
||||
#endif
|
||||
}
|
||||
|
||||
void GSState::GIFRegHandlerXYZF2(const GIFReg* r)
|
||||
|
|
|
@ -88,7 +88,11 @@ GSTextureCache::Source* GSTextureCache::LookupSource(const GIFRegTEX0& TEX0, con
|
|||
|
||||
Target* dst = NULL;
|
||||
|
||||
#ifdef HW_NO_TEXTURE_CACHE
|
||||
if( 0 )
|
||||
#else
|
||||
if(src == NULL)
|
||||
#endif
|
||||
{
|
||||
uint32 bp = TEX0.TBP0;
|
||||
uint32 psm = TEX0.PSM;
|
||||
|
|
|
@ -127,12 +127,16 @@ protected:
|
|||
|
||||
// TODO: virtual void Write(Source* s, const GSVector4i& r) = 0;
|
||||
// TODO: virtual void Write(Target* t, const GSVector4i& r) = 0;
|
||||
#ifndef HW_NO_TEXTURE_CACHE
|
||||
virtual void Read(Target* t, const GSVector4i& r) = 0;
|
||||
#endif
|
||||
|
||||
public:
|
||||
GSTextureCache(GSRenderer* r);
|
||||
virtual ~GSTextureCache();
|
||||
|
||||
#ifdef HW_NO_TEXTURE_CACHE
|
||||
virtual void Read(Target* t, const GSVector4i& r) = 0;
|
||||
#endif
|
||||
void RemoveAll();
|
||||
|
||||
Source* LookupSource(const GIFRegTEX0& TEX0, const GIFRegTEXA& TEXA, const GSVector4i& r);
|
||||
|
|
|
@ -329,4 +329,4 @@ extern void* vmalloc(size_t size, bool code);
|
|||
extern void vmfree(void* ptr, size_t size);
|
||||
|
||||
#define USE_UPSCALE_HACKS // Hacks intended to fix upscaling / rendering glitches in HW renderers
|
||||
|
||||
//#define HW_NO_TEXTURE_CACHE // Slow but fixes a lot of bugs
|
Loading…
Reference in New Issue