mesa/main: tighten gl-version checks

If we allow this whenever the extension is supported by the driver, we
end up allowing out-of-spec behavior for instance on GLES 1.x.

So let's tighten these checks to consider the current API, by using the
new helpers.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31039>
This commit is contained in:
Erik Faye-Lund
2024-09-04 12:54:58 +02:00
committed by Marge Bot
parent 9068e4415a
commit b59b2d4bfa
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -360,7 +360,7 @@ _mesa_get_compressed_formats(struct gl_context *ctx, GLint *formats)
formats[n++] = GL_PALETTE8_RGB5_A1_OES;
}
if (_mesa_is_gles3(ctx) || ctx->Extensions.ARB_ES3_compatibility) {
if (_mesa_is_gles3_compatible(ctx)) {
formats[n++] = GL_COMPRESSED_RGB8_ETC2;
formats[n++] = GL_COMPRESSED_RGBA8_ETC2_EAC;
formats[n++] = GL_COMPRESSED_R11_EAC;
+2 -2
View File
@@ -1594,7 +1594,7 @@ _mesa_target_can_be_compressed(const struct gl_context *ctx, GLenum target,
*/
target_can_be_compresed =
ctx->Extensions.EXT_texture_compression_s3tc &&
(_mesa_is_gles3(ctx) || ctx->Extensions.ARB_ES3_compatibility);
_mesa_is_gles3_compatible(ctx);
break;
case MESA_FORMAT_LAYOUT_ASTC:
target_can_be_compresed =
@@ -5601,7 +5601,7 @@ compressed_subtexture_target_check(struct gl_context *ctx, GLenum target,
case MESA_FORMAT_LAYOUT_S3TC:
targetOK =
ctx->Extensions.EXT_texture_compression_s3tc &&
(_mesa_is_gles3(ctx) || ctx->Extensions.ARB_ES3_compatibility);
_mesa_is_gles3_compatible(ctx);
break;
case MESA_FORMAT_LAYOUT_ASTC:
targetOK =