From: Anuj Phogat Date: Thu, 12 Jun 2014 21:49:50 +0000 (-0700) Subject: meta: Fix datatype computation in get_temp_image_type() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=338fef61f86bb121e47b096428dce2a9109d3a3e;p=mesa.git meta: Fix datatype computation in get_temp_image_type() Changes in the patch will cause datatype to be computed correctly for 8 and 16 bit integer formats. For example: GL_RG8I, GL_RG16I etc. Fixes many failures in gles3 Khronos CTS test: copy_tex_image_conversions_required copy_tex_image_conversions_forbidden Cc: Signed-off-by: Anuj Phogat Reviewed-by: Topi Pohjolainen --- diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 64fcd29eb14..f8f0ee306ff 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -2745,15 +2745,14 @@ get_temp_image_type(struct gl_context *ctx, mesa_format format) case GL_LUMINANCE: case GL_LUMINANCE_ALPHA: case GL_INTENSITY: - if (format_red_bits <= 8) { + if (datatype == GL_INT || datatype == GL_UNSIGNED_INT) { + return datatype; + } else if (format_red_bits <= 8) { return GL_UNSIGNED_BYTE; } else if (format_red_bits <= 16) { return GL_UNSIGNED_SHORT; - } else { - if (datatype == GL_INT || datatype == GL_UNSIGNED_INT) - return datatype; - return GL_FLOAT; } + return GL_FLOAT; case GL_DEPTH_COMPONENT: if (datatype == GL_FLOAT) return GL_FLOAT;