{
memset(obj, 0, sizeof(struct gl_memory_object));
obj->Name = name;
+ obj->Dedicated = GL_FALSE;
}
void GLAPIENTRY
GLenum pname,
const GLint *params)
{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_memory_object *memObj;
+
+ memObj = _mesa_lookup_memory_object(ctx, memoryObject);
+ if (!memObj)
+ return;
+ if (memObj->Immutable) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glMemoryObjectParameterivEXT(memoryObject is immutable");
+ return;
+ }
+
+ switch (pname) {
+ case GL_DEDICATED_MEMORY_OBJECT_EXT:
+ memObj->Dedicated = (GLboolean) params[0];
+ break;
+ case GL_PROTECTED_MEMORY_OBJECT_EXT:
+ /* EXT_protected_textures not supported */
+ goto invalid_pname;
+ default:
+ goto invalid_pname;
+ }
+ return;
+
+invalid_pname:
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glMemoryObjectParameterivEXT(pname=0x%x)", pname);
}
void GLAPIENTRY
GLenum pname,
GLint *params)
{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_memory_object *memObj;
+
+ memObj = _mesa_lookup_memory_object(ctx, memoryObject);
+ if (!memObj)
+ return;
+
+ switch (pname) {
+ case GL_DEDICATED_MEMORY_OBJECT_EXT:
+ *params = (GLint) memObj->Dedicated;
+ break;
+ case GL_PROTECTED_MEMORY_OBJECT_EXT:
+ /* EXT_protected_textures not supported */
+ goto invalid_pname;
+ default:
+ goto invalid_pname;
+ }
+ return;
+invalid_pname:
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glGetMemoryObjectParameterivEXT(pname=0x%x)", pname);
}
void GLAPIENTRY
return;
ctx->Driver.ImportMemoryObjectFd(ctx, memObj, size, fd);
+ memObj->Immutable = GL_TRUE;
}
void GLAPIENTRY