mirror of
https://github.com/libretro/RetroArch
synced 2025-01-31 15:32:59 +00:00
(PS3) RGL can use GL_TRIANGLESTRIP now - get rid of messy
GL_QUAD hack in gl.c
This commit is contained in:
parent
311eb65e7d
commit
440d731a53
@ -5939,7 +5939,7 @@ GLAPI void APIENTRY glDrawArrays( GLenum mode, GLint first, GLsizei count )
|
||||
}while(_tmp_clear_loop);
|
||||
|
||||
jsDrawParams *dparams = (jsDrawParams *)s_dparams_buff;
|
||||
dparams->mode = mode;
|
||||
dparams->mode = CELL_GCM_PRIMITIVE_TRIANGLE_STRIP;
|
||||
dparams->firstVertex = first;
|
||||
dparams->vertexCount = count;
|
||||
GLuint maxElements = dparams->firstVertex + dparams->vertexCount;
|
||||
@ -5996,7 +5996,7 @@ GLAPI void APIENTRY glDrawArrays( GLenum mode, GLint first, GLsizei count )
|
||||
GmmBaseBlock *pBaseBlock = (GmmBaseBlock *)driver->fpLoadProgramId;
|
||||
cellGcmSetUpdateFragmentProgramParameterInline( &_RGLState.fifo, gmmAddressToOffset(pBaseBlock->address, pBaseBlock->isMain) +driver->fpLoadProgramOffset );
|
||||
|
||||
cellGcmSetDrawArraysInline( &_RGLState.fifo, CELL_GCM_PRIMITIVE_QUADS, dparams->firstVertex, dparams->vertexCount);
|
||||
cellGcmSetDrawArraysInline( &_RGLState.fifo, mode == GL_QUADS ? CELL_GCM_PRIMITIVE_QUADS : CELL_GCM_PRIMITIVE_TRIANGLE_STRIP, dparams->firstVertex, dparams->vertexCount);
|
||||
}
|
||||
|
||||
GLAPI void APIENTRY glGenTextures( GLsizei n, GLuint *textures )
|
||||
|
38
gfx/gl.c
38
gfx/gl.c
@ -61,43 +61,6 @@
|
||||
#define NO_GL_CLAMP_TO_BORDER
|
||||
#endif
|
||||
|
||||
// FIXME: Support GL_TRIANGLE_STRIP in RGL.
|
||||
#if defined(HAVE_PSGL)
|
||||
#define VERTEX_RENDER_MODE GL_QUADS
|
||||
|
||||
// Used for the last pass when rendering to the back buffer.
|
||||
const GLfloat vertexes_flipped[] = {
|
||||
0, 0,
|
||||
0, 1,
|
||||
1, 1,
|
||||
1, 0
|
||||
};
|
||||
|
||||
// Used when rendering to an FBO.
|
||||
// Texture coords have to be aligned with vertex coordinates.
|
||||
static const GLfloat vertexes[] = {
|
||||
0, 1,
|
||||
0, 0,
|
||||
1, 0,
|
||||
1, 1
|
||||
};
|
||||
|
||||
static const GLfloat tex_coords[] = {
|
||||
0, 1,
|
||||
0, 0,
|
||||
1, 0,
|
||||
1, 1
|
||||
};
|
||||
|
||||
static inline void set_texture_coords(GLfloat *coords, GLfloat xamt, GLfloat yamt)
|
||||
{
|
||||
coords[1] = yamt;
|
||||
coords[4] = xamt;
|
||||
coords[6] = xamt;
|
||||
coords[7] = yamt;
|
||||
}
|
||||
|
||||
#else
|
||||
#define VERTEX_RENDER_MODE GL_TRIANGLE_STRIP
|
||||
// Used for the last pass when rendering to the back buffer.
|
||||
const GLfloat vertexes_flipped[] = {
|
||||
@ -130,7 +93,6 @@ static inline void set_texture_coords(GLfloat *coords, GLfloat xamt, GLfloat yam
|
||||
coords[5] = yamt;
|
||||
coords[7] = yamt;
|
||||
}
|
||||
#endif
|
||||
|
||||
const GLfloat white_color[] = {
|
||||
1, 1, 1, 1,
|
||||
|
Loading…
x
Reference in New Issue
Block a user