}
+/**
+ * Helper function to determine if a texture object is mutable (in terms
+ * of GL_ARB_texture_storage).
+ */
+static GLboolean
+mutable_tex_object(struct gl_context *ctx, GLenum target)
+{
+ if (ctx->Extensions.ARB_texture_storage) {
+ struct gl_texture_object *texObj =
+ _mesa_get_current_tex_object(ctx, target);
+ return !texObj->Immutable;
+ }
+ return GL_TRUE;
+}
+
+
+
/**
* Test the glTexImage[123]D() parameters for errors.
*
return GL_TRUE;
}
+ if (!mutable_tex_object(ctx, target)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glTexImage%dD(immutable texture)", dimensions);
+ return GL_TRUE;
+ }
+
/* if we get here, the parameters are OK */
return GL_FALSE;
}
}
}
+ if (!mutable_tex_object(ctx, target)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glCopyTexImage%dD(immutable texture)", dimensions);
+ return GL_TRUE;
+ }
+
/* if we get here, the parameters are OK */
return GL_FALSE;
}
return GL_INVALID_VALUE;
}
+ if (!mutable_tex_object(ctx, target)) {
+ *reason = "immutable texture";
+ return GL_INVALID_OPERATION;
+ }
+
return GL_NO_ERROR;
}