mesa/main: do not allow RGBA_INTEGER et al in gles3

GLES3 doesn't allow all the format/type combinations that
ARB_texture_rgb10_a2ui does, so let's tighten the error-checking here a
bit.

Fixes: b5a370dc25 ("mesa/main: do not allow ARB_texture_rgb10_a2ui enums before gles3")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29528>
This commit is contained in:
Erik Faye-Lund 2024-05-30 14:11:30 +02:00 committed by Marge Bot
parent 5e5b0b0532
commit 227c6627cb

View file

@ -1772,7 +1772,7 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx,
break; /* OK */
}
if (format == GL_RGB_INTEGER &&
_mesa_has_texture_rgb10_a2ui(ctx)) {
_mesa_has_ARB_texture_rgb10_a2ui(ctx)) {
break; /* OK */
}
return GL_INVALID_OPERATION;
@ -1787,7 +1787,7 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx,
break; /* OK */
}
if ((format == GL_RGBA_INTEGER || format == GL_BGRA_INTEGER) &&
_mesa_has_texture_rgb10_a2ui(ctx)) {
_mesa_has_ARB_texture_rgb10_a2ui(ctx)) {
break; /* OK */
}
return GL_INVALID_OPERATION;
@ -1801,7 +1801,11 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx,
break; /* OK */
}
if ((format == GL_RGBA_INTEGER || format == GL_BGRA_INTEGER) &&
_mesa_has_texture_rgb10_a2ui(ctx)) {
_mesa_has_ARB_texture_rgb10_a2ui(ctx)) {
break; /* OK */
}
if ((format == GL_RGBA_INTEGER || format == GL_BGRA_INTEGER) &&
type == GL_UNSIGNED_INT_2_10_10_10_REV && _mesa_is_gles3(ctx)) {
break; /* OK */
}
if (type == GL_UNSIGNED_INT_2_10_10_10_REV && format == GL_RGB &&
@ -2057,7 +2061,7 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx,
case GL_UNSIGNED_BYTE_2_3_3_REV:
case GL_UNSIGNED_SHORT_5_6_5:
case GL_UNSIGNED_SHORT_5_6_5_REV:
return _mesa_has_texture_rgb10_a2ui(ctx)
return _mesa_has_ARB_texture_rgb10_a2ui(ctx)
? GL_NO_ERROR : GL_INVALID_ENUM;
default:
return GL_INVALID_ENUM;