mesa/main: validate half-float types

Half-float textures got a bit strange in GLES2; they were added by the
OES_texture_float extension, but that added a *different* enum with a
*different* value than what ended up in ARB_half_float_pixel and GLES3.

So, we need to check separately for these. The former one is only
supported on GLES.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29835>
This commit is contained in:
Erik Faye-Lund 2024-06-06 22:15:44 +02:00 committed by Marge Bot
parent 63a2f94962
commit 71cc56e1f7

View file

@ -1820,6 +1820,15 @@ valid_texture_type_enum(const struct gl_context *ctx, GLenum type)
case GL_FLOAT:
return _mesa_is_desktop_gl(ctx) || _mesa_has_OES_texture_float(ctx);
case GL_HALF_FLOAT:
return _mesa_has_ARB_half_float_pixel(ctx) || _mesa_is_gles3(ctx);
case GL_HALF_FLOAT_OES:
/* This is a different enum than the above, that only applies to this
* extension
*/
return _mesa_has_OES_texture_half_float(ctx);
case GL_BITMAP:
return _mesa_is_desktop_gl_compat(ctx);