mirror of
https://github.com/libretro/RetroArch
synced 2025-01-29 18:32:44 +00:00
(RGL PS3) Get rid of pushBack in RGLVector
This commit is contained in:
parent
dc98252d82
commit
346557c7d6
@ -25,10 +25,8 @@ namespace RGL
|
||||
for ( unsigned int i = 0;i < count;++i )
|
||||
( array + i )->~T();
|
||||
count = 0;
|
||||
}
|
||||
|
||||
if (array)
|
||||
free(array);
|
||||
}
|
||||
array = 0;
|
||||
}
|
||||
|
||||
|
@ -2515,6 +2515,26 @@ GLenum rglPlatformChooseInternalStorage (void *data, GLenum internalFormat )
|
||||
return GL_NO_ERROR;
|
||||
}
|
||||
|
||||
static inline void textureReferences_pushBack(rglTexture *element)
|
||||
{
|
||||
RGLcontext* LContext = (RGLcontext*)_CurrentContext;
|
||||
rglTexture *texture = (rglTexture*)rglGetCurrentTexture( LContext->CurrentImageUnit, GL_TEXTURE_2D );
|
||||
rglBufferObject *bufferObject = (rglBufferObject*)LContext->bufferObjectNameSpace.data[LContext->TextureBuffer];
|
||||
|
||||
uint32_t newCapacity = bufferObject->textureReferences.count + 1;
|
||||
|
||||
if (newCapacity > bufferObject->textureReferences.capacity)
|
||||
{
|
||||
if ( newCapacity > bufferObject->textureReferences.capacity )
|
||||
newCapacity = ( newCapacity > bufferObject->textureReferences.capacity + bufferObject->textureReferences.increment ) ? newCapacity : ( bufferObject->textureReferences.capacity + bufferObject->textureReferences.increment );
|
||||
|
||||
bufferObject->textureReferences.array = (rglTexture**)realloc((void *)(bufferObject->textureReferences.array), sizeof(rglTexture) * newCapacity);
|
||||
bufferObject->textureReferences.capacity = newCapacity;
|
||||
}
|
||||
new((void *)(bufferObject->textureReferences.array + bufferObject->textureReferences.count))rglTexture((const rglTexture&)element);
|
||||
++bufferObject->textureReferences.count;
|
||||
}
|
||||
|
||||
GLAPI void APIENTRY glTextureReferenceSCE( GLenum target, GLuint levels,
|
||||
GLuint baseWidth, GLuint baseHeight, GLuint baseDepth, GLenum internalFormat, GLuint pitch, GLintptr offset )
|
||||
{
|
||||
@ -2594,7 +2614,8 @@ GLAPI void APIENTRY glTextureReferenceSCE( GLenum target, GLuint levels,
|
||||
texture->revalidate |= RGL_TEXTURE_REVALIDATE_PARAMETERS;
|
||||
rglTextureTouchFBOs( texture );
|
||||
|
||||
bufferObject->textureReferences.pushBack( texture );
|
||||
textureReferences_pushBack(texture);
|
||||
|
||||
texture->referenceBuffer = bufferObject;
|
||||
texture->offset = offset;
|
||||
rglTextureTouchFBOs( texture );
|
||||
|
Loading…
x
Reference in New Issue
Block a user