GSdx: Enable Texture Cache and RendererHW to support depth on Direct3D11.

This commit is contained in:
lightningterror 2018-12-04 16:16:32 +01:00
parent 4328d099c4
commit eb3a423f80
3 changed files with 7 additions and 9 deletions

View File

@ -23,8 +23,7 @@
#include "Renderers/Common/GSTextureCache.h"
#include "GSUtil.h"
bool s_IS_DIRECT3D11 = false;
bool s_IS_OPENGL = false;
bool s_IS_DIRECT3D9 = false;
bool GSTextureCache::m_disable_partial_invalidation = false;
bool GSTextureCache::m_wrap_gs_mem = false;
@ -32,8 +31,7 @@ GSTextureCache::GSTextureCache(GSRenderer* r)
: m_renderer(r),
m_palette_map(r)
{
s_IS_DIRECT3D11 = theApp.GetCurrentRendererType() == GSRendererType::DX1011_HW;
s_IS_OPENGL = theApp.GetCurrentRendererType() == GSRendererType::OGL_HW;
s_IS_DIRECT3D9 = theApp.GetCurrentRendererType() == GSRendererType::DX9_HW;
if (theApp.GetConfigB("UserHacks")) {
m_spritehack = theApp.GetConfigI("UserHacks_SpriteHack");
@ -56,7 +54,7 @@ GSTextureCache::GSTextureCache(GSRenderer* r)
}
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");
if (m_crc_hack_level == CRCHackLevel::Automatic)
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
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) {
GL_INS("Reading RT as a packed-indexed 8 bits format");

View File

@ -32,7 +32,7 @@ protected:
void Read(Target* 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:
GSTextureCache11(GSRenderer* r);

View File

@ -1141,8 +1141,8 @@ GSRendererHW::Hacks::Hacks()
, m_oo(NULL)
, m_cu(NULL)
{
bool is_opengl = theApp.GetCurrentRendererType() == GSRendererType::OGL_HW;
bool can_handle_depth = (!theApp.GetConfigB("UserHacks") || !theApp.GetConfigB("UserHacks_DisableDepthSupport")) && is_opengl;
bool is_direct3d9 = theApp.GetCurrentRendererType() == GSRendererType::DX9_HW;
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::FFX, CRC::RegionCount, &GSRendererHW::OI_FFX));