mesa/main: do not check for ARB_texture_buffer_object for GL 3.1

While OpenGL 3.1 does require texture buffer objects, the ARB spec for
this requires support for texture buffers with alpha, luminance,
luminance-alpha and intensity formats in addition to RGBA formats. The
version of texture buffer objects that ended up in the OpenGL spec (even
in the compatibility spec) does not require these formats.

But, we don't even need to check this, because this is already included
in the GLSL 1.40 requirement that's also checked. So this shouldn't make
us expose GL 3.1 in cases where it isn't supported in the first place.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38162>
This commit is contained in:
Erik Faye-Lund
2025-10-30 13:33:45 +01:00
committed by Marge Bot
parent 3039899d5b
commit 70f1603125
5 changed files with 13 additions and 6 deletions
+2 -1
View File
@@ -487,7 +487,8 @@ static inline bool
_mesa_has_texture_buffer_object(const struct gl_context *ctx)
{
return _mesa_has_ARB_texture_buffer_object(ctx) ||
_mesa_has_OES_texture_buffer(ctx);
_mesa_has_OES_texture_buffer(ctx) ||
(_mesa_is_desktop_gl(ctx) && ctx->Version >= 31);
}
static inline bool
+7 -1
View File
@@ -214,6 +214,7 @@ enum value_extra {
EXTRA_EXT_FB_NO_ATTACH_GS,
EXTRA_EXT_ES_GS,
EXTRA_EXT_PROVOKING_VERTEX_32,
EXTRA_EXT_TBO,
};
#define NO_EXTRA NULL
@@ -379,7 +380,7 @@ static const int extra_GLSL_130_es3_gpushader4[] = {
};
static const int extra_texture_buffer_object[] = {
EXT(ARB_texture_buffer_object),
EXTRA_EXT_TBO,
EXTRA_END
};
@@ -1582,6 +1583,11 @@ check_extra(struct gl_context *ctx, const char *func, const struct value_desc *d
if (_mesa_is_desktop_gl_compat(ctx) || version == 32)
api_found = ctx->Extensions.EXT_provoking_vertex;
break;
case EXTRA_EXT_TBO:
api_check = GL_TRUE;
if (_mesa_has_texture_buffer_object(ctx))
api_found = GL_TRUE;
break;
case EXTRA_END:
break;
default: /* *e is a offset into the extension struct */
-1
View File
@@ -291,7 +291,6 @@ compute_version(const struct gl_extensions *extensions,
const bool ver_3_1 = (ver_3_0 &&
consts->GLSLVersion >= 140 &&
extensions->ARB_draw_instanced &&
extensions->ARB_texture_buffer_object &&
extensions->ARB_uniform_buffer_object &&
extensions->EXT_texture_snorm &&
extensions->NV_primitive_restart &&
+2 -2
View File
@@ -1567,7 +1567,7 @@ void st_init_extensions(struct pipe_screen *screen,
screen->caps.buffer_sampler_view_rgba_only)
extensions->ARB_texture_buffer_object = GL_FALSE;
if (extensions->ARB_texture_buffer_object) {
if (screen->caps.texture_buffer_objects) {
consts->MaxTextureBufferSize =
screen->caps.max_texel_buffer_elements;
consts->TextureBufferOffsetAlignment =
@@ -1583,7 +1583,7 @@ void st_init_extensions(struct pipe_screen *screen,
extensions->OES_texture_buffer =
consts->Program[MESA_SHADER_COMPUTE].MaxImageUniforms &&
extensions->ARB_texture_buffer_object &&
screen->caps.texture_buffer_objects &&
extensions->ARB_texture_buffer_range &&
extensions->ARB_texture_buffer_object_rgb32;