(PS3 RGL) Build fixes
This commit is contained in:
parent
4b06c44a27
commit
433346e2ea
|
@ -1,8 +1,5 @@
|
||||||
#define gcm_emit_at(buffer, location, word) (buffer)[(location)] = (word)
|
#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_method_at(buffer, location, method, n) \
|
|
||||||
gcm_emit_at((buffer),(location), (method) |((n) << 18))
|
|
||||||
|
|
||||||
#define gcm_finish_n_commands(buffer, n) (buffer) += n
|
#define gcm_finish_n_commands(buffer, n) (buffer) += n
|
||||||
|
|
||||||
static inline GLuint rglPlatformGetBitsPerPixel (GLenum internalFormat)
|
static inline GLuint rglPlatformGetBitsPerPixel (GLenum internalFormat)
|
||||||
|
@ -171,7 +168,7 @@ static inline void rglGcmSetInlineTransfer(struct CellGcmContextData *thisContex
|
||||||
#define rglGcmSetTextureBorderColor(thisContext, index, color) \
|
#define rglGcmSetTextureBorderColor(thisContext, index, color) \
|
||||||
gcm_emit_method_at(thisContext->current, 0, (CELL_GCM_NV4097_SET_TEXTURE_BORDER_COLOR + 0x20 * ((index))), 1); \
|
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_emit_at(thisContext->current, 1, color); \
|
||||||
gcm_finish_n_commands(thisContext>current, 2);
|
gcm_finish_n_commands(thisContext->current, 2);
|
||||||
|
|
||||||
#define rglDisableVertexAttribArrayNVInline(context, index) \
|
#define rglDisableVertexAttribArrayNVInline(context, index) \
|
||||||
RGLBIT_FALSE(context->attribs->EnabledMask, index); \
|
RGLBIT_FALSE(context->attribs->EnabledMask, index); \
|
||||||
|
@ -182,7 +179,7 @@ static inline void rglGcmSetInlineTransfer(struct CellGcmContextData *thisContex
|
||||||
RGLBIT_TRUE(context->attribs->DirtyMask, index);
|
RGLBIT_TRUE(context->attribs->DirtyMask, index);
|
||||||
|
|
||||||
#define rglGcmSetVertexData4f(thisContext, index, v) \
|
#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); \
|
memcpy(&thisContext->current[1], v, sizeof(float)*4); \
|
||||||
gcm_finish_n_commands(thisContext->current, 5);
|
gcm_finish_n_commands(thisContext->current, 5);
|
||||||
|
|
||||||
|
@ -396,7 +393,7 @@ static inline void rglGcmSetInlineTransfer(struct CellGcmContextData *thisContex
|
||||||
|
|
||||||
#define rglGcmSetZMinMaxControl(thisContext, cullNearFarEnable, zclampEnable, cullIgnoreW) \
|
#define rglGcmSetZMinMaxControl(thisContext, cullNearFarEnable, zclampEnable, cullIgnoreW) \
|
||||||
gcm_emit_method_at(thisContext->current, 0, CELL_GCM_NV4097_SET_ZMIN_MAX_CONTROL, 1); \
|
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);
|
gcm_finish_n_commands(thisContext->current, 2);
|
||||||
|
|
||||||
#define rglGcmSetVertexAttribOutputMask(thisContext, mask) \
|
#define rglGcmSetVertexAttribOutputMask(thisContext, mask) \
|
||||||
|
|
|
@ -1515,6 +1515,7 @@ GLboolean rglGcmInitFromRM( rglGcmResource *rmResource )
|
||||||
{
|
{
|
||||||
rglGcmState *rglGcmSt = &rglGcmState_i;
|
rglGcmState *rglGcmSt = &rglGcmState_i;
|
||||||
rglGcmFifo *fifo = (rglGcmFifo*)&rglGcmSt->fifo;
|
rglGcmFifo *fifo = (rglGcmFifo*)&rglGcmSt->fifo;
|
||||||
|
CellGcmContextData *thisContext = (CellGcmContextData*)gCellGcmCurrentContext;
|
||||||
GLuint i, ref;
|
GLuint i, ref;
|
||||||
unsigned int offset_bytes = 0;
|
unsigned int offset_bytes = 0;
|
||||||
|
|
||||||
|
@ -1532,36 +1533,35 @@ GLboolean rglGcmInitFromRM( rglGcmResource *rmResource )
|
||||||
|
|
||||||
// Set the GPU to a known state
|
// Set the GPU to a known state
|
||||||
// initialize the default OpenGL state
|
// initialize the default OpenGL state
|
||||||
rglGcmSetBlendColor(gCellGcmCurrentContext, 0, 0);
|
rglGcmSetBlendColor(thisContext, 0, 0);
|
||||||
rglGcmSetBlendEquation(gCellGcmCurrentContext, RGLGCM_FUNC_ADD, RGLGCM_FUNC_ADD );
|
rglGcmSetBlendEquation(thisContext, RGLGCM_FUNC_ADD, RGLGCM_FUNC_ADD );
|
||||||
rglGcmSetBlendFunc(gCellGcmCurrentContext, RGLGCM_ONE, RGLGCM_ZERO, RGLGCM_ONE, RGLGCM_ZERO );
|
rglGcmSetBlendFunc(thisContext, RGLGCM_ONE, RGLGCM_ZERO, RGLGCM_ONE, RGLGCM_ZERO );
|
||||||
rglGcmSetClearColor(gCellGcmCurrentContext, 0 );
|
rglGcmSetClearColor(thisContext, 0 );
|
||||||
rglGcmSetBlendEnable(gCellGcmCurrentContext, false );
|
rglGcmSetBlendEnable(thisContext, false );
|
||||||
rglGcmSetBlendEnableMrt(gCellGcmCurrentContext, false, false, false );
|
rglGcmSetBlendEnableMrt(thisContext, false, false, false );
|
||||||
|
|
||||||
for ( i = 0; i < RGLGCM_ATTRIB_COUNT; i++ )
|
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++ )
|
for ( i = 0; i < CELL_GCM_MAX_TEXIMAGE_COUNT; i++ )
|
||||||
{
|
{
|
||||||
static const GLuint borderColor = 0;
|
static const GLuint borderColor = 0;
|
||||||
|
|
||||||
// update the setTextureAddress Portion
|
// 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
|
// update the setTextureFilter Portion
|
||||||
rglGcmSetTextureFilter(gCellGcmCurrentContext, i, 0, CELL_GCM_TEXTURE_NEAREST_LINEAR, CELL_GCM_TEXTURE_LINEAR,
|
rglGcmSetTextureFilter(thisContext, i, 0, CELL_GCM_TEXTURE_NEAREST_LINEAR, CELL_GCM_TEXTURE_LINEAR, CELL_GCM_TEXTURE_CONVOLUTION_QUINCUNX );
|
||||||
CELL_GCM_TEXTURE_CONVOLUTION_QUINCUNX );
|
|
||||||
|
|
||||||
// update the texture control to setup anisotropic settings
|
// 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
|
// update border color
|
||||||
rglGcmSetTextureBorderColor(gCellGcmCurrentContext, i, borderColor );
|
rglGcmSetTextureBorderColor(thisContext, i, borderColor );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set zNear and zFar to the default 0.0f and 1.0f here
|
// Set zNear and zFar to the default 0.0f and 1.0f here
|
||||||
|
|
|
@ -1601,7 +1601,8 @@ GLAPI void APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count)
|
||||||
|
|
||||||
rglGcmSetFragmentProgramLoad(thisContext, &conf, CELL_GCM_LOCATION_LOCAL);
|
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->fpLoadProgramId = program->loadProgramId;
|
||||||
driver->fpLoadProgramOffset = program->loadProgramOffset;
|
driver->fpLoadProgramOffset = program->loadProgramOffset;
|
||||||
|
|
Loading…
Reference in New Issue