Skip to content
Permalink
Browse files

gsdx-d3d11: Adjust maximum texture size limit based on available feat…

…ure level.

d3d10 = 8192
d3d11 = 16384

Seems it is easier to hit the limit. Champions of Norrath with 8x
upscale for example.
  • Loading branch information...
lightningterror committed Aug 18, 2019
1 parent 92aa43f commit de7a3b70c927b6e3d2f6d7cd7b2b661e328ccf68
Showing with 10 additions and 2 deletions.
  1. +9 −2 plugins/GSdx/Renderers/DX11/GSDevice11.cpp
  2. +1 −0 plugins/GSdx/Renderers/DX11/GSDevice11.h
@@ -226,6 +226,12 @@ bool GSDevice11::Create(const std::shared_ptr<GSWnd> &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;
@@ -342,6 +342,7 @@ class GSDevice11 final : public GSDevice
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);

0 comments on commit de7a3b7

Please sign in to comment.
You can’t perform that action at this time.