mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 11:18:08 +02:00
meta: Use _mesa_get_format_bits() to get the GL_RED_BITS
We currently get red bits from ctx->DrawBuffer->Visual.redBits by making a false assumption that the texture we're writing to (in glCopyTexImage2D()) is used as a DrawBuffer. Fixes many failures in gles3 Khronos CTS test: copy_tex_image_conversions_required Cc: <mesa-stable@lists.freedesktop.org> Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
This commit is contained in:
parent
9796a17265
commit
7de90890c6
1 changed files with 3 additions and 2 deletions
|
|
@ -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 GLint format_red_bits = _mesa_get_format_bits(format, GL_RED_BITS);
|
||||
|
||||
switch (baseFormat) {
|
||||
case GL_RGBA:
|
||||
|
|
@ -2743,9 +2744,9 @@ get_temp_image_type(struct gl_context *ctx, mesa_format format)
|
|||
case GL_LUMINANCE:
|
||||
case GL_LUMINANCE_ALPHA:
|
||||
case GL_INTENSITY:
|
||||
if (ctx->DrawBuffer->Visual.redBits <= 8) {
|
||||
if (format_red_bits <= 8) {
|
||||
return GL_UNSIGNED_BYTE;
|
||||
} else if (ctx->DrawBuffer->Visual.redBits <= 16) {
|
||||
} else if (format_red_bits <= 16) {
|
||||
return GL_UNSIGNED_SHORT;
|
||||
} else {
|
||||
GLenum datatype = _mesa_get_format_datatype(format);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue