diff --git a/plugins/GSdx/GSDeviceOGL.cpp b/plugins/GSdx/GSDeviceOGL.cpp index a837a01cbf..addd2ee0e1 100644 --- a/plugins/GSdx/GSDeviceOGL.cpp +++ b/plugins/GSdx/GSDeviceOGL.cpp @@ -420,7 +420,9 @@ void GSDeviceOGL::CreateTextureFX() // Pre compile the (remaining) Geometry & Vertex Shader for (uint32 key = 0; key < countof(m_gs); key++) { GSSelector sel(key); - if (sel.point == sel.sprite) + if (!GLLoader::found_geometry_shader) + m_gs[key] = 0; + else if (sel.point == sel.sprite) // Invalid key m_gs[key] = 0; else m_gs[key] = CompileGS(GSSelector(key)); diff --git a/plugins/GSdx/GSShaderOGL.cpp b/plugins/GSdx/GSShaderOGL.cpp index 3336158d55..4972619b05 100644 --- a/plugins/GSdx/GSShaderOGL.cpp +++ b/plugins/GSdx/GSShaderOGL.cpp @@ -56,23 +56,24 @@ GLuint GSShaderOGL::LinkPipeline(GLuint vs, GLuint gs, GLuint ps) void GSShaderOGL::BindPipeline(GLuint vs, GLuint gs, GLuint ps) { BindPipeline(m_pipeline); - if (GLState::vs != vs) - { + + if (GLState::vs != vs) { GLState::vs = vs; glUseProgramStages(m_pipeline, GL_VERTEX_SHADER_BIT, vs); } - if (GLState::gs != gs) - { + + if (GLState::gs != gs) { GLState::gs = gs; glUseProgramStages(m_pipeline, GL_GEOMETRY_SHADER_BIT, gs); } + #ifdef _DEBUG + // In debug always sets the program. It allow to replace the program in apitrace easily. if (true) #else if (GLState::ps != ps) #endif { - // In debug always sets the program. It allow to replace the program in apitrace easily. GLState::ps = ps; glUseProgramStages(m_pipeline, GL_FRAGMENT_SHADER_BIT, ps); } @@ -180,10 +181,6 @@ GLuint GSShaderOGL::Compile(const std::string& glsl_file, const std::string& ent GLuint program = 0; - if (type == GL_GEOMETRY_SHADER && !GLLoader::found_geometry_shader) { - return program; - } - // Note it is better to separate header and source file to have the good line number // in the glsl compiler report const int shader_nb = 3;