Skip to content

Commit

Permalink
gsdx-d3d11: Adjust maximum texture size limit based on available feat…
Browse files Browse the repository at this point in the history
…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 26, 2019
1 parent 92aa43f commit de7a3b7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
11 changes: 9 additions & 2 deletions plugins/GSdx/Renderers/DX11/GSDevice11.cpp
Expand Up @@ -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");
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions plugins/GSdx/Renderers/DX11/GSDevice11.h
Expand Up @@ -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);
Expand Down

0 comments on commit de7a3b7

Please sign in to comment.