mirror of
https://github.com/PCSX2/pcsx2.git
synced 2026-11-16 11:04:28 +01:00
gsdx-ogl: update shader pipeline intertace to use vs/gs/ps triplet
Better to have 1 function calls with 3 parameters rather 3 functions call with 1 parameter.
This commit is contained in:
1 parent
53690cf9d0
commit
3f404c8edb
6 files changed
+27
-55
No files matched your search
@@ -40,35 +40,27 @@ GSShaderOGL::~GSShaderOGL()
|
||||
m_single_prog.clear();
|
||||
}
|
||||
|
||||
void GSShaderOGL::VS(GLuint s)
|
||||
void GSShaderOGL::Pipeline(GLuint vs, GLuint gs, GLuint ps)
|
||||
{
|
||||
if (GLState::vs != s)
|
||||
if (GLState::vs != vs)
|
||||
{
|
||||
GLState::vs = s;
|
||||
glUseProgramStages(m_pipeline, GL_VERTEX_SHADER_BIT, s);
|
||||
GLState::vs = vs;
|
||||
glUseProgramStages(m_pipeline, GL_VERTEX_SHADER_BIT, vs);
|
||||
}
|
||||
if (GLState::gs != gs)
|
||||
{
|
||||
GLState::gs = gs;
|
||||
glUseProgramStages(m_pipeline, GL_GEOMETRY_SHADER_BIT, gs);
|
||||
}
|
||||
}
|
||||
|
||||
void GSShaderOGL::PS(GLuint s)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
if (true)
|
||||
#else
|
||||
if (GLState::ps != s)
|
||||
if (GLState::ps != ps)
|
||||
#endif
|
||||
{
|
||||
// In debug always sets the program. It allow to replace the program in apitrace easily.
|
||||
GLState::ps = s;
|
||||
glUseProgramStages(m_pipeline, GL_FRAGMENT_SHADER_BIT, s);
|
||||
}
|
||||
}
|
||||
|
||||
void GSShaderOGL::GS(GLuint s)
|
||||
{
|
||||
if (GLState::gs != s)
|
||||
{
|
||||
GLState::gs = s;
|
||||
glUseProgramStages(m_pipeline, GL_GEOMETRY_SHADER_BIT, s);
|
||||
GLState::ps = ps;
|
||||
glUseProgramStages(m_pipeline, GL_FRAGMENT_SHADER_BIT, ps);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user