(PS3 RGL) Build fixes

This commit is contained in:
twinaphex 2014-02-18 18:04:32 +01:00
parent 4b06c44a27
commit 433346e2ea
3 changed files with 22 additions and 24 deletions

View File

@ -1,8 +1,5 @@
#define gcm_emit_at(buffer, location, word) (buffer)[(location)] = (word)
#define gcm_emit_method_at(buffer, location, method, n) \
gcm_emit_at((buffer),(location), (method) |((n) << 18))
#define gcm_emit_at(buffer, location, word) ((buffer)[(location)] = (word))
#define gcm_emit_method_at(buffer, location, method, n) gcm_emit_at((buffer),(location), (method) |((n) << 18))
#define gcm_finish_n_commands(buffer, n) (buffer) += n
static inline GLuint rglPlatformGetBitsPerPixel (GLenum internalFormat)
@ -171,7 +168,7 @@ static inline void rglGcmSetInlineTransfer(struct CellGcmContextData *thisContex
#define rglGcmSetTextureBorderColor(thisContext, index, color) \
gcm_emit_method_at(thisContext->current, 0, (CELL_GCM_NV4097_SET_TEXTURE_BORDER_COLOR + 0x20 * ((index))), 1); \
gcm_emit_at(thisContext->current, 1, color); \
gcm_finish_n_commands(thisContext>current, 2);
gcm_finish_n_commands(thisContext->current, 2);
#define rglDisableVertexAttribArrayNVInline(context, index) \
RGLBIT_FALSE(context->attribs->EnabledMask, index); \
@ -182,7 +179,7 @@ static inline void rglGcmSetInlineTransfer(struct CellGcmContextData *thisContex
RGLBIT_TRUE(context->attribs->DirtyMask, index);
#define rglGcmSetVertexData4f(thisContext, index, v) \
gcm_emit_method_at(thisContext->current, 0, (CELL_GCM_NV4097_SET_VERTEX_DATA4F_M + (index) * 16), 4) \
gcm_emit_method_at(thisContext->current, 0, (CELL_GCM_NV4097_SET_VERTEX_DATA4F_M + (index) * 16), 4); \
memcpy(&thisContext->current[1], v, sizeof(float)*4); \
gcm_finish_n_commands(thisContext->current, 5);
@ -396,7 +393,7 @@ static inline void rglGcmSetInlineTransfer(struct CellGcmContextData *thisContex
#define rglGcmSetZMinMaxControl(thisContext, cullNearFarEnable, zclampEnable, cullIgnoreW) \
gcm_emit_method_at(thisContext->current, 0, CELL_GCM_NV4097_SET_ZMIN_MAX_CONTROL, 1); \
gcm_emit_at(thisContext->current, 1, ((cullNearFarEnable) | ((zclampEnable) << 4) | ((cullIgnoreW)<<8)); \
gcm_emit_at(thisContext->current, 1, ((cullNearFarEnable) | ((zclampEnable) << 4) | ((cullIgnoreW)<<8))); \
gcm_finish_n_commands(thisContext->current, 2);
#define rglGcmSetVertexAttribOutputMask(thisContext, mask) \
@ -568,7 +565,7 @@ static void rglGcmSetDrawArraysSlow(struct CellGcmContextData *thisContext, uint
for(j = 0; j < CELL_GCM_MAX_METHOD_COUNT; j++)
{
thisContext->current[0] = ((first) | ((255U)<<24));
gcm_finish_n_commands(thisContext->current, 1);
gcm_finish_n_commands(thisContext->current, 1);
first += 256;
}
}
@ -581,7 +578,7 @@ static void rglGcmSetDrawArraysSlow(struct CellGcmContextData *thisContext, uint
for(j = 0;j < rest; j++)
{
thisContext->current[0] = ((first) | ((255U)<<24));
gcm_finish_n_commands(thisContext->current, 1);
gcm_finish_n_commands(thisContext->current, 1);
first += 256;
}
}

View File

@ -1515,6 +1515,7 @@ GLboolean rglGcmInitFromRM( rglGcmResource *rmResource )
{
rglGcmState *rglGcmSt = &rglGcmState_i;
rglGcmFifo *fifo = (rglGcmFifo*)&rglGcmSt->fifo;
CellGcmContextData *thisContext = (CellGcmContextData*)gCellGcmCurrentContext;
GLuint i, ref;
unsigned int offset_bytes = 0;
@ -1532,36 +1533,35 @@ GLboolean rglGcmInitFromRM( rglGcmResource *rmResource )
// Set the GPU to a known state
// initialize the default OpenGL state
rglGcmSetBlendColor(gCellGcmCurrentContext, 0, 0);
rglGcmSetBlendEquation(gCellGcmCurrentContext, RGLGCM_FUNC_ADD, RGLGCM_FUNC_ADD );
rglGcmSetBlendFunc(gCellGcmCurrentContext, RGLGCM_ONE, RGLGCM_ZERO, RGLGCM_ONE, RGLGCM_ZERO );
rglGcmSetClearColor(gCellGcmCurrentContext, 0 );
rglGcmSetBlendEnable(gCellGcmCurrentContext, false );
rglGcmSetBlendEnableMrt(gCellGcmCurrentContext, false, false, false );
rglGcmSetBlendColor(thisContext, 0, 0);
rglGcmSetBlendEquation(thisContext, RGLGCM_FUNC_ADD, RGLGCM_FUNC_ADD );
rglGcmSetBlendFunc(thisContext, RGLGCM_ONE, RGLGCM_ZERO, RGLGCM_ONE, RGLGCM_ZERO );
rglGcmSetClearColor(thisContext, 0 );
rglGcmSetBlendEnable(thisContext, false );
rglGcmSetBlendEnableMrt(thisContext, false, false, false );
for ( i = 0; i < RGLGCM_ATTRIB_COUNT; i++ )
{
rglGcmSetVertexDataArray(gCellGcmCurrentContext, i, 0, 0, 0, CELL_GCM_VERTEX_F, CELL_GCM_LOCATION_LOCAL, 0);
rglGcmSetVertexDataArray(thisContext, i, 0, 0, 0, CELL_GCM_VERTEX_F, CELL_GCM_LOCATION_LOCAL, 0);
}
rglGcmSetDitherEnable(gCellGcmCurrentContext, true );
rglGcmSetDitherEnable(thisContext, true );
for ( i = 0; i < CELL_GCM_MAX_TEXIMAGE_COUNT; i++ )
{
static const GLuint borderColor = 0;
// update the setTextureAddress Portion
rglGcmSetTextureAddress(gCellGcmCurrentContext, i, CELL_GCM_TEXTURE_WRAP, CELL_GCM_TEXTURE_WRAP, CELL_GCM_TEXTURE_CLAMP_TO_EDGE, CELL_GCM_TEXTURE_UNSIGNED_REMAP_NORMAL, CELL_GCM_TEXTURE_ZFUNC_NEVER, 0 );
rglGcmSetTextureAddress(thisContext, i, CELL_GCM_TEXTURE_WRAP, CELL_GCM_TEXTURE_WRAP, CELL_GCM_TEXTURE_CLAMP_TO_EDGE, CELL_GCM_TEXTURE_UNSIGNED_REMAP_NORMAL, CELL_GCM_TEXTURE_ZFUNC_NEVER, 0 );
// update the setTextureFilter Portion
rglGcmSetTextureFilter(gCellGcmCurrentContext, i, 0, CELL_GCM_TEXTURE_NEAREST_LINEAR, CELL_GCM_TEXTURE_LINEAR,
CELL_GCM_TEXTURE_CONVOLUTION_QUINCUNX );
rglGcmSetTextureFilter(thisContext, i, 0, CELL_GCM_TEXTURE_NEAREST_LINEAR, CELL_GCM_TEXTURE_LINEAR, CELL_GCM_TEXTURE_CONVOLUTION_QUINCUNX );
// update the texture control to setup anisotropic settings
rglGcmSetTextureControl(gCellGcmCurrentContext, i, CELL_GCM_TRUE, 0, 12 << 8, CELL_GCM_TEXTURE_MAX_ANISO_1 );
rglGcmSetTextureControl(thisContext, i, CELL_GCM_TRUE, 0, 12 << 8, CELL_GCM_TEXTURE_MAX_ANISO_1 );
// update border color
rglGcmSetTextureBorderColor(gCellGcmCurrentContext, i, borderColor );
rglGcmSetTextureBorderColor(thisContext, i, borderColor );
}
// Set zNear and zFar to the default 0.0f and 1.0f here

View File

@ -1601,7 +1601,8 @@ GLAPI void APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count)
rglGcmSetFragmentProgramLoad(thisContext, &conf, CELL_GCM_LOCATION_LOCAL);
rglGcmSetZMinMaxControl(thisContext, ( program->header.fragmentProgram.flags & CGF_DEPTHREPLACE ) ? false : true, false, false );
bool cullNearFarEnable = (program->header.fragmentProgram.flags & CGF_DEPTHREPLACE ) ? false : true;
rglGcmSetZMinMaxControl(thisContext, cullNearFarEnable, false, false );
driver->fpLoadProgramId = program->loadProgramId;
driver->fpLoadProgramOffset = program->loadProgramOffset;