From de7a3b70c927b6e3d2f6d7cd7b2b661e328ccf68 Mon Sep 17 00:00:00 2001 From: lightningterror Date: Sun, 18 Aug 2019 23:16:04 +0200 Subject: [PATCH] gsdx-d3d11: Adjust maximum texture size limit based on available feature level. d3d10 = 8192 d3d11 = 16384 Seems it is easier to hit the limit. Champions of Norrath with 8x upscale for example. --- plugins/GSdx/Renderers/DX11/GSDevice11.cpp | 11 +++++++++-- plugins/GSdx/Renderers/DX11/GSDevice11.h | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/plugins/GSdx/Renderers/DX11/GSDevice11.cpp b/plugins/GSdx/Renderers/DX11/GSDevice11.cpp index 694bd48c2e..7f0bd6aabf 100644 --- a/plugins/GSdx/Renderers/DX11/GSDevice11.cpp +++ b/plugins/GSdx/Renderers/DX11/GSDevice11.cpp @@ -226,6 +226,12 @@ bool GSDevice11::Create(const std::shared_ptr &wnd) return false; } + // Set maximum texture size limit based on supported feature level. + if (level >= D3D_FEATURE_LEVEL_11_0) + m_d3d_texsize = D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION; + else + m_d3d_texsize = D3D10_REQ_TEXTURE2D_U_OR_V_DIMENSION; + { // HACK: check nVIDIA // Note: It can cause issues on several games such as SOTC, Fatal Frame, plus it adds border offset. bool disable_safe_features = theApp.GetConfigB("UserHacks") && theApp.GetConfigB("UserHacks_Disable_Safe_Features"); @@ -638,8 +644,9 @@ GSTexture* GSDevice11::CreateSurface(int type, int w, int h, int format) memset(&desc, 0, sizeof(desc)); - desc.Width = std::max(1, std::min(w, 8192)); // Texture limit for D3D10 min 1, max 8192 - desc.Height = std::max(1, std::min(h, 8192)); + // Texture limit for D3D10/11 min 1, max 8192 D3D10, max 16384 D3D11. + desc.Width = std::max(1, std::min(w, m_d3d_texsize)); + desc.Height = std::max(1, std::min(h, m_d3d_texsize)); desc.Format = (DXGI_FORMAT)format; desc.MipLevels = 1; desc.ArraySize = 1; diff --git a/plugins/GSdx/Renderers/DX11/GSDevice11.h b/plugins/GSdx/Renderers/DX11/GSDevice11.h index 1146cac062..778b79413e 100644 --- a/plugins/GSdx/Renderers/DX11/GSDevice11.h +++ b/plugins/GSdx/Renderers/DX11/GSDevice11.h @@ -342,6 +342,7 @@ private: float m_hack_topleft_offset; int m_upscale_multiplier; int m_mipmap; + int m_d3d_texsize; GSTexture* CreateSurface(int type, int w, int h, int format); GSTexture* FetchSurface(int type, int w, int h, int format);