Skip to content

Commit

Permalink
Merge pull request #5058 from stenzek/d3d11-startup-crash
Browse files Browse the repository at this point in the history
D3D11: Fix error on startup with >2.5xIR selected
  • Loading branch information
degasus committed Mar 10, 2017
2 parents 9b5a0b3 + 42993ee commit a3f5e3e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Source/Core/VideoBackends/D3D/D3DBase.cpp
Expand Up @@ -526,9 +526,9 @@ bool BGRATexturesSupported()

// Returns the maximum width/height of a texture. This value only depends upon the feature level in
// DX11
unsigned int GetMaxTextureSize()
u32 GetMaxTextureSize(D3D_FEATURE_LEVEL feature_level)
{
switch (featlevel)
switch (feature_level)
{
case D3D_FEATURE_LEVEL_11_0:
return D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION;
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/VideoBackends/D3D/D3DBase.h
Expand Up @@ -72,7 +72,7 @@ const char* GeometryShaderVersionString();
const char* VertexShaderVersionString();
bool BGRATexturesSupported();

unsigned int GetMaxTextureSize();
u32 GetMaxTextureSize(D3D_FEATURE_LEVEL feature_level);

HRESULT SetFullscreenState(bool enable_fullscreen);
bool GetFullscreenState();
Expand Down
6 changes: 4 additions & 2 deletions Source/Core/VideoBackends/D3D/main.cpp
Expand Up @@ -61,7 +61,7 @@ void VideoBackend::InitBackendInfo()
}

g_Config.backend_info.api_type = APIType::D3D;
g_Config.backend_info.MaxTextureSize = DX11::D3D::GetMaxTextureSize();
g_Config.backend_info.MaxTextureSize = D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION;
g_Config.backend_info.bSupportsExclusiveFullscreen = true;
g_Config.backend_info.bSupportsDualSourceBlend = true;
g_Config.backend_info.bSupportsPrimitiveRestart = true;
Expand Down Expand Up @@ -104,7 +104,9 @@ void VideoBackend::InitBackendInfo()
g_Config.backend_info.AAModes.push_back(modes[i].Count);
}

bool shader_model_5_supported = (DX11::D3D::GetFeatureLevel(ad) >= D3D_FEATURE_LEVEL_11_0);
D3D_FEATURE_LEVEL feature_level = D3D::GetFeatureLevel(ad);
bool shader_model_5_supported = feature_level >= D3D_FEATURE_LEVEL_11_0;
g_Config.backend_info.MaxTextureSize = D3D::GetMaxTextureSize(feature_level);

// Requires the earlydepthstencil attribute (only available in shader model 5)
g_Config.backend_info.bSupportsEarlyZ = shader_model_5_supported;
Expand Down

0 comments on commit a3f5e3e

Please sign in to comment.