mirror of
https://github.com/libretro/RetroArch
synced 2025-04-16 08:43:10 +00:00
(RGL) Stripped some unused stuff
This commit is contained in:
parent
2d3fed35e7
commit
49e69a530d
@ -2482,9 +2482,7 @@ static GmmBlock *gmmAllocBlock(GmmAllocator *pAllocator, uint32_t size)
|
|||||||
{
|
{
|
||||||
pNewBlock = (GmmBlock *)gmmAllocFixed(0);
|
pNewBlock = (GmmBlock *)gmmAllocFixed(0);
|
||||||
if (pNewBlock == NULL)
|
if (pNewBlock == NULL)
|
||||||
{
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
|
|
||||||
memset(pNewBlock, 0, sizeof(GmmBlock));
|
memset(pNewBlock, 0, sizeof(GmmBlock));
|
||||||
|
|
||||||
@ -2541,9 +2539,7 @@ static GmmTileBlock *gmmFindFreeTileBlock(
|
|||||||
pNewBlock = (GmmTileBlock *)gmmAllocFixed(1);
|
pNewBlock = (GmmTileBlock *)gmmAllocFixed(1);
|
||||||
|
|
||||||
if (pNewBlock == NULL)
|
if (pNewBlock == NULL)
|
||||||
{
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
|
|
||||||
memset(pNewBlock, 0, sizeof(GmmTileBlock));
|
memset(pNewBlock, 0, sizeof(GmmTileBlock));
|
||||||
|
|
||||||
@ -2576,9 +2572,7 @@ static GmmTileBlock *gmmCreateTileBlock(
|
|||||||
address = pAllocator->tileStartAddress - size;
|
address = pAllocator->tileStartAddress - size;
|
||||||
|
|
||||||
if (address > pAllocator->startAddress + pAllocator->size)
|
if (address > pAllocator->startAddress + pAllocator->size)
|
||||||
{
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
|
|
||||||
if (pAllocator->pTail &&
|
if (pAllocator->pTail &&
|
||||||
pAllocator->pTail->base.address + pAllocator->pTail->base.size > address)
|
pAllocator->pTail->base.address + pAllocator->pTail->base.size > address)
|
||||||
@ -2625,23 +2619,15 @@ static void gmmFreeTileBlock(
|
|||||||
GmmAllocator *pAllocator;
|
GmmAllocator *pAllocator;
|
||||||
|
|
||||||
if (pTileBlock->pPrev)
|
if (pTileBlock->pPrev)
|
||||||
{
|
|
||||||
pTileBlock->pPrev->pNext = pTileBlock->pNext;
|
pTileBlock->pPrev->pNext = pTileBlock->pNext;
|
||||||
}
|
|
||||||
|
|
||||||
if (pTileBlock->pNext)
|
if (pTileBlock->pNext)
|
||||||
{
|
|
||||||
pTileBlock->pNext->pPrev = pTileBlock->pPrev;
|
pTileBlock->pNext->pPrev = pTileBlock->pPrev;
|
||||||
}
|
|
||||||
|
|
||||||
if (pTileBlock->base.isMain)
|
if (pTileBlock->base.isMain)
|
||||||
{
|
|
||||||
pAllocator = pGmmMainAllocator;
|
pAllocator = pGmmMainAllocator;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
pAllocator = pGmmLocalAllocator;
|
pAllocator = pGmmLocalAllocator;
|
||||||
}
|
|
||||||
|
|
||||||
if (pAllocator->pTileHead == pTileBlock)
|
if (pAllocator->pTileHead == pTileBlock)
|
||||||
{
|
{
|
||||||
@ -2753,9 +2739,7 @@ uint32_t gmmAllocExtendedTileBlock(const uint32_t size, const uint32_t tag)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (retId == 0)
|
if (retId == 0)
|
||||||
{
|
|
||||||
return GMM_ERROR;
|
return GMM_ERROR;
|
||||||
}
|
|
||||||
|
|
||||||
if (!resizeSucceed)
|
if (!resizeSucceed)
|
||||||
{
|
{
|
||||||
@ -2774,9 +2758,7 @@ static GmmTileBlock *gmmAllocTileBlock(
|
|||||||
GmmTileBlock *pBlock = gmmFindFreeTileBlock(pAllocator, size);
|
GmmTileBlock *pBlock = gmmFindFreeTileBlock(pAllocator, size);
|
||||||
|
|
||||||
if (pBlock == NULL)
|
if (pBlock == NULL)
|
||||||
{
|
|
||||||
pBlock = gmmCreateTileBlock(pAllocator, size);
|
pBlock = gmmCreateTileBlock(pAllocator, size);
|
||||||
}
|
|
||||||
|
|
||||||
return pBlock;
|
return pBlock;
|
||||||
}
|
}
|
||||||
@ -2788,48 +2770,34 @@ static void gmmFreeBlock(
|
|||||||
GmmAllocator *pAllocator;
|
GmmAllocator *pAllocator;
|
||||||
|
|
||||||
if (pBlock->pPrev)
|
if (pBlock->pPrev)
|
||||||
{
|
|
||||||
pBlock->pPrev->pNext = pBlock->pNext;
|
pBlock->pPrev->pNext = pBlock->pNext;
|
||||||
}
|
|
||||||
|
|
||||||
if (pBlock->pNext)
|
if (pBlock->pNext)
|
||||||
{
|
|
||||||
pBlock->pNext->pPrev = pBlock->pPrev;
|
pBlock->pNext->pPrev = pBlock->pPrev;
|
||||||
}
|
|
||||||
|
|
||||||
if (pBlock->base.isMain)
|
if (pBlock->base.isMain)
|
||||||
{
|
|
||||||
pAllocator = pGmmMainAllocator;
|
pAllocator = pGmmMainAllocator;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
pAllocator = pGmmLocalAllocator;
|
pAllocator = pGmmLocalAllocator;
|
||||||
}
|
|
||||||
|
|
||||||
if (pAllocator->pHead == pBlock)
|
if (pAllocator->pHead == pBlock)
|
||||||
{
|
{
|
||||||
pAllocator->pHead = pBlock->pNext;
|
pAllocator->pHead = pBlock->pNext;
|
||||||
|
|
||||||
if (pAllocator->pHead)
|
if (pAllocator->pHead)
|
||||||
{
|
|
||||||
pAllocator->pHead->pPrev = NULL;
|
pAllocator->pHead->pPrev = NULL;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (pAllocator->pTail == pBlock)
|
if (pAllocator->pTail == pBlock)
|
||||||
{
|
{
|
||||||
pAllocator->pTail = pBlock->pPrev;
|
pAllocator->pTail = pBlock->pPrev;
|
||||||
|
|
||||||
if (pAllocator->pTail)
|
if (pAllocator->pTail)
|
||||||
{
|
|
||||||
pAllocator->pTail->pNext = NULL;
|
pAllocator->pTail->pNext = NULL;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (pBlock->pPrev == NULL)
|
if (pBlock->pPrev == NULL)
|
||||||
{
|
|
||||||
pAllocator->pSweepHead = pAllocator->pHead;
|
pAllocator->pSweepHead = pAllocator->pHead;
|
||||||
}
|
|
||||||
else if (pBlock->pPrev &&
|
else if (pBlock->pPrev &&
|
||||||
(pAllocator->pSweepHead == NULL ||
|
(pAllocator->pSweepHead == NULL ||
|
||||||
(pAllocator->pSweepHead &&
|
(pAllocator->pSweepHead &&
|
||||||
@ -2850,13 +2818,9 @@ static void gmmAddPendingFree(
|
|||||||
GmmAllocator *pAllocator;
|
GmmAllocator *pAllocator;
|
||||||
|
|
||||||
if (pBlock->base.isMain)
|
if (pBlock->base.isMain)
|
||||||
{
|
|
||||||
pAllocator = pGmmMainAllocator;
|
pAllocator = pGmmMainAllocator;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
pAllocator = pGmmLocalAllocator;
|
pAllocator = pGmmLocalAllocator;
|
||||||
}
|
|
||||||
|
|
||||||
if (pAllocator->pPendingFreeTail)
|
if (pAllocator->pPendingFreeTail)
|
||||||
{
|
{
|
||||||
@ -3011,11 +2975,9 @@ static inline void gmmMemcpy(const uint32_t dstOffset, const uint32_t srcOffset,
|
|||||||
uint32_t iterations = (moveSize+moveBlockSize-1)/moveBlockSize;
|
uint32_t iterations = (moveSize+moveBlockSize-1)/moveBlockSize;
|
||||||
|
|
||||||
for (uint32_t i=0; i<iterations; i++)
|
for (uint32_t i=0; i<iterations; i++)
|
||||||
{
|
|
||||||
gmmLocalMemcpy(dstOffset+(i*moveBlockSize), srcOffset+(i*moveBlockSize), moveBlockSize);
|
gmmLocalMemcpy(dstOffset+(i*moveBlockSize), srcOffset+(i*moveBlockSize), moveBlockSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static uint8_t gmmInternalSweep (void)
|
static uint8_t gmmInternalSweep (void)
|
||||||
{
|
{
|
||||||
@ -6687,11 +6649,6 @@ GLAPI void APIENTRY glViewport( GLint x, GLint y, GLsizei width, GLsizei height
|
|||||||
LContext->ViewPort.XSize, LContext->ViewPort.YSize, 0.0f, 1.0f);
|
LContext->ViewPort.XSize, LContext->ViewPort.YSize, 0.0f, 1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
jsTexture *_RGLGetCurrentTexture( const jsTextureImageUnit *unit, GLenum target )
|
jsTexture *_RGLGetCurrentTexture( const jsTextureImageUnit *unit, GLenum target )
|
||||||
{
|
{
|
||||||
PSGLcontext* LContext = _CurrentContext;
|
PSGLcontext* LContext = _CurrentContext;
|
||||||
@ -6704,21 +6661,6 @@ jsTexture *_RGLGetCurrentTexture( const jsTextureImageUnit *unit, GLenum target
|
|||||||
return defaultTexture;
|
return defaultTexture;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CgprogramHookFunction _cgProgramCreateHook = NULL;
|
CgprogramHookFunction _cgProgramCreateHook = NULL;
|
||||||
CgprogramHookFunction _cgProgramDestroyHook = NULL;
|
CgprogramHookFunction _cgProgramDestroyHook = NULL;
|
||||||
CgprogramCopyHookFunction _cgProgramCopyHook = NULL;
|
CgprogramCopyHookFunction _cgProgramCopyHook = NULL;
|
||||||
@ -7479,31 +7421,6 @@ CG_API void cgDestroyProgram( CGprogram program )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CG_API CGprofile cgGetProgramProfile( CGprogram prog )
|
|
||||||
{
|
|
||||||
if ( !CG_IS_PROGRAM( prog ) )
|
|
||||||
{
|
|
||||||
_RGLCgRaiseError( CG_INVALID_PROGRAM_HANDLE_ERROR );
|
|
||||||
return CG_PROFILE_UNKNOWN;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ( CGprofile )_cgGetProgPtr( prog )->header.profile;
|
|
||||||
}
|
|
||||||
|
|
||||||
CG_API CGprofile cgGetProgramDomainProfile( CGprogram program, int index )
|
|
||||||
{
|
|
||||||
if ( !CG_IS_PROGRAM( program ) )
|
|
||||||
{
|
|
||||||
_RGLCgRaiseError( CG_INVALID_PROGRAM_HANDLE_ERROR );
|
|
||||||
return CG_PROFILE_UNKNOWN;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( index >= 1 )
|
|
||||||
return CG_PROFILE_UNKNOWN;
|
|
||||||
|
|
||||||
return ( CGprofile )_cgGetProgPtr( program )->header.profile;
|
|
||||||
}
|
|
||||||
|
|
||||||
static CGprogram _RGLCgUpdateProgramAtIndex( CGprogramGroup group, int index, int refcount )
|
static CGprogram _RGLCgUpdateProgramAtIndex( CGprogramGroup group, int index, int refcount )
|
||||||
{
|
{
|
||||||
if ( index < ( int )group->programCount )
|
if ( index < ( int )group->programCount )
|
||||||
@ -8365,41 +8282,20 @@ CGGL_API void cgGLSetTextureParameter( CGparameter param, GLuint texobj )
|
|||||||
ptr->samplerSetter( ptr, &texobj, 0 );
|
ptr->samplerSetter( ptr, &texobj, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
CGGL_API GLuint cgGLGetTextureParameter( CGparameter param )
|
|
||||||
{
|
|
||||||
CgRuntimeParameter* ptr = _cgGLTestTextureParameter( param );
|
|
||||||
if ( ptr == NULL ) return 0;
|
|
||||||
if ( !( ptr->parameterEntry->flags & CGPF_REFERENCED ) ) { _RGLCgRaiseError( CG_INVALID_PARAMETER_ERROR ); return 0; }
|
|
||||||
return *( GLuint* )ptr->pushBufferPointer;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
CGGL_API void cgGLEnableTextureParameter( CGparameter param )
|
CGGL_API void cgGLEnableTextureParameter( CGparameter param )
|
||||||
{
|
{
|
||||||
CgRuntimeParameter* ptr = _cgGLTestTextureParameter( param );
|
CgRuntimeParameter* ptr = _cgGLTestTextureParameter( param );
|
||||||
ptr->samplerSetter( ptr, NULL, 0 );
|
ptr->samplerSetter( ptr, NULL, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
CGGL_API void cgGLDisableTextureParameter( CGparameter param )
|
static void _RGLCgContextZero( _CGcontext* p )
|
||||||
{
|
|
||||||
if ( _cgGLTestTextureParameter( param ) )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CGGL_API void cgGLSetDebugMode( CGbool debug )
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
void _RGLCgContextZero( _CGcontext* p )
|
|
||||||
{
|
{
|
||||||
memset( p, 0, sizeof( *p ) );
|
memset( p, 0, sizeof( *p ) );
|
||||||
p->compileType = CG_UNKNOWN;
|
p->compileType = CG_UNKNOWN;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void _RGLCgContextPushFront( _CGcontext* ctx )
|
static void _RGLCgContextPushFront( _CGcontext* ctx )
|
||||||
{
|
{
|
||||||
if ( _CurrentContext->RGLcgContextHead )
|
if ( _CurrentContext->RGLcgContextHead )
|
||||||
{
|
{
|
||||||
@ -8417,25 +8313,6 @@ static void destroy_context( _CGcontext*ctx )
|
|||||||
free( ctx );
|
free( ctx );
|
||||||
}
|
}
|
||||||
|
|
||||||
void _RGLCgContextPopFront()
|
|
||||||
{
|
|
||||||
if ( _CurrentContext->RGLcgContextHead )
|
|
||||||
{
|
|
||||||
_CGcontext* head = _cgGetContextPtr( _CurrentContext->RGLcgContextHead );
|
|
||||||
_CGcontext* temp = head->next;
|
|
||||||
destroy_context( head );
|
|
||||||
|
|
||||||
if ( temp )
|
|
||||||
{
|
|
||||||
_CurrentContext->RGLcgContextHead = temp->id;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_CurrentContext->RGLcgContextHead = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CG_API CGcontext cgCreateContext( void )
|
CG_API CGcontext cgCreateContext( void )
|
||||||
{
|
{
|
||||||
_CGcontext* ptr = NULL;
|
_CGcontext* ptr = NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user