(RGL) Replace messy initializers

This commit is contained in:
Twinaphex 2012-08-15 11:01:09 +02:00
parent 44ff5ec1c3
commit 83a361cd82

View File

@ -1464,34 +1464,34 @@ static void _RGLPlatformValidateTextureResources( jsTexture *texture )
const GLuint pixelBytes = layout->pixelBits / 8; const GLuint pixelBytes = layout->pixelBits / 8;
RGLSurface src = { RGLSurface src;
source: SURFACE_SOURCE_TEMPORARY, src.source = SURFACE_SOURCE_TEMPORARY;
width: 0, src.width = 0;
height: 0, src.height = 0;
bpp: pixelBytes, src.bpp = pixelBytes;
pitch: 0, src.pitch = 0;
format: layout->internalFormat, src.format = layout->internalFormat;
pool: SURFACE_POOL_LINEAR, src.pool = SURFACE_POOL_LINEAR;
ppuData: NULL, src.ppuData = NULL;
dataId: GMM_ERROR, src.dataId = GMM_ERROR;
dataIdOffset:0, src.dataIdOffset = 0;
};
RGLSurface dst = { RGLSurface dst;
source: SURFACE_SOURCE_TEXTURE, dst.source = SURFACE_SOURCE_TEXTURE;
width: 0, dst.width = 0;
height: 0, dst.height = 0;
bpp: pixelBytes, dst.bpp = pixelBytes;
pitch: layout->pitch, dst.pitch = layout->pitch;
format: layout->internalFormat, dst.format = layout->internalFormat;
pool: SURFACE_POOL_SYSTEM, dst.pool = SURFACE_POOL_SYSTEM;
ppuData: NULL, dst.ppuData = NULL;
dataId: GMM_ERROR, dst.dataId = GMM_ERROR;
dataIdOffset:0, dst.dataIdOffset = 0;
};
GLuint bounceBufferId = GMM_ERROR; GLuint bounceBufferId = GMM_ERROR;
jsImage *image = texture->image; jsImage *image = texture->image;
if(image->dataState == IMAGE_DATASTATE_HOST) if(image->dataState == IMAGE_DATASTATE_HOST)
{ {
src.ppuData = image->data; src.ppuData = image->data;
@ -4703,36 +4703,33 @@ static GLboolean _RGLPlatformTexturePBOImage(
else else
{ {
const GLuint bytesPerPixel = newLayout.pixelBits / 8; const GLuint bytesPerPixel = newLayout.pixelBits / 8;
RGLSurface src =
{ RGLSurface src;
source: SURFACE_SOURCE_PBO, src.source = SURFACE_SOURCE_PBO;
width: image->width, src.width = image->width;
height: image->height, src.height = image->height;
bpp: bytesPerPixel, src.bpp = bytesPerPixel;
pitch: pboPitch, src.pitch = pboPitch;
format: newLayout.internalFormat, src.format = newLayout.internalFormat;
pool: SURFACE_POOL_LINEAR, src.pool = SURFACE_POOL_LINEAR;
ppuData: NULL, src.ppuData = NULL;
dataId: gpuId, src.dataId = gpuId;
dataIdOffset: gpuIdOffset, src.dataIdOffset = gpuIdOffset;
};
texture->revalidate |= TEXTURE_REVALIDATE_LAYOUT; texture->revalidate |= TEXTURE_REVALIDATE_LAYOUT;
_RGLPlatformValidateTextureResources( texture ); _RGLPlatformValidateTextureResources( texture );
RGLSurface dst = RGLSurface dst;
{ dst.source = SURFACE_SOURCE_TEXTURE;
source: SURFACE_SOURCE_TEXTURE, dst.width = image->width;
width: image->width, dst.height = image->height;
height: image->height, dst.bpp = bytesPerPixel;
bpp: bytesPerPixel, dst.pitch = gcmTexture->gpuLayout.pitch;
pitch: gcmTexture->gpuLayout.pitch, dst.format = gcmTexture->gpuLayout.internalFormat;
format: gcmTexture->gpuLayout.internalFormat, dst.pool = gcmTexture->pool;
pool: gcmTexture->pool, dst.ppuData = NULL;
ppuData: NULL, dst.dataId = gcmTexture->gpuAddressId;
dataId: gcmTexture->gpuAddressId, dst.dataIdOffset = gcmTexture->gpuAddressIdOffset;
dataIdOffset: gcmTexture->gpuAddressIdOffset,
};
transfer_params_t transfer_params; transfer_params_t transfer_params;