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:
committed by
Marge Bot
parent
9068e4415a
commit
b59b2d4bfa
@@ -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;
|
||||
|
||||
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user