mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-28 19:58:53 +00:00
PostProcessing: Move default pixel shader to PostProcessingShaderConfiguration.
Reduces code complexity and fixes a bug where the shader is not properly invalidated.
This commit is contained in:
parent
fc46d460f9
commit
5c4ee2f71e
2 changed files with 19 additions and 18 deletions
|
@ -36,8 +36,6 @@ static const char s_vertex_shader[] =
|
|||
" uv0 = rawpos * src_rect.zw + src_rect.xy;\n"
|
||||
"}\n";
|
||||
|
||||
static const char s_default_shader[] = "void main() { SetOutput(Sample()); }\n";
|
||||
|
||||
OpenGLPostProcessing::OpenGLPostProcessing()
|
||||
: m_initialized(false)
|
||||
{
|
||||
|
@ -171,13 +169,7 @@ void OpenGLPostProcessing::ApplyShader()
|
|||
m_uniform_bindings.clear();
|
||||
|
||||
// load shader code
|
||||
std::string code = "";
|
||||
if (g_ActiveConfig.sPostProcessingShader != "")
|
||||
code = m_config.LoadShader();
|
||||
|
||||
if (code == "")
|
||||
code = s_default_shader;
|
||||
|
||||
std::string code = m_config.LoadShader();
|
||||
code = LoadShaderOptions(code);
|
||||
|
||||
const char* vertex_shader = s_vertex_shader;
|
||||
|
@ -189,8 +181,8 @@ void OpenGLPostProcessing::ApplyShader()
|
|||
if (!ProgramShaderCache::CompileShader(m_shader, vertex_shader, code.c_str()))
|
||||
{
|
||||
ERROR_LOG(VIDEO, "Failed to compile post-processing shader %s", m_config.GetShader().c_str());
|
||||
|
||||
code = LoadShaderOptions(s_default_shader);
|
||||
g_ActiveConfig.sPostProcessingShader.clear();
|
||||
code = m_config.LoadShader();
|
||||
ProgramShaderCache::CompileShader(m_shader, vertex_shader, code.c_str());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue