VideoConfig: Collapse ubershader configuration fields to a single value

This commit is contained in:
Stenzek
2018-03-01 18:03:24 +10:00
parent 590307b94c
commit 9fa24700b6
11 changed files with 42 additions and 112 deletions

View File

@ -42,6 +42,13 @@ enum class StereoMode : int
Nvidia3DVision
};
enum class UberShaderMode : int
{
Disabled,
Hybrid,
Exclusive
};
struct ProjectionHackConfig final
{
bool m_enable;
@ -161,25 +168,8 @@ struct VideoConfig final
// Currently only supported with Vulkan.
int iCommandBufferExecuteInterval;
// The following options determine the ubershader mode:
// No ubershaders:
// - bBackgroundShaderCompiling = false
// - bDisableSpecializedShaders = false
// Hybrid/background compiling:
// - bBackgroundShaderCompiling = true
// - bDisableSpecializedShaders = false
// Ubershaders only:
// - bBackgroundShaderCompiling = false
// - bDisableSpecializedShaders = true
// Enable background shader compiling, use ubershaders while waiting.
bool bBackgroundShaderCompiling;
// Use ubershaders only, don't compile specialized shaders.
bool bDisableSpecializedShaders;
// Precompile ubershader variants at boot/config reload time.
bool bPrecompileUberShaders;
// Shader compilation settings.
UberShaderMode iUberShaderMode;
// Number of shader compiler threads.
// 0 disables background compilation.
@ -247,10 +237,9 @@ struct VideoConfig final
return backend_info.bSupportsGPUTextureDecoding && bEnableGPUTextureDecoding;
}
bool UseVertexRounding() const { return bVertexRounding && iEFBScale != 1; }
bool UsingUberShaders() const { return iUberShaderMode != UberShaderMode::Disabled; }
u32 GetShaderCompilerThreads() const;
u32 GetShaderPrecompilerThreads() const;
bool CanPrecompileUberShaders() const;
bool CanBackgroundCompileShaders() const;
};
extern VideoConfig g_Config;