(RGL PS3) rglDeallocateBuffer - turn into macro
This commit is contained in:
parent
b22842ede2
commit
46d2c31cd8
|
@ -63,6 +63,12 @@ static inline void rglGcmSetVertexProgramParameterBlock(struct CellGcmContextDat
|
||||||
#define SUBPIXEL_BITS 12
|
#define SUBPIXEL_BITS 12
|
||||||
#define SUBPIXEL_ADJUST (0.5/(1<<SUBPIXEL_BITS))
|
#define SUBPIXEL_ADJUST (0.5/(1<<SUBPIXEL_BITS))
|
||||||
|
|
||||||
|
#define rglDeallocateBuffer(bufferObject, rglBuffer) \
|
||||||
|
if (rglBuffer->pool == RGLGCM_SURFACE_POOL_LINEAR) \
|
||||||
|
gmmFree( rglBuffer->bufferId ); \
|
||||||
|
rglBuffer->pool = RGLGCM_SURFACE_POOL_NONE; \
|
||||||
|
rglBuffer->bufferId = GMM_ERROR
|
||||||
|
|
||||||
#define rglGcmSetTextureAddress(thisContext, index, wraps, wrapt, wrapr, unsignedRemap, zfunc, gamma) \
|
#define rglGcmSetTextureAddress(thisContext, index, wraps, wrapt, wrapr, unsignedRemap, zfunc, gamma) \
|
||||||
(thisContext->current)[0] = (((1) << (18)) | ((0x00001a08) + 0x20 * ((index)))); \
|
(thisContext->current)[0] = (((1) << (18)) | ((0x00001a08) + 0x20 * ((index)))); \
|
||||||
(thisContext->current)[1] = (((wraps)) | ((0) << 4) | (((wrapt)) << 8) | (((unsignedRemap)) << 12) | (((wrapr)) << 16) | (((gamma)) << 20) |((0) << 24) | (((zfunc)) << 28)); \
|
(thisContext->current)[1] = (((wraps)) | ((0) << 4) | (((wrapt)) << 8) | (((unsignedRemap)) << 12) | (((wrapr)) << 16) | (((gamma)) << 20) |((0) << 24) | (((zfunc)) << 28)); \
|
||||||
|
|
|
@ -762,33 +762,13 @@ void rglCreatePushBuffer(void *data)
|
||||||
PLATFORM BUFFER
|
PLATFORM BUFFER
|
||||||
============================================================ */
|
============================================================ */
|
||||||
|
|
||||||
static void rglDeallocateBuffer (void *data)
|
|
||||||
{
|
|
||||||
rglBufferObject *bufferObject = (rglBufferObject*)data;
|
|
||||||
rglGcmBufferObject *rglBuffer = (rglGcmBufferObject*)bufferObject->platformBufferObject;
|
|
||||||
|
|
||||||
switch ( rglBuffer->pool )
|
|
||||||
{
|
|
||||||
case RGLGCM_SURFACE_POOL_LINEAR:
|
|
||||||
gmmFree( rglBuffer->bufferId );
|
|
||||||
break;
|
|
||||||
case RGLGCM_SURFACE_POOL_NONE:
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
rglBuffer->pool = RGLGCM_SURFACE_POOL_NONE;
|
|
||||||
rglBuffer->bufferId = GMM_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void rglpsAllocateBuffer (void *data)
|
static void rglpsAllocateBuffer (void *data)
|
||||||
{
|
{
|
||||||
rglBufferObject *bufferObject = (rglBufferObject*)data;
|
rglBufferObject *bufferObject = (rglBufferObject*)data;
|
||||||
rglGcmBufferObject *rglBuffer = (rglGcmBufferObject*)bufferObject->platformBufferObject;
|
rglGcmBufferObject *rglBuffer = (rglGcmBufferObject*)bufferObject->platformBufferObject;
|
||||||
|
|
||||||
// free current buffer (if any)
|
// free current buffer (if any)
|
||||||
rglDeallocateBuffer( bufferObject );
|
rglDeallocateBuffer(bufferObject, rglBuffer);
|
||||||
|
|
||||||
// allocate in GPU memory
|
// allocate in GPU memory
|
||||||
rglBuffer->pool = RGLGCM_SURFACE_POOL_LINEAR;
|
rglBuffer->pool = RGLGCM_SURFACE_POOL_LINEAR;
|
||||||
|
@ -834,7 +814,8 @@ GLboolean rglpCreateBufferObject (void *data)
|
||||||
void rglPlatformDestroyBufferObject (void *data)
|
void rglPlatformDestroyBufferObject (void *data)
|
||||||
{
|
{
|
||||||
rglBufferObject *bufferObject = (rglBufferObject*)data;
|
rglBufferObject *bufferObject = (rglBufferObject*)data;
|
||||||
rglDeallocateBuffer( bufferObject );
|
rglGcmBufferObject *rglBuffer = (rglGcmBufferObject*)bufferObject->platformBufferObject;
|
||||||
|
rglDeallocateBuffer(bufferObject, rglBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void rglPlatformBufferObjectSetData(void *buf_data, GLintptr offset, GLsizeiptr size, const GLvoid *data, GLboolean tryImmediateCopy)
|
void rglPlatformBufferObjectSetData(void *buf_data, GLintptr offset, GLsizeiptr size, const GLvoid *data, GLboolean tryImmediateCopy)
|
||||||
|
|
Loading…
Reference in New Issue