(PS3) RGL can use GL_TRIANGLESTRIP now - get rid of messy

GL_QUAD hack in gl.c
This commit is contained in:
Twinaphex 2012-09-13 20:34:37 +02:00
parent 311eb65e7d
commit 440d731a53
2 changed files with 2 additions and 40 deletions

View File

@ -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 )

View File

@ -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,