aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorAnuj Phogat <[email protected]>2014-06-12 14:14:53 -0700
committerAnuj Phogat <[email protected]>2014-08-04 17:19:41 -0700
commit4bab55c874141b6a156a2e145443c6e07971ab39 (patch)
treee6559b33f7250214d2bce52d98956657f705c952 /src/mesa
parent7de90890c64d019c56e5a06e427b207220729997 (diff)
meta: Move the call to _mesa_get_format_datatype() out of switch
Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/common/meta.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 79fbf4919cb..64fcd29eb14 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -2733,6 +2733,7 @@ static GLenum
get_temp_image_type(struct gl_context *ctx, mesa_format format)
{
const GLenum baseFormat = _mesa_get_format_base_format(format);
+ const GLenum datatype = _mesa_get_format_datatype(format);
const GLint format_red_bits = _mesa_get_format_bits(format, GL_RED_BITS);
switch (baseFormat) {
@@ -2749,25 +2750,20 @@ get_temp_image_type(struct gl_context *ctx, mesa_format format)
} else if (format_red_bits <= 16) {
return GL_UNSIGNED_SHORT;
} else {
- GLenum datatype = _mesa_get_format_datatype(format);
if (datatype == GL_INT || datatype == GL_UNSIGNED_INT)
return datatype;
return GL_FLOAT;
}
- case GL_DEPTH_COMPONENT: {
- GLenum datatype = _mesa_get_format_datatype(format);
+ case GL_DEPTH_COMPONENT:
if (datatype == GL_FLOAT)
return GL_FLOAT;
else
return GL_UNSIGNED_INT;
- }
- case GL_DEPTH_STENCIL: {
- GLenum datatype = _mesa_get_format_datatype(format);
+ case GL_DEPTH_STENCIL:
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);