mesa: fix _mesa_max_texture_levels for GL_TEXTURE_EXTERNAL_OES
authorMarek Olšák <marek.olsak@amd.com>
Mon, 13 May 2019 21:03:58 +0000 (17:03 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 14 May 2019 19:15:11 +0000 (15:15 -0400)
This helps fix:
    piglit/bin/ext_image_dma_buf_import-sample_yuv -fmt=NV12 -auto

Fixes: d88f3392fff7c6342f3840c4bd8195a1296c2372
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/main/teximage.c

index 36480348943a5cbd1dfb8d32ce86da6d22a68f6f..4b33403bfaaacc20ed3b6e42d35df03838595acd 100644 (file)
@@ -530,7 +530,7 @@ _mesa_max_texture_levels(const struct gl_context *ctx, GLenum target)
          && 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 */
    }