From: Erik Faye-Lund Date: Fri, 16 Nov 2018 08:56:34 +0000 (+0100) Subject: mesa/main: do not allow stencil-texture enums on gles1 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=76b038bee7ea4a5cead8d949c290b9ee0ff5998d;p=mesa.git mesa/main: do not allow stencil-texture enums on gles1 ctx->Extensions.ARB_texture_stencil8 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_texture_stencil8 and OES_texture_stencil8, so we support depth textures on OpenGL and OpenGL ES 2.0+. There's no extension enabling stencil-textures for OpenGL ES 1.x, so we shouldn't allow those enums there. Signed-off-by: Erik Faye-Lund Reviewed-by: Marek Olšák --- diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c index 811271737e4..8a3f9f27d47 100644 --- a/src/mesa/main/glformats.c +++ b/src/mesa/main/glformats.c @@ -2337,7 +2337,8 @@ _mesa_base_tex_format(const struct gl_context *ctx, GLint internalFormat) } } - if (ctx->Extensions.ARB_texture_stencil8) { + if (_mesa_has_ARB_texture_stencil8(ctx) || + _mesa_has_OES_texture_stencil8(ctx)) { switch (internalFormat) { case GL_STENCIL_INDEX: case GL_STENCIL_INDEX1: