summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/externalobjects.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/externalobjects.c')
-rw-r--r--src/mesa/main/externalobjects.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/mesa/main/externalobjects.c b/src/mesa/main/externalobjects.c
index 127b2039c64..e70280c9652 100644
--- a/src/mesa/main/externalobjects.c
+++ b/src/mesa/main/externalobjects.c
@@ -90,6 +90,12 @@ _mesa_DeleteMemoryObjectsEXT(GLsizei n, const GLuint *memoryObjects)
memoryObjects);
}
+ if (!ctx->Extensions.EXT_memory_object) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glDeleteMemoryObjectsEXT(unsupported)");
+ return;
+ }
+
if (n < 0) {
_mesa_error(ctx, GL_INVALID_VALUE, "glDeleteMemoryObjectsEXT(n < 0)");
return;
@@ -118,6 +124,13 @@ GLboolean GLAPIENTRY
_mesa_IsMemoryObjectEXT(GLuint memoryObject)
{
GET_CURRENT_CONTEXT(ctx);
+
+ if (!ctx->Extensions.EXT_memory_object) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glIsMemoryObjectEXT(unsupported)");
+ return GL_FALSE;
+ }
+
struct gl_memory_object *obj =
_mesa_lookup_memory_object(ctx, memoryObject);
@@ -134,6 +147,12 @@ _mesa_CreateMemoryObjectsEXT(GLsizei n, GLuint *memoryObjects)
if (MESA_VERBOSE & (VERBOSE_API))
_mesa_debug(ctx, "%s(%d, %p)", func, n, memoryObjects);
+ if (!ctx->Extensions.EXT_memory_object) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glCreateMemoryObjectsEXT(unsupported)");
+ return;
+ }
+
if (n < 0) {
_mesa_error(ctx, GL_INVALID_VALUE, "%s(n < 0)", func);
return;
@@ -176,6 +195,12 @@ _mesa_MemoryObjectParameterivEXT(GLuint memoryObject,
GET_CURRENT_CONTEXT(ctx);
struct gl_memory_object *memObj;
+ if (!ctx->Extensions.EXT_memory_object) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glMemoryObjectParameterivEXT(unsupported)");
+ return;
+ }
+
memObj = _mesa_lookup_memory_object(ctx, memoryObject);
if (!memObj)
return;
@@ -211,6 +236,12 @@ _mesa_GetMemoryObjectParameterivEXT(GLuint memoryObject,
GET_CURRENT_CONTEXT(ctx);
struct gl_memory_object *memObj;
+ if (!ctx->Extensions.EXT_memory_object) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetMemoryObjectParameterivEXT(unsupported)");
+ return;
+ }
+
memObj = _mesa_lookup_memory_object(ctx, memoryObject);
if (!memObj)
return;
@@ -268,6 +299,11 @@ texstorage_memory(GLuint dims, GLenum target, GLsizei levels,
GET_CURRENT_CONTEXT(ctx);
+ if (!ctx->Extensions.EXT_memory_object) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported)", func);
+ return;
+ }
+
texObj = _mesa_get_current_tex_object(ctx, target);
if (!texObj)
return;
@@ -292,6 +328,11 @@ texstorage_memory_ms(GLuint dims, GLenum target, GLsizei samples,
GET_CURRENT_CONTEXT(ctx);
+ if (!ctx->Extensions.EXT_memory_object) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported)", func);
+ return;
+ }
+
texObj = _mesa_get_current_tex_object(ctx, target);
if (!texObj)
return;
@@ -319,6 +360,11 @@ texturestorage_memory(GLuint dims, GLuint texture, GLsizei levels,
GET_CURRENT_CONTEXT(ctx);
+ if (!ctx->Extensions.EXT_memory_object) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported)", func);
+ return;
+ }
+
texObj = _mesa_lookup_texture(ctx, texture);
if (!texObj)
return;
@@ -343,6 +389,11 @@ texturestorage_memory_ms(GLuint dims, GLuint texture, GLsizei samples,
GET_CURRENT_CONTEXT(ctx);
+ if (!ctx->Extensions.EXT_memory_object) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported)", func);
+ return;
+ }
+
texObj = _mesa_lookup_texture(ctx, texture);
if (!texObj)
return;