mirror of
https://github.com/libretro/RetroArch
synced 2025-04-18 14:42:30 +00:00
(RGL PS3) Depth and baseDepth - hardcode at 1
This commit is contained in:
parent
894b2870c0
commit
5dc58dc461
@ -3502,48 +3502,42 @@ static void rglRawRasterToImage(const void *in_data,
|
|||||||
{
|
{
|
||||||
memcpy((char*)image->data +
|
memcpy((char*)image->data +
|
||||||
x*image->xstride + y*image->ystride + z*image->zstride,
|
x*image->xstride + y*image->ystride + z*image->zstride,
|
||||||
raster->data, raster->depth*raster->zstride );
|
raster->data, raster->zstride );
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if ( raster->xstride == image->xstride )
|
else if ( raster->xstride == image->xstride )
|
||||||
{
|
{
|
||||||
const GLuint lineBytes = raster->width * raster->xstride;
|
const GLuint lineBytes = raster->width * raster->xstride;
|
||||||
for ( int i = 0; i < raster->depth; ++i )
|
for ( int j = 0; j < raster->height; ++j )
|
||||||
{
|
{
|
||||||
for ( int j = 0; j < raster->height; ++j )
|
const char *src = ( const char * )raster->data +
|
||||||
{
|
raster->zstride + j * raster->ystride;
|
||||||
const char *src = ( const char * )raster->data +
|
char *dst = ( char * )image->data +
|
||||||
i * raster->zstride + j * raster->ystride;
|
z * image->zstride +
|
||||||
char *dst = ( char * )image->data +
|
( j + y ) * image->ystride +
|
||||||
( i + z ) * image->zstride +
|
x * image->xstride;
|
||||||
( j + y ) * image->ystride +
|
memcpy( dst, src, lineBytes );
|
||||||
x * image->xstride;
|
|
||||||
memcpy( dst, src, lineBytes );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( int i = 0; i < raster->depth; ++i )
|
for ( int j = 0; j < raster->height; ++j )
|
||||||
{
|
{
|
||||||
for ( int j = 0; j < raster->height; ++j )
|
const char *src = ( const char * )raster->data +
|
||||||
|
raster->zstride + j * raster->ystride;
|
||||||
|
char *dst = ( char * )image->data +
|
||||||
|
z * image->zstride +
|
||||||
|
( j + y ) * image->ystride +
|
||||||
|
x * image->xstride;
|
||||||
|
|
||||||
|
for ( int k = 0; k < raster->width; ++k )
|
||||||
{
|
{
|
||||||
const char *src = ( const char * )raster->data +
|
memcpy( dst, src, size );
|
||||||
i * raster->zstride + j * raster->ystride;
|
|
||||||
char *dst = ( char * )image->data +
|
|
||||||
( i + z ) * image->zstride +
|
|
||||||
( j + y ) * image->ystride +
|
|
||||||
x * image->xstride;
|
|
||||||
|
|
||||||
for ( int k = 0; k < raster->width; ++k )
|
src += raster->xstride;
|
||||||
{
|
dst += image->xstride;
|
||||||
memcpy( dst, src, size );
|
|
||||||
|
|
||||||
src += raster->xstride;
|
|
||||||
dst += image->xstride;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2036,7 +2036,7 @@ static void rglPlatformValidateTextureResources (void *data)
|
|||||||
newLayout.faces = 1;
|
newLayout.faces = 1;
|
||||||
newLayout.baseWidth = image->width;
|
newLayout.baseWidth = image->width;
|
||||||
newLayout.baseHeight = image->height;
|
newLayout.baseHeight = image->height;
|
||||||
newLayout.baseDepth = image->depth;
|
newLayout.baseDepth = 1;
|
||||||
newLayout.internalFormat = ( rglGcmEnum )image->internalFormat;
|
newLayout.internalFormat = ( rglGcmEnum )image->internalFormat;
|
||||||
newLayout.pixelBits = rglPlatformGetBitsPerPixel( newLayout.internalFormat );
|
newLayout.pixelBits = rglPlatformGetBitsPerPixel( newLayout.internalFormat );
|
||||||
newLayout.pitch = GET_TEXTURE_PITCH(texture);
|
newLayout.pitch = GET_TEXTURE_PITCH(texture);
|
||||||
@ -2099,9 +2099,7 @@ source: RGLGCM_SURFACE_SOURCE_TEXTURE,
|
|||||||
|
|
||||||
if ( image->dataState == RGL_IMAGE_DATASTATE_HOST )
|
if ( image->dataState == RGL_IMAGE_DATASTATE_HOST )
|
||||||
{
|
{
|
||||||
// lazy allocation of bounce buffer
|
bounceBufferId = gmmAlloc(gcmTexture->gpuSize);
|
||||||
if ( bounceBufferId == GMM_ERROR && layout->baseDepth == 1 )
|
|
||||||
bounceBufferId = gmmAlloc(gcmTexture->gpuSize);
|
|
||||||
|
|
||||||
if ( bounceBufferId != GMM_ERROR )
|
if ( bounceBufferId != GMM_ERROR )
|
||||||
{
|
{
|
||||||
@ -2445,7 +2443,7 @@ source: RGLGCM_SURFACE_SOURCE_TEXTURE,
|
|||||||
|
|
||||||
platformTexture->gcmTexture.width = layout->baseWidth;
|
platformTexture->gcmTexture.width = layout->baseWidth;
|
||||||
platformTexture->gcmTexture.height = layout->baseHeight;
|
platformTexture->gcmTexture.height = layout->baseHeight;
|
||||||
platformTexture->gcmTexture.depth = layout->baseDepth;
|
platformTexture->gcmTexture.depth = 1;
|
||||||
platformTexture->gcmTexture.pitch = layout->pitch;
|
platformTexture->gcmTexture.pitch = layout->pitch;
|
||||||
platformTexture->gcmTexture.mipmap = 1;
|
platformTexture->gcmTexture.mipmap = 1;
|
||||||
platformTexture->gcmTexture.cubemap = CELL_GCM_FALSE;
|
platformTexture->gcmTexture.cubemap = CELL_GCM_FALSE;
|
||||||
@ -2532,8 +2530,7 @@ GLenum rglPlatformChooseInternalStorage (void *data, GLenum internalFormat )
|
|||||||
// this member is used to configure texture loads and unloads. If this
|
// this member is used to configure texture loads and unloads. If this
|
||||||
// value is wrong (e.g. contains unnecessary padding) it will corrupt
|
// value is wrong (e.g. contains unnecessary padding) it will corrupt
|
||||||
// the GPU memory layout.
|
// the GPU memory layout.
|
||||||
image->storageSize = rglGetPixelSize(image->format, image->type) *
|
image->storageSize = rglGetPixelSize(image->format, image->type) * image->width * image->height;
|
||||||
image->width * image->height * image->depth;
|
|
||||||
|
|
||||||
return GL_NO_ERROR;
|
return GL_NO_ERROR;
|
||||||
}
|
}
|
||||||
@ -2547,13 +2544,13 @@ GLAPI void APIENTRY glTextureReferenceSCE( GLenum target, GLuint levels,
|
|||||||
rglTexture *texture = rglGetCurrentTexture( LContext->CurrentImageUnit, target );
|
rglTexture *texture = rglGetCurrentTexture( LContext->CurrentImageUnit, target );
|
||||||
rglBufferObject *bufferObject =
|
rglBufferObject *bufferObject =
|
||||||
(rglBufferObject*)LContext->bufferObjectNameSpace.data[LContext->TextureBuffer];
|
(rglBufferObject*)LContext->bufferObjectNameSpace.data[LContext->TextureBuffer];
|
||||||
rglReallocateImages( texture, 0, MAX( baseWidth, MAX( baseHeight, baseDepth ) ) );
|
rglReallocateImages( texture, 0, MAX(baseWidth, baseHeight));
|
||||||
|
|
||||||
image = texture->image;
|
image = texture->image;
|
||||||
|
|
||||||
image->width = baseWidth;
|
image->width = baseWidth;
|
||||||
image->height = baseHeight;
|
image->height = baseHeight;
|
||||||
image->depth = baseDepth;
|
image->depth = 1;
|
||||||
image->alignment = LContext->unpackAlignment;
|
image->alignment = LContext->unpackAlignment;
|
||||||
|
|
||||||
image->xblk = 0;
|
image->xblk = 0;
|
||||||
@ -2596,7 +2593,7 @@ GLAPI void APIENTRY glTextureReferenceSCE( GLenum target, GLuint levels,
|
|||||||
newLayout.faces = 1;
|
newLayout.faces = 1;
|
||||||
newLayout.baseWidth = image->width;
|
newLayout.baseWidth = image->width;
|
||||||
newLayout.baseHeight = image->height;
|
newLayout.baseHeight = image->height;
|
||||||
newLayout.baseDepth = image->depth;
|
newLayout.baseDepth = 1;
|
||||||
newLayout.internalFormat = ( rglGcmEnum )image->internalFormat;
|
newLayout.internalFormat = ( rglGcmEnum )image->internalFormat;
|
||||||
newLayout.pixelBits = rglPlatformGetBitsPerPixel( newLayout.internalFormat );
|
newLayout.pixelBits = rglPlatformGetBitsPerPixel( newLayout.internalFormat );
|
||||||
newLayout.pitch = pitch ? pitch : GET_TEXTURE_PITCH(texture);
|
newLayout.pitch = pitch ? pitch : GET_TEXTURE_PITCH(texture);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user