mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-23 11:18:25 +00:00
(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_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) \
|
||||
(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)); \
|
||||
|
@ -762,33 +762,13 @@ void rglCreatePushBuffer(void *data)
|
||||
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)
|
||||
{
|
||||
rglBufferObject *bufferObject = (rglBufferObject*)data;
|
||||
rglGcmBufferObject *rglBuffer = (rglGcmBufferObject*)bufferObject->platformBufferObject;
|
||||
|
||||
// free current buffer (if any)
|
||||
rglDeallocateBuffer( bufferObject );
|
||||
rglDeallocateBuffer(bufferObject, rglBuffer);
|
||||
|
||||
// allocate in GPU memory
|
||||
rglBuffer->pool = RGLGCM_SURFACE_POOL_LINEAR;
|
||||
@ -834,7 +814,8 @@ GLboolean rglpCreateBufferObject (void *data)
|
||||
void rglPlatformDestroyBufferObject (void *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)
|
||||
|
Loading…
Reference in New Issue
Block a user