mirror of https://github.com/PCSX2/pcsx2.git
gsdx-tc: add an option to avoid blow up dx :p
texture_cache_depth = 1 (default for openGL)
This commit is contained in:
parent
74d84aafb5
commit
76160505f7
|
@ -30,6 +30,8 @@ GSTextureCache::GSTextureCache(GSRenderer* r)
|
||||||
UserHacks_HalfPixelOffset = !!theApp.GetConfig("UserHacks", 0) && !!theApp.GetConfig("UserHacks_HalfPixelOffset", 0);
|
UserHacks_HalfPixelOffset = !!theApp.GetConfig("UserHacks", 0) && !!theApp.GetConfig("UserHacks_HalfPixelOffset", 0);
|
||||||
m_paltex = !!theApp.GetConfig("paltex", 0);
|
m_paltex = !!theApp.GetConfig("paltex", 0);
|
||||||
|
|
||||||
|
m_can_convert_depth = theApp.GetConfig("texture_cache_depth", 1);
|
||||||
|
|
||||||
m_temp = (uint8*)_aligned_malloc(1024 * 1024 * sizeof(uint32), 32);
|
m_temp = (uint8*)_aligned_malloc(1024 * 1024 * sizeof(uint32), 32);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,7 +146,7 @@ GSTextureCache::Source* GSTextureCache::LookupSource(const GIFRegTEX0& TEX0, con
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dst == NULL) {
|
if (dst == NULL && CanConvertDepth()) {
|
||||||
// Let's try a trick to avoid to use wrongly a depth buffer
|
// Let's try a trick to avoid to use wrongly a depth buffer
|
||||||
// Unfortunately, I don't have any Arc the Lad testcase
|
// Unfortunately, I don't have any Arc the Lad testcase
|
||||||
//
|
//
|
||||||
|
@ -240,7 +242,7 @@ GSTextureCache::Target* GSTextureCache::LookupTarget(const GIFRegTEX0& TEX0, int
|
||||||
dst->Update();
|
dst->Update();
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (type == DepthStencil) {
|
if (type == DepthStencil && CanConvertDepth()) {
|
||||||
// Depth stencil can be an older RT but only check recent RT to avoid to pick
|
// Depth stencil can be an older RT but only check recent RT to avoid to pick
|
||||||
// some bad data.
|
// some bad data.
|
||||||
for(list<Target*>::iterator i = m_dst[RenderTarget].begin(); i != m_dst[RenderTarget].end(); i++)
|
for(list<Target*>::iterator i = m_dst[RenderTarget].begin(); i != m_dst[RenderTarget].end(); i++)
|
||||||
|
@ -377,6 +379,9 @@ GSTextureCache::Target* GSTextureCache::LookupTarget(const GIFRegTEX0& TEX0, int
|
||||||
// must invalidate the Target/Depth respectively
|
// must invalidate the Target/Depth respectively
|
||||||
void GSTextureCache::InvalidateVideoMemType(int type, uint32 bp)
|
void GSTextureCache::InvalidateVideoMemType(int type, uint32 bp)
|
||||||
{
|
{
|
||||||
|
if (!CanConvertDepth())
|
||||||
|
return;
|
||||||
|
|
||||||
for(list<Target*>::iterator i = m_dst[type].begin(); i != m_dst[type].end(); i++)
|
for(list<Target*>::iterator i = m_dst[type].begin(); i != m_dst[type].end(); i++)
|
||||||
{
|
{
|
||||||
Target* t = *i;
|
Target* t = *i;
|
||||||
|
|
|
@ -110,6 +110,7 @@ protected:
|
||||||
bool m_paltex;
|
bool m_paltex;
|
||||||
int m_spritehack;
|
int m_spritehack;
|
||||||
uint8* m_temp;
|
uint8* m_temp;
|
||||||
|
bool m_can_convert_depth;
|
||||||
|
|
||||||
virtual Source* CreateSource(const GIFRegTEX0& TEX0, const GIFRegTEXA& TEXA, Target* t = NULL, bool half_right = false);
|
virtual Source* CreateSource(const GIFRegTEX0& TEX0, const GIFRegTEXA& TEXA, Target* t = NULL, bool half_right = false);
|
||||||
virtual Target* CreateTarget(const GIFRegTEX0& TEX0, int w, int h, int type);
|
virtual Target* CreateTarget(const GIFRegTEX0& TEX0, int w, int h, int type);
|
||||||
|
@ -122,6 +123,8 @@ protected:
|
||||||
virtual void Read(Target* t, const GSVector4i& r) = 0;
|
virtual void Read(Target* t, const GSVector4i& r) = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
virtual bool CanConvertDepth() { return m_can_convert_depth; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GSTextureCache(GSRenderer* r);
|
GSTextureCache(GSRenderer* r);
|
||||||
virtual ~GSTextureCache();
|
virtual ~GSTextureCache();
|
||||||
|
|
|
@ -31,6 +31,8 @@ protected:
|
||||||
|
|
||||||
void Read(Target* t, const GSVector4i& r);
|
void Read(Target* t, const GSVector4i& r);
|
||||||
|
|
||||||
|
virtual bool CanConvertDepth() { return false; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GSTextureCache11(GSRenderer* r);
|
GSTextureCache11(GSRenderer* r);
|
||||||
};
|
};
|
||||||
|
|
|
@ -31,6 +31,8 @@ protected:
|
||||||
|
|
||||||
void Read(Target* t, const GSVector4i& r);
|
void Read(Target* t, const GSVector4i& r);
|
||||||
|
|
||||||
|
virtual bool CanConvertDepth() { return false; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GSTextureCache9(GSRenderer* r);
|
GSTextureCache9(GSRenderer* r);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue