(RGL PS3) Get rid of GCM_FUNC_BUFFERED

This commit is contained in:
twinaphex 2013-04-15 16:20:14 +02:00
parent 7a73c4f51c
commit d859189ab6
2 changed files with 13 additions and 23 deletions

View File

@ -43,24 +43,6 @@
}
#endif
/* [RSTENSON] To be able to build up buffered push buffers with GCM we need to use the
// cellGcmSetCurrentBuffer and reset the buffer with cellGcmDefualtCommandBuffer afterwards.
// Buffer size checks are not handled by these macros because they operate on pointers
// to data and not cellGcmContextDmas, thus the use of UnsafeInline versions vs Inline as above */
// This for pushing in to a memory buffer verses the actual active fifo
#define GCM_FUNC_BUFFERED_UNSAFE_INLINED
#ifdef GCM_FUNC_BUFFERED_UNSAFE_INLINED
#define GCM_FUNC_BUFFERED( GCM_FUNCTION, COMMAND_BUFFER, ...) \
{ \
CellGcmContextData gcmContext; \
gcmContext.current = (uint32_t *)COMMAND_BUFFER; \
GCM_FUNCTION ## UnsafeInline( &gcmContext, __VA_ARGS__ ); \
COMMAND_BUFFER = (typeof(COMMAND_BUFFER))gcmContext.current; \
}
#endif
typedef enum rglGcmEnum
{
// gleSetRenderTarget

View File

@ -569,9 +569,7 @@ static void setSamplervp (void *data, const void*v, int /* index */)
#undef ROW_MAJOR
#undef COL_MAJOR
// Previously from Shader.cpp
//---------------------------------------------------------------------------------------------------------
#define ROW_MAJOR 0
#define COL_MAJOR 1
@ -817,7 +815,11 @@ void rglCreatePushBuffer(void *data)
if ( parameterEntry->flags & CGP_CONTIGUOUS )
{
memset( rglGcmCurrent, 0, 4*( 4*registerCount + 3 ) );
GCM_FUNC_BUFFERED( cellGcmSetVertexProgramParameterBlock, rglGcmCurrent, parameterResource->resource, registerCount, ( float* )rglGcmCurrent );
CellGcmContextData gcmContext;
gcmContext.current = (uint32_t*)rglGcmCurrent;
cellGcmSetVertexProgramParameterBlockUnsafeInline(&gcmContext, parameterResource->resource, registerCount, ( float* )rglGcmCurrent );
rglGcmCurrent = (typeof(rglGcmCurrent))gcmContext.current;
rtParameter->pushBufferPointer = rglGcmCurrent - 4 * registerCount;
}
else
@ -830,7 +832,10 @@ void rglCreatePushBuffer(void *data)
if ( program->resources[resourceIndex] != 0xffff )
{
memset( rglGcmCurrent, 0, 4*( 4*registerStride + 3 ) );
GCM_FUNC_BUFFERED( cellGcmSetVertexProgramParameterBlock, rglGcmCurrent, program->resources[resourceIndex], registerStride, ( float* )rglGcmCurrent ); // GCM_PORT_TESTED [KHOFF]
CellGcmContextData gcmContext;
gcmContext.current = (uint32_t*)rglGcmCurrent;
cellGcmSetVertexProgramParameterBlockUnsafeInline(&gcmContext, program->resources[resourceIndex], registerStride, ( float* )rglGcmCurrent );
rglGcmCurrent = (typeof(rglGcmCurrent))gcmContext.current;
*( programPushBuffer++ ) = ( unsigned int* )( rglGcmCurrent - 4 * registerStride );
}
else
@ -1027,7 +1032,10 @@ void rglCreatePushBuffer(void *data)
if ( bufferSize > 0 )
{
int nopCount = ( program->constantPushBuffer + bufferSize ) - ( unsigned int * )rglGcmCurrent;
GCM_FUNC_BUFFERED( cellGcmSetNopCommand, rglGcmCurrent, nopCount ); // GCM_PORT_TESTED [KHOFF]
CellGcmContextData gcmContext;
gcmContext.current = (uint32_t*)rglGcmCurrent;
cellGcmSetNopCommandUnsafeInline(&gcmContext, nopCount);
rglGcmCurrent = (typeof(rglGcmCurrent))gcmContext.current;
}
}