From 19eb0bf28fa1d6742bfb9d7b920fe5ce5254e251 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Fri, 16 Nov 2018 09:52:49 +0100 Subject: [PATCH] mesa/main: do not allow depth-texture enums on gles1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit ctx->Extensions.ARB_depth_texture is set regardless of the API that's used, so checking for those direcly will always allow the enums from this extensions when they are supported by the driver. So let's instead check for both ARB_depth_texture and OES_depth_texture, so we support depth textures on OpenGL and OpenGL ES 2.0+. There's no extension enabling depth-textures for OpenGL ES 1.x, so we shouldn't allow those enums there. This fixes oes_packed_depth_stencil-depth-stencil-texture_gles1 on i965 Signed-off-by: Erik Faye-Lund Reviewed-by: Marek Olšák --- src/mesa/main/glformats.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c index 4a9ac1137f7..811271737e4 100644 --- a/src/mesa/main/glformats.c +++ b/src/mesa/main/glformats.c @@ -2321,7 +2321,8 @@ _mesa_base_tex_format(const struct gl_context *ctx, GLint internalFormat) } } - if (ctx->Extensions.ARB_depth_texture) { + if (_mesa_has_ARB_depth_texture(ctx) || _mesa_has_OES_depth_texture(ctx) || + ctx->API == API_OPENGL_CORE) { switch (internalFormat) { case GL_DEPTH_COMPONENT: case GL_DEPTH_COMPONENT16: -- 2.30.2