X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fmain%2Freadpix.c;h=e16346896ba3efb4993f302da948de4b3c245d14;hb=3ade766684933ac84e41634429fb693f85353c11;hp=51a0b1553761339e0c2cc61df8edd539fc87fe36;hpb=3998cfa933dcd9134b75d9f0ae2c9cfcd6f2ee45;p=mesa.git diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c index 51a0b155376..e16346896ba 100644 --- a/src/mesa/main/readpix.c +++ b/src/mesa/main/readpix.c @@ -45,7 +45,7 @@ * Return true if the conversion L=R+G+B is needed. */ static GLboolean -need_rgb_to_luminance_conversion(gl_format texFormat, GLenum format) +need_rgb_to_luminance_conversion(mesa_format texFormat, GLenum format) { GLenum baseTexFormat = _mesa_get_format_base_format(texFormat); @@ -60,7 +60,7 @@ need_rgb_to_luminance_conversion(gl_format texFormat, GLenum format) * Return transfer op flags for this ReadPixels operation. */ static GLbitfield -get_readpixels_transfer_ops(const struct gl_context *ctx, gl_format texFormat, +get_readpixels_transfer_ops(const struct gl_context *ctx, mesa_format texFormat, GLenum format, GLenum type, GLboolean uses_blit) { GLbitfield transferOps = ctx->_ImageTransferState; @@ -424,13 +424,13 @@ read_rgba_pixels_swizzle(struct gl_context *ctx, GLboolean swizzle_rb = GL_FALSE, copy_xrgb = GL_FALSE; /* XXX we could check for other swizzle/special cases here as needed */ - if (rb->Format == MESA_FORMAT_RGBA8888_REV && + if (rb->Format == MESA_FORMAT_R8G8B8A8_UNORM && format == GL_BGRA && type == GL_UNSIGNED_INT_8_8_8_8_REV && !ctx->Pack.SwapBytes) { swizzle_rb = GL_TRUE; } - else if (rb->Format == MESA_FORMAT_XRGB8888 && + else if (rb->Format == MESA_FORMAT_B8G8R8X8_UNORM && format == GL_BGRA && type == GL_UNSIGNED_INT_8_8_8_8_REV && !ctx->Pack.SwapBytes) { @@ -493,7 +493,7 @@ slow_read_rgba_pixels( struct gl_context *ctx, GLbitfield transferOps ) { struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer; - const gl_format rbFormat = _mesa_get_srgb_format_linear(rb->Format); + const mesa_format rbFormat = _mesa_get_srgb_format_linear(rb->Format); void *rgba; GLubyte *dst, *map; int dstStride, stride, j; @@ -594,8 +594,8 @@ fast_read_depth_stencil_pixels(struct gl_context *ctx, if (rb != stencilRb) return GL_FALSE; - if (rb->Format != MESA_FORMAT_Z24_S8 && - rb->Format != MESA_FORMAT_S8_Z24) + if (rb->Format != MESA_FORMAT_S8_UINT_Z24_UNORM && + rb->Format != MESA_FORMAT_Z24_UNORM_X8_UINT) return GL_FALSE; ctx->Driver.MapRenderbuffer(ctx, rb, x, y, width, height, GL_MAP_READ_BIT,