mirror of https://github.com/PCSX2/pcsx2.git
gsdx ogl: format GSShader code
Move the Geometry Shader to the call of the function
This commit is contained in:
parent
5672d2b39e
commit
405f312fe8
|
@ -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));
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue