mirror of https://github.com/PCSX2/pcsx2.git
GSdx: Enable Texture Cache and RendererHW to support depth on Direct3D11.
This commit is contained in:
parent
4328d099c4
commit
eb3a423f80
|
@ -23,8 +23,7 @@
|
||||||
#include "Renderers/Common/GSTextureCache.h"
|
#include "Renderers/Common/GSTextureCache.h"
|
||||||
#include "GSUtil.h"
|
#include "GSUtil.h"
|
||||||
|
|
||||||
bool s_IS_DIRECT3D11 = false;
|
bool s_IS_DIRECT3D9 = false;
|
||||||
bool s_IS_OPENGL = false;
|
|
||||||
bool GSTextureCache::m_disable_partial_invalidation = false;
|
bool GSTextureCache::m_disable_partial_invalidation = false;
|
||||||
bool GSTextureCache::m_wrap_gs_mem = false;
|
bool GSTextureCache::m_wrap_gs_mem = false;
|
||||||
|
|
||||||
|
@ -32,8 +31,7 @@ GSTextureCache::GSTextureCache(GSRenderer* r)
|
||||||
: m_renderer(r),
|
: m_renderer(r),
|
||||||
m_palette_map(r)
|
m_palette_map(r)
|
||||||
{
|
{
|
||||||
s_IS_DIRECT3D11 = theApp.GetCurrentRendererType() == GSRendererType::DX1011_HW;
|
s_IS_DIRECT3D9 = theApp.GetCurrentRendererType() == GSRendererType::DX9_HW;
|
||||||
s_IS_OPENGL = theApp.GetCurrentRendererType() == GSRendererType::OGL_HW;
|
|
||||||
|
|
||||||
if (theApp.GetConfigB("UserHacks")) {
|
if (theApp.GetConfigB("UserHacks")) {
|
||||||
m_spritehack = theApp.GetConfigI("UserHacks_SpriteHack");
|
m_spritehack = theApp.GetConfigI("UserHacks_SpriteHack");
|
||||||
|
@ -56,7 +54,7 @@ GSTextureCache::GSTextureCache(GSRenderer* r)
|
||||||
}
|
}
|
||||||
|
|
||||||
m_paltex = theApp.GetConfigB("paltex");
|
m_paltex = theApp.GetConfigB("paltex");
|
||||||
m_can_convert_depth &= s_IS_OPENGL; // only supported by openGL so far
|
m_can_convert_depth &= !s_IS_DIRECT3D9; // not supported on D3D9
|
||||||
m_crc_hack_level = theApp.GetConfigT<CRCHackLevel>("crc_hack_level");
|
m_crc_hack_level = theApp.GetConfigT<CRCHackLevel>("crc_hack_level");
|
||||||
if (m_crc_hack_level == CRCHackLevel::Automatic)
|
if (m_crc_hack_level == CRCHackLevel::Automatic)
|
||||||
m_crc_hack_level = GSUtil::GetRecommendedCRCHackLevel(theApp.GetCurrentRendererType());
|
m_crc_hack_level = GSUtil::GetRecommendedCRCHackLevel(theApp.GetCurrentRendererType());
|
||||||
|
@ -1178,7 +1176,7 @@ GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, con
|
||||||
// TODO: clean up this mess
|
// TODO: clean up this mess
|
||||||
|
|
||||||
int shader = dst->m_type != RenderTarget ? ShaderConvert_FLOAT32_TO_RGBA8 : ShaderConvert_COPY;
|
int shader = dst->m_type != RenderTarget ? ShaderConvert_FLOAT32_TO_RGBA8 : ShaderConvert_COPY;
|
||||||
bool is_8bits = TEX0.PSM == PSM_PSMT8 && (s_IS_DIRECT3D11 || s_IS_OPENGL);
|
bool is_8bits = TEX0.PSM == PSM_PSMT8 && !s_IS_DIRECT3D9;
|
||||||
|
|
||||||
if (is_8bits) {
|
if (is_8bits) {
|
||||||
GL_INS("Reading RT as a packed-indexed 8 bits format");
|
GL_INS("Reading RT as a packed-indexed 8 bits format");
|
||||||
|
|
|
@ -32,7 +32,7 @@ protected:
|
||||||
void Read(Target* t, const GSVector4i& r);
|
void Read(Target* t, const GSVector4i& r);
|
||||||
void Read(Source* t, const GSVector4i& r);
|
void Read(Source* t, const GSVector4i& r);
|
||||||
|
|
||||||
virtual bool CanConvertDepth() { return false; }
|
virtual bool CanConvertDepth() { return m_can_convert_depth; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GSTextureCache11(GSRenderer* r);
|
GSTextureCache11(GSRenderer* r);
|
||||||
|
|
|
@ -1141,8 +1141,8 @@ GSRendererHW::Hacks::Hacks()
|
||||||
, m_oo(NULL)
|
, m_oo(NULL)
|
||||||
, m_cu(NULL)
|
, m_cu(NULL)
|
||||||
{
|
{
|
||||||
bool is_opengl = theApp.GetCurrentRendererType() == GSRendererType::OGL_HW;
|
bool is_direct3d9 = theApp.GetCurrentRendererType() == GSRendererType::DX9_HW;
|
||||||
bool can_handle_depth = (!theApp.GetConfigB("UserHacks") || !theApp.GetConfigB("UserHacks_DisableDepthSupport")) && is_opengl;
|
bool can_handle_depth = (!theApp.GetConfigB("UserHacks") || !theApp.GetConfigB("UserHacks_DisableDepthSupport")) && !is_direct3d9;
|
||||||
|
|
||||||
m_oi_list.push_back(HackEntry<OI_Ptr>(CRC::FFXII, CRC::EU, &GSRendererHW::OI_FFXII));
|
m_oi_list.push_back(HackEntry<OI_Ptr>(CRC::FFXII, CRC::EU, &GSRendererHW::OI_FFXII));
|
||||||
m_oi_list.push_back(HackEntry<OI_Ptr>(CRC::FFX, CRC::RegionCount, &GSRendererHW::OI_FFX));
|
m_oi_list.push_back(HackEntry<OI_Ptr>(CRC::FFX, CRC::RegionCount, &GSRendererHW::OI_FFX));
|
||||||
|
|
Loading…
Reference in New Issue