(RGL PS3) More replacements of GCM_FUNC

This commit is contained in:
twinaphex 2013-04-14 22:11:12 +02:00
parent 9d1eab4b0e
commit 0af13a9059
3 changed files with 20 additions and 4 deletions

View File

@ -163,6 +163,21 @@ static inline GLuint rglPlatformGetBitsPerPixel (GLenum internalFormat)
(thisContext->current)[8] = (s[3].u); \
(thisContext->current) += 9;
#define rglGcmSetDitherEnable(thisContext, enable) \
(thisContext->current)[0] = (((1) << (18)) | ((0x00000300))); \
(thisContext->current)[1] = (enable); \
(thisContext->current) += 2;
#define rglGcmSetReferenceCommand(thisContext, ref) \
(thisContext->current)[0] = (((1) << (18)) | ((0x00000050))); \
(thisContext->current)[1] = (ref); \
(thisContext->current) += 2;
#define rglGcmSetZMinMaxControl(thisContext, cullNearFarEnable, zclampEnable, cullIgnoreW) \
(thisContext->current)[0] = (((1) << (18)) | ((0x00001d78))); \
(thisContext->current)[1] = ((cullNearFarEnable) | ((zclampEnable) << 4) | ((cullIgnoreW)<<8)); \
(thisContext->current) += 2;
static inline void rglGcmSetDrawArrays(struct CellGcmContextData *thisContext, uint8_t mode,
uint32_t first, uint32_t count)
{

View File

@ -1604,10 +1604,11 @@ void rglGcmFifoFlush (void *data)
GLuint rglGcmFifoPutReference (void *data)
{
CellGcmContextData *thisContext = (CellGcmContextData*)gCellGcmCurrentContext;
rglGcmFifo *fifo = (rglGcmFifo*)data;
fifo->lastSWReferenceWritten++;
GCM_FUNC( cellGcmSetReferenceCommand, fifo->lastSWReferenceWritten );
rglGcmSetReferenceCommand(thisContext, fifo->lastSWReferenceWritten );
if (( fifo->lastSWReferenceWritten & 0x7fffffff ) == 0 )
rglGcmFifoFinish( fifo );
@ -1715,7 +1716,7 @@ void rglGcmSetOpenGLState (void *data)
GCM_FUNC( cellGcmSetVertexDataArray, i, 0, 0, 0, CELL_GCM_VERTEX_F, CELL_GCM_LOCATION_LOCAL, 0);
}
GCM_FUNC( cellGcmSetDitherEnable, RGLGCM_TRUE );
rglGcmSetDitherEnable(thisContext, RGLGCM_TRUE );
for ( i = 0; i < RGLGCM_MAX_TEXIMAGE_COUNT; i++ )
{
@ -3140,7 +3141,7 @@ GLAPI void RGL_EXPORT psglSwap (void)
const char * __restrict v = driver->sharedVPConstants;
GCM_FUNC( cellGcmSetVertexProgramParameterBlock, 0, 8, ( float* )v ); // GCM_PORT_UNTESTED [KHOFF]
GCM_FUNC( cellGcmSetDitherEnable, RGLGCM_TRUE );
rglGcmSetDitherEnable(thisContext, RGLGCM_TRUE );
RGLcontext *context = (RGLcontext*)_CurrentContext;
context->needValidate = RGL_VALIDATE_ALL;

View File

@ -1883,7 +1883,7 @@ GLAPI void APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count)
GCM_FUNC( cellGcmSetFragmentProgramLoad, &conf );
GCM_FUNC( cellGcmSetZMinMaxControl, ( program->header.fragmentProgram.flags & CGF_DEPTHREPLACE ) ? RGLGCM_FALSE : RGLGCM_TRUE, RGLGCM_FALSE, RGLGCM_FALSE );
rglGcmSetZMinMaxControl(thisContext, ( program->header.fragmentProgram.flags & CGF_DEPTHREPLACE ) ? RGLGCM_FALSE : RGLGCM_TRUE, RGLGCM_FALSE, RGLGCM_FALSE );
driver->fpLoadProgramId = program->loadProgramId;
driver->fpLoadProgramOffset = program->loadProgramOffset;