diff options
| author | Stenzek <stenzek@gmail.com> | 2017-06-24 18:55:08 +1000 |
|---|---|---|
| committer | Stenzek <stenzek@gmail.com> | 2017-07-20 17:46:59 +1000 |
| commit | d1381f5021815c36d2fdd98087b6522c995428cc (patch) | |
| tree | 6fad21d3e68e8cf64cfd075fa027ca12363f62fb /Source/Core/VideoCommon/VideoConfig.cpp | |
| parent | 82c27182a8a15903a0082890e6b188435ec957b4 (diff) | |
VideoConfig: Add host config union
Contains all host state that can affect shadergen.
Diffstat (limited to 'Source/Core/VideoCommon/VideoConfig.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/VideoConfig.cpp | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/VideoConfig.cpp b/Source/Core/VideoCommon/VideoConfig.cpp index d53e903cee..78784c5c9c 100644 --- a/Source/Core/VideoCommon/VideoConfig.cpp +++ b/Source/Core/VideoCommon/VideoConfig.cpp @@ -5,6 +5,7 @@ #include <algorithm> #include "Common/CommonTypes.h" +#include "Common/StringUtil.h" #include "Core/Config/GraphicsSettings.h" #include "Core/Core.h" #include "Core/Movie.h" @@ -203,3 +204,60 @@ bool VideoConfig::IsSSAAEnabled() const return iMultisamples > 1 && bSSAA && backend_info.bSupportsSSAA; } +union HostConfigBits +{ + u32 bits; + + struct + { + u32 msaa : 1; + u32 ssaa : 1; + u32 stereo : 1; + u32 wireframe : 1; + u32 per_pixel_lighting : 1; + u32 vertex_rounding : 1; + u32 fast_depth_calc : 1; + u32 bounding_box : 1; + u32 backend_dual_source_blend : 1; + u32 backend_geometry_shaders : 1; + u32 backend_early_z : 1; + u32 backend_bbox : 1; + u32 backend_gs_instancing : 1; + u32 backend_clip_control : 1; + u32 backend_ssaa : 1; + u32 backend_atomics : 1; + u32 backend_depth_clamp : 1; + u32 backend_reversed_depth_range : 1; + u32 pad : 14; + }; +}; + +u32 VideoConfig::GetHostConfigBits() const +{ + HostConfigBits bits = {}; + bits.msaa = IsMSAAEnabled(); + bits.ssaa = IsSSAAEnabled(); + bits.stereo = IsStereoEnabled(); + bits.wireframe = bWireFrame; + bits.per_pixel_lighting = bEnablePixelLighting; + bits.vertex_rounding = UseVertexRounding(); + bits.fast_depth_calc = bFastDepthCalc; + bits.bounding_box = bBBoxEnable; + bits.backend_dual_source_blend = backend_info.bSupportsDualSourceBlend; + bits.backend_geometry_shaders = backend_info.bSupportsGeometryShaders; + bits.backend_early_z = backend_info.bSupportsEarlyZ; + bits.backend_bbox = backend_info.bSupportsBBox; + bits.backend_gs_instancing = backend_info.bSupportsGSInstancing; + bits.backend_clip_control = backend_info.bSupportsClipControl; + bits.backend_ssaa = backend_info.bSupportsSSAA; + bits.backend_atomics = backend_info.bSupportsFragmentStoresAndAtomics; + bits.backend_depth_clamp = backend_info.bSupportsDepthClamp; + bits.backend_reversed_depth_range = backend_info.bSupportsReversedDepthRange; + return bits.bits; +} + +std::string VideoConfig::GetHostConfigFilename() const +{ + u32 bits = GetHostConfigBits(); + return StringFromFormat("%08X", bits); +} |
