diff options
| author | Stenzek <stenzek@gmail.com> | 2017-07-20 17:10:02 +1000 |
|---|---|---|
| committer | Stenzek <stenzek@gmail.com> | 2017-07-20 17:54:33 +1000 |
| commit | 3ea9d86faa2544b8c1c235db9456f271baf42fec (patch) | |
| tree | 87a16a5a23002309127209967011c4d75ad8d93e /Source/Core/VideoCommon/RenderBase.cpp | |
| parent | d01b0bf60fba2101e45cfac1e5747edcdbab5fc1 (diff) | |
ShaderGen: Pass host config to shader generation functions
Also moves the host config checks to common.
Diffstat (limited to 'Source/Core/VideoCommon/RenderBase.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/RenderBase.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp index 62f86534c9..45e2006cb6 100644 --- a/Source/Core/VideoCommon/RenderBase.cpp +++ b/Source/Core/VideoCommon/RenderBase.cpp @@ -52,6 +52,7 @@ #include "VideoCommon/OnScreenDisplay.h" #include "VideoCommon/PixelShaderManager.h" #include "VideoCommon/PostProcessing.h" +#include "VideoCommon/ShaderGenCommon.h" #include "VideoCommon/Statistics.h" #include "VideoCommon/TextureCacheBase.h" #include "VideoCommon/TextureDecoder.h" @@ -96,6 +97,8 @@ Renderer::Renderer(int backbuffer_width, int backbuffer_height) { m_aspect_wide = SConfig::GetInstance().m_wii_aspect_ratio != 0; } + + m_last_host_config_bits = ShaderHostConfig::GetCurrent().bits; } Renderer::~Renderer() @@ -315,6 +318,17 @@ void Renderer::SaveScreenshot(const std::string& filename, bool wait_for_complet } } +bool Renderer::CheckForHostConfigChanges() +{ + ShaderHostConfig new_host_config = ShaderHostConfig::GetCurrent(); + if (new_host_config.bits == m_last_host_config_bits) + return false; + + OSD::AddMessage("Video config changed, reloading shaders.", OSD::Duration::NORMAL); + m_last_host_config_bits = new_host_config.bits; + return true; +} + // Create On-Screen-Messages void Renderer::DrawDebugText() { |
