summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/OGL/Render.cpp
diff options
context:
space:
mode:
authorStenzek <stenzek@gmail.com>2017-07-20 17:10:02 +1000
committerStenzek <stenzek@gmail.com>2017-07-20 17:54:33 +1000
commit3ea9d86faa2544b8c1c235db9456f271baf42fec (patch)
tree87a16a5a23002309127209967011c4d75ad8d93e /Source/Core/VideoBackends/OGL/Render.cpp
parentd01b0bf60fba2101e45cfac1e5747edcdbab5fc1 (diff)
ShaderGen: Pass host config to shader generation functions
Also moves the host config checks to common.
Diffstat (limited to 'Source/Core/VideoBackends/OGL/Render.cpp')
-rw-r--r--Source/Core/VideoBackends/OGL/Render.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/Source/Core/VideoBackends/OGL/Render.cpp b/Source/Core/VideoBackends/OGL/Render.cpp
index 50a3d366cc..4392da994c 100644
--- a/Source/Core/VideoBackends/OGL/Render.cpp
+++ b/Source/Core/VideoBackends/OGL/Render.cpp
@@ -43,6 +43,7 @@
#include "VideoCommon/PixelEngine.h"
#include "VideoCommon/PixelShaderManager.h"
#include "VideoCommon/RenderState.h"
+#include "VideoCommon/ShaderGenCommon.h"
#include "VideoCommon/VertexShaderManager.h"
#include "VideoCommon/VideoBackendBase.h"
#include "VideoCommon/VideoConfig.h"
@@ -664,6 +665,9 @@ Renderer::Renderer()
g_Config.VerifyValidity();
UpdateActiveConfig();
+ // Since we modify the config here, we need to update the last host bits, it may have changed.
+ m_last_host_config_bits = ShaderHostConfig::GetCurrent().bits;
+
OSD::AddMessage(StringFromFormat("Video Info: %s, %s, %s", g_ogl_config.gl_vendor,
g_ogl_config.gl_renderer, g_ogl_config.gl_version),
5000);
@@ -688,7 +692,6 @@ Renderer::Renderer()
s_last_stereo_mode = g_ActiveConfig.iStereoMode > 0;
s_last_xfb_mode = g_ActiveConfig.bUseRealXFB;
- m_last_host_config_bits = g_ActiveConfig.GetHostConfigBits();
// Handle VSync on/off
s_vsync = g_ActiveConfig.IsVSync();
@@ -1471,13 +1474,8 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight,
g_texture_cache->OnConfigChanged(g_ActiveConfig);
// Invalidate shader cache when the host config changes.
- u32 new_host_config_bits = g_ActiveConfig.GetHostConfigBits();
- if (new_host_config_bits != m_last_host_config_bits)
- {
- OSD::AddMessage("Video config changed, reloading shaders.", OSD::Duration::NORMAL);
+ if (CheckForHostConfigChanges())
ProgramShaderCache::Reload();
- m_last_host_config_bits = new_host_config_bits;
- }
// For testing zbuffer targets.
// Renderer::SetZBufferRender();