mirror of
https://github.com/libretro/RetroArch
synced 2025-01-25 15:35:29 +00:00
Drop redundant branching in GL.
Pointers are always set.
This commit is contained in:
parent
ca50a90c09
commit
5a4c51a5cb
32
gfx/gl.c
32
gfx/gl.c
@ -242,31 +242,19 @@ static void gl_set_coords(const struct gl_coords *coords)
|
||||
{
|
||||
pglClientActiveTexture(GL_TEXTURE0);
|
||||
|
||||
if (coords->vertex)
|
||||
{
|
||||
glVertexPointer(2, GL_FLOAT, 0, coords->vertex);
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
}
|
||||
glVertexPointer(2, GL_FLOAT, 0, coords->vertex);
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
|
||||
if (coords->color)
|
||||
{
|
||||
glColorPointer(4, GL_FLOAT, 0, coords->color);
|
||||
glEnableClientState(GL_COLOR_ARRAY);
|
||||
}
|
||||
glColorPointer(4, GL_FLOAT, 0, coords->color);
|
||||
glEnableClientState(GL_COLOR_ARRAY);
|
||||
|
||||
if (coords->tex_coord)
|
||||
{
|
||||
glTexCoordPointer(2, GL_FLOAT, 0, coords->tex_coord);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
}
|
||||
glTexCoordPointer(2, GL_FLOAT, 0, coords->tex_coord);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
if (coords->lut_tex_coord)
|
||||
{
|
||||
pglClientActiveTexture(GL_TEXTURE1);
|
||||
glTexCoordPointer(2, GL_FLOAT, 0, coords->lut_tex_coord);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
pglClientActiveTexture(GL_TEXTURE0);
|
||||
}
|
||||
pglClientActiveTexture(GL_TEXTURE1);
|
||||
glTexCoordPointer(2, GL_FLOAT, 0, coords->lut_tex_coord);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
pglClientActiveTexture(GL_TEXTURE0);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1299,48 +1299,38 @@ bool gl_glsl_set_coords(const struct gl_coords *coords)
|
||||
if (!glsl_enable || !glsl_modern)
|
||||
return false;
|
||||
|
||||
if (coords->tex_coord)
|
||||
int loc;
|
||||
|
||||
loc = pglGetAttribLocation(gl_program[active_index], "rubyTexCoord");
|
||||
if (loc >= 0)
|
||||
{
|
||||
int loc = pglGetAttribLocation(gl_program[active_index], "rubyTexCoord");
|
||||
if (loc >= 0)
|
||||
{
|
||||
pglEnableVertexAttribArray(loc);
|
||||
pglVertexAttribPointer(loc, 2, GL_FLOAT, GL_FALSE, 0, coords->tex_coord);
|
||||
gl_attribs[gl_attrib_index++] = loc;
|
||||
}
|
||||
pglEnableVertexAttribArray(loc);
|
||||
pglVertexAttribPointer(loc, 2, GL_FLOAT, GL_FALSE, 0, coords->tex_coord);
|
||||
gl_attribs[gl_attrib_index++] = loc;
|
||||
}
|
||||
|
||||
if (coords->vertex)
|
||||
loc = pglGetAttribLocation(gl_program[active_index], "rubyVertexCoord");
|
||||
if (loc >= 0)
|
||||
{
|
||||
int loc = pglGetAttribLocation(gl_program[active_index], "rubyVertexCoord");
|
||||
if (loc >= 0)
|
||||
{
|
||||
pglEnableVertexAttribArray(loc);
|
||||
pglVertexAttribPointer(loc, 2, GL_FLOAT, GL_FALSE, 0, coords->vertex);
|
||||
gl_attribs[gl_attrib_index++] = loc;
|
||||
}
|
||||
pglEnableVertexAttribArray(loc);
|
||||
pglVertexAttribPointer(loc, 2, GL_FLOAT, GL_FALSE, 0, coords->vertex);
|
||||
gl_attribs[gl_attrib_index++] = loc;
|
||||
}
|
||||
|
||||
if (coords->color)
|
||||
loc = pglGetAttribLocation(gl_program[active_index], "rubyColor");
|
||||
if (loc >= 0)
|
||||
{
|
||||
int loc = pglGetAttribLocation(gl_program[active_index], "rubyColor");
|
||||
if (loc >= 0)
|
||||
{
|
||||
pglEnableVertexAttribArray(loc);
|
||||
pglVertexAttribPointer(loc, 4, GL_FLOAT, GL_FALSE, 0, coords->color);
|
||||
gl_attribs[gl_attrib_index++] = loc;
|
||||
}
|
||||
pglEnableVertexAttribArray(loc);
|
||||
pglVertexAttribPointer(loc, 4, GL_FLOAT, GL_FALSE, 0, coords->color);
|
||||
gl_attribs[gl_attrib_index++] = loc;
|
||||
}
|
||||
|
||||
if (coords->lut_tex_coord)
|
||||
loc = pglGetAttribLocation(gl_program[active_index], "rubyLUTTexCoord");
|
||||
if (loc >= 0)
|
||||
{
|
||||
int loc = pglGetAttribLocation(gl_program[active_index], "rubyLUTTexCoord");
|
||||
if (loc >= 0)
|
||||
{
|
||||
pglEnableVertexAttribArray(loc);
|
||||
pglVertexAttribPointer(loc, 2, GL_FLOAT, GL_FALSE, 0, coords->lut_tex_coord);
|
||||
gl_attribs[gl_attrib_index++] = loc;
|
||||
}
|
||||
pglEnableVertexAttribArray(loc);
|
||||
pglVertexAttribPointer(loc, 2, GL_FLOAT, GL_FALSE, 0, coords->lut_tex_coord);
|
||||
gl_attribs[gl_attrib_index++] = loc;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user