mesa/main: properly check for EXT_memory_object

This extension isn't supported in GLES 1.x, so let's tighten the check.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32349>
This commit is contained in:
Erik Faye-Lund 2024-11-26 11:04:37 +01:00 committed by Marge Bot
parent dddec9a66d
commit 0284e7fedb
4 changed files with 19 additions and 19 deletions

View file

@ -2179,7 +2179,7 @@ inlined_buffer_storage(GLenum target, GLuint buffer, GLsizeiptr size,
if (mem) {
if (!no_error) {
if (!ctx->Extensions.EXT_memory_object) {
if (!_mesa_has_EXT_memory_object(ctx)) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported)", func);
return;
}

View file

@ -134,7 +134,7 @@ _mesa_DeleteMemoryObjectsEXT(GLsizei n, const GLuint *memoryObjects)
memoryObjects);
}
if (!ctx->Extensions.EXT_memory_object) {
if (!_mesa_has_EXT_memory_object(ctx)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glDeleteMemoryObjectsEXT(unsupported)");
return;
@ -169,7 +169,7 @@ _mesa_IsMemoryObjectEXT(GLuint memoryObject)
{
GET_CURRENT_CONTEXT(ctx);
if (!ctx->Extensions.EXT_memory_object) {
if (!_mesa_has_EXT_memory_object(ctx)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glIsMemoryObjectEXT(unsupported)");
return GL_FALSE;
@ -191,7 +191,7 @@ _mesa_CreateMemoryObjectsEXT(GLsizei n, GLuint *memoryObjects)
if (MESA_VERBOSE & (VERBOSE_API))
_mesa_debug(ctx, "%s(%d, %p)\n", func, n, memoryObjects);
if (!ctx->Extensions.EXT_memory_object) {
if (!_mesa_has_EXT_memory_object(ctx)) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported)", func);
return;
}
@ -236,7 +236,7 @@ _mesa_MemoryObjectParameterivEXT(GLuint memoryObject,
const char *func = "glMemoryObjectParameterivEXT";
if (!ctx->Extensions.EXT_memory_object) {
if (!_mesa_has_EXT_memory_object(ctx)) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported)", func);
return;
}
@ -276,7 +276,7 @@ _mesa_GetMemoryObjectParameterivEXT(GLuint memoryObject,
const char *func = "glMemoryObjectParameterivEXT";
if (!ctx->Extensions.EXT_memory_object) {
if (!_mesa_has_EXT_memory_object(ctx)) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported)", func);
return;
}
@ -337,7 +337,7 @@ texstorage_memory(GLuint dims, GLenum target, GLsizei levels,
GET_CURRENT_CONTEXT(ctx);
if (!ctx->Extensions.EXT_memory_object) {
if (!_mesa_has_EXT_memory_object(ctx)) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported)", func);
return;
}
@ -381,7 +381,7 @@ texstorage_memory_ms(GLuint dims, GLenum target, GLsizei samples,
GET_CURRENT_CONTEXT(ctx);
if (!ctx->Extensions.EXT_memory_object) {
if (!_mesa_has_EXT_memory_object(ctx)) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported)", func);
return;
}
@ -413,7 +413,7 @@ texturestorage_memory(GLuint dims, GLuint texture, GLsizei levels,
GET_CURRENT_CONTEXT(ctx);
if (!ctx->Extensions.EXT_memory_object) {
if (!_mesa_has_EXT_memory_object(ctx)) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported)", func);
return;
}
@ -457,7 +457,7 @@ texturestorage_memory_ms(GLuint dims, GLuint texture, GLsizei samples,
GET_CURRENT_CONTEXT(ctx);
if (!ctx->Extensions.EXT_memory_object) {
if (!_mesa_has_EXT_memory_object(ctx)) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported)", func);
return;
}

View file

@ -2414,7 +2414,7 @@ _mesa_GetUnsignedBytevEXT(GLenum pname, GLubyte *data)
GET_CURRENT_CONTEXT(ctx);
if (!ctx->Extensions.EXT_memory_object) {
if (!_mesa_has_EXT_memory_object(ctx)) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported)", func);
return;
}
@ -2909,19 +2909,19 @@ find_value_indexed(const char *func, GLenum pname, GLuint index, union value *v)
/* GL_EXT_external_objects */
case GL_NUM_DEVICE_UUIDS_EXT:
if (!ctx->Extensions.EXT_memory_object && !ctx->Extensions.EXT_semaphore)
if (!_mesa_has_EXT_memory_object(ctx) && !ctx->Extensions.EXT_semaphore)
goto invalid_enum;
v->value_int = 1;
return TYPE_INT;
case GL_DRIVER_UUID_EXT:
if (!ctx->Extensions.EXT_memory_object && !ctx->Extensions.EXT_semaphore)
if (!_mesa_has_EXT_memory_object(ctx) && !ctx->Extensions.EXT_semaphore)
goto invalid_enum;
if (index >= 1)
goto invalid_value;
_mesa_get_driver_uuid(ctx, v->value_int_4);
return TYPE_INT_4;
case GL_DEVICE_UUID_EXT:
if (!ctx->Extensions.EXT_memory_object && !ctx->Extensions.EXT_semaphore)
if (!_mesa_has_EXT_memory_object(ctx) && !ctx->Extensions.EXT_semaphore)
goto invalid_enum;
if (index >= 1)
goto invalid_value;
@ -3351,7 +3351,7 @@ _mesa_GetUnsignedBytei_vEXT(GLenum target, GLuint index, GLubyte *data)
GET_CURRENT_CONTEXT(ctx);
if (!ctx->Extensions.EXT_memory_object) {
if (!_mesa_has_EXT_memory_object(ctx)) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported)", func);
return;
}

View file

@ -655,7 +655,7 @@ set_tex_parameteri(struct gl_context *ctx,
goto invalid_pname;
case GL_TEXTURE_TILING_EXT:
if (ctx->Extensions.EXT_memory_object && !texObj->Immutable) {
if (_mesa_has_EXT_memory_object(ctx) && !texObj->Immutable) {
texObj->TextureTiling = params[0];
return GL_TRUE;
@ -875,7 +875,7 @@ set_tex_parameterf(struct gl_context *ctx,
return GL_TRUE;
case GL_TEXTURE_TILING_EXT:
if (ctx->Extensions.EXT_memory_object) {
if (_mesa_has_EXT_memory_object(ctx)) {
texObj->TextureTiling = params[0];
return GL_TRUE;
}
@ -2503,7 +2503,7 @@ get_tex_parameterfv(struct gl_context *ctx,
break;
case GL_TEXTURE_TILING_EXT:
if (!ctx->Extensions.EXT_memory_object)
if (!_mesa_has_EXT_memory_object(ctx))
goto invalid_pname;
*params = ENUM_TO_FLOAT(obj->TextureTiling);
break;
@ -2788,7 +2788,7 @@ get_tex_parameteriv(struct gl_context *ctx,
break;
case GL_TEXTURE_TILING_EXT:
if (!ctx->Extensions.EXT_memory_object)
if (!_mesa_has_EXT_memory_object(ctx))
goto invalid_pname;
*params = (GLint) obj->TextureTiling;
break;