Skip to content

Commit

Permalink
(RGL PS3) Speedhacked render path for rglGcmSetDrawArrays
Browse files Browse the repository at this point in the history
  • Loading branch information
inactive123 committed Jul 28, 2013
1 parent bdf9c5e commit 29f0fd2
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion ps3/rgl/src/ps3/include/rgl-inline.h
Expand Up @@ -336,7 +336,7 @@ static inline void rglGcmSetFragmentProgramLoad(struct CellGcmContextData *thisC
(thisContext->current) += 2;
}

static inline void rglGcmSetDrawArrays(struct CellGcmContextData *thisContext, uint8_t mode,
static void rglGcmSetDrawArraysSlow(struct CellGcmContextData *thisContext, uint8_t mode,
uint32_t first, uint32_t count)
{
uint32_t lcount;
Expand Down Expand Up @@ -396,6 +396,34 @@ static inline void rglGcmSetDrawArrays(struct CellGcmContextData *thisContext, u
(thisContext->current) += 2;
}

static inline void rglGcmSetDrawArrays(struct CellGcmContextData *thisContext, uint8_t mode,
uint32_t first, uint32_t count)
{
if (mode == GL_TRIANGLE_STRIP && first == 0 && count == 4)
{
(thisContext->current)[0] = (((3) << (18)) | CELL_GCM_NV4097_INVALIDATE_VERTEX_FILE | (0x40000000));
(thisContext->current)[1] = 0;
(thisContext->current)[2] = 0;
(thisContext->current)[3] = 0;
(thisContext->current) += 4;

(thisContext->current)[0] = (((1) << (18)) | CELL_GCM_NV4097_SET_BEGIN_END);
(thisContext->current)[1] = ((mode));
(thisContext->current) += 2;

(thisContext->current)[0] = (((1) << (18)) | CELL_GCM_NV4097_DRAW_ARRAYS);
(thisContext->current)[1] = ((first) | (3 <<24));
(thisContext->current) += 2;
first += 4;

(thisContext->current)[0] = (((1) << (18)) | CELL_GCM_NV4097_SET_BEGIN_END);
(thisContext->current)[1] = (0);
(thisContext->current) += 2;
}
else
rglGcmSetDrawArraysSlow(thisContext, mode, first, count);
}

static inline void rglGcmSetVertexProgramLoad(struct CellGcmContextData *thisContext, const CellCgbVertexProgramConfiguration *conf, const void *ucode)
{
const uint32_t *rawData;
Expand Down

0 comments on commit 29f0fd2

Please sign in to comment.