VideoConfig: Add config options for ubershaders

This commit is contained in:
Stenzek
2017-06-13 20:07:09 +10:00
parent 745d541527
commit 901bf9c257
12 changed files with 207 additions and 0 deletions

View File

@ -168,6 +168,35 @@ 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;
// Number of shader compiler threads.
// 0 disables background compilation.
// -1 uses an automatic number based on the CPU threads.
int iShaderCompilerThreads;
// Temporary toggling of ubershaders, for debugging
bool bForceVertexUberShaders;
bool bForcePixelUberShaders;
// Static config per API
// TODO: Move this out of VideoConfig
struct
@ -226,6 +255,10 @@ struct VideoConfig final
return backend_info.bSupportsGPUTextureDecoding && bEnableGPUTextureDecoding;
}
bool UseVertexRounding() const { return bVertexRounding && iEFBScale != SCALE_1X; }
u32 GetShaderCompilerThreads() const;
bool CanUseUberShaders() const;
bool CanPrecompileUberShaders() const;
bool CanBackgroundCompileShaders() const;
};
extern VideoConfig g_Config;