mesa/main: updates for EXT_texture_format_BGRA8888
The spec is about to change, so let's prepare for the new and brighter future. Reviewed-by: Daniel Stone <daniels@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27726>
This commit is contained in:
committed by
Marge Bot
parent
f81e38e5a9
commit
3053268fd0
@@ -2658,7 +2658,8 @@ _mesa_base_fbo_format(const struct gl_context *ctx, GLenum internalFormat)
|
||||
? GL_RGB : 0;
|
||||
|
||||
case GL_BGRA:
|
||||
/* EXT_texture_format_BGRA8888 only adds this as color-renderable for
|
||||
case GL_BGRA8_EXT:
|
||||
/* EXT_texture_format_BGRA8888 only adds these as color-renderable for
|
||||
* GLES 2 and later
|
||||
*/
|
||||
if (_mesa_has_EXT_texture_format_BGRA8888(ctx) && _mesa_is_gles2(ctx))
|
||||
|
||||
@@ -2761,6 +2761,7 @@ _mesa_gles_check_internalformat(struct gl_context *ctx,
|
||||
|
||||
/* GL_EXT_texture_format_BGRA8888 */
|
||||
case GL_BGRA:
|
||||
case GL_BGRA8_EXT:
|
||||
|
||||
/* GL_OES_required_internalformat */
|
||||
case GL_RGB565:
|
||||
@@ -2901,21 +2902,6 @@ _mesa_gles_check_internalformat(struct gl_context *ctx,
|
||||
return GL_INVALID_VALUE;
|
||||
return GL_NO_ERROR;
|
||||
|
||||
case GL_BGRA8_EXT: {
|
||||
/* This is technically speaking out-of-spec. But too many
|
||||
* applications seems to depend on it, so let's allow it
|
||||
* together with a small complaint */
|
||||
static bool warned = false;
|
||||
if (!warned) {
|
||||
_mesa_warning(ctx,
|
||||
"internalformat = GL_BGRA8_EXT invalid by spec, but too many "
|
||||
"applications depend on it to error. Please fix the software "
|
||||
"that causes this problem.");
|
||||
warned = true;
|
||||
}
|
||||
return GL_NO_ERROR;
|
||||
}
|
||||
|
||||
default:
|
||||
return GL_INVALID_VALUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user