diff options
author | Eric Anholt <[email protected]> | 2013-05-30 10:06:49 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2013-06-03 13:47:19 -0700 |
commit | c937aea3d1af49041138aa3088e8efc253b34fbb (patch) | |
tree | 198f186c0ea6d020e665ac2d8bb7853f5d2f515d /src/mesa/drivers | |
parent | f96de8ad9622d42ce54feedd246967c73d1206cd (diff) |
meta: Fix temporary image type for float depth/stencil.
Fixes assertion failure in piglit copyteximage.
Reviewed-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/common/meta.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 1ab603a1034..1250bd35c8f 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -3764,10 +3764,20 @@ get_temp_image_type(struct gl_context *ctx, gl_format format) return datatype; return GL_FLOAT; } - case GL_DEPTH_COMPONENT: - return GL_UNSIGNED_INT; - case GL_DEPTH_STENCIL: - return GL_UNSIGNED_INT_24_8; + case GL_DEPTH_COMPONENT: { + GLenum datatype = _mesa_get_format_datatype(format); + if (datatype == GL_FLOAT) + return GL_FLOAT; + else + return GL_UNSIGNED_INT; + } + case GL_DEPTH_STENCIL: { + GLenum datatype = _mesa_get_format_datatype(format); + if (datatype == GL_FLOAT) + 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); |