[Mesa-dev] [PATCH 1/4] meta: In CopyTexSubImage, use matching format for Z32_FLOAT_X24S8 textures.
Eric Anholt
eric at anholt.net
Mon Jun 3 09:02:26 PDT 2013
Paul Berry <stereotype441 at gmail.com> writes:
> The meta path for CopyTexSubImage operates by reading the source image
> to a temporary buffer using glReadPixels and then uploading it to the
> texture using TexSubImage. This patch ensures that when the texture
> format is MESA_FORMAT_Z32_FLOAT_X24S8, we use the proper image type
> for the temporary buffer (GL_FLOAT_32_UNSIGNED_INT_24_8_REV).
>
> Fixes some failures with piglit tests "copyteximage
> {1D,2D,CUBE,RECT,2D_ARRAY}".
> ---
> src/mesa/drivers/common/meta.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
> index ca5f5a1..637ec70 100644
> --- a/src/mesa/drivers/common/meta.c
> +++ b/src/mesa/drivers/common/meta.c
> @@ -3767,7 +3767,10 @@ get_temp_image_type(struct gl_context *ctx, gl_format format)
> case GL_DEPTH_COMPONENT:
> return GL_UNSIGNED_INT;
> case GL_DEPTH_STENCIL:
> - return GL_UNSIGNED_INT_24_8;
> + if (format == MESA_FORMAT_Z32_FLOAT_X24S8)
> + return GL_FLOAT_32_UNSIGNED_INT_24_8_REV;
> + else
> + return GL_UNSIGNED_INT_24_8;
> default:
> _mesa_problem(ctx, "Unexpected format %d in get_temp_image_type()",
> baseFormat);
> --
> 1.8.3
I think the version of this patch I sent out on Thursday is better.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130603/e477aa24/attachment.pgp>
More information about the mesa-dev
mailing list