mesa: fix _mesa_max_texture_levels for GL_TEXTURE_EXTERNAL_OES

Submitted by Marek Olšák on May 13, 2019, 9:38 p.m.

Details

Message ID 20190513213822.9444-1-maraeo@gmail.com
State New
Headers show
Series "mesa: fix _mesa_max_texture_levels for GL_TEXTURE_EXTERNAL_OES" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Marek Olšák May 13, 2019, 9:38 p.m.
From: Marek Olšák <marek.olsak@amd.com>

This helps fix:
    piglit/bin/ext_image_dma_buf_import-sample_yuv -fmt=NV12 -auto

Fixes: d88f3392fff7c6342f3840c4bd8195a1296c2372
---
 src/mesa/main/teximage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 36480348943..4b33403bfaa 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -523,21 +523,21 @@  _mesa_max_texture_levels(const struct gl_context *ctx, GLenum target)
       return (_mesa_has_ARB_texture_buffer_object(ctx) ||
               _mesa_has_OES_texture_buffer(ctx)) ? 1 : 0;
    case GL_TEXTURE_2D_MULTISAMPLE:
    case GL_PROXY_TEXTURE_2D_MULTISAMPLE:
    case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:
    case GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY:
       return (_mesa_is_desktop_gl(ctx) || _mesa_is_gles31(ctx))
          && ctx->Extensions.ARB_texture_multisample
          ? 1 : 0;
    case GL_TEXTURE_EXTERNAL_OES:
-      /* fall-through */
+      return _mesa_has_OES_EGL_image_external(ctx) ? 1 : 0;
    default:
       return 0; /* bad target */
    }
 }
 
 
 /**
  * Return number of dimensions per mipmap level for the given texture target.
  */
 GLint

Comments