[Mesa-dev] [PATCH 1/4] meta: In CopyTexSubImage, use matching format for Z32_FLOAT_X24S8 textures.
Paul Berry
stereotype441 at gmail.com
Sun Jun 2 16:50:42 PDT 2013
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
More information about the mesa-dev
mailing list