summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/bufferobj.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/bufferobj.c')
-rw-r--r--src/mesa/main/bufferobj.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index cff1905e162..099648f4198 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -1873,13 +1873,20 @@ inlined_buffer_storage(GLenum target, GLuint buffer, GLsizeiptr size,
struct gl_memory_object *memObj = NULL;
if (mem) {
- /* From the EXT_external_objects spec:
- *
- * "An INVALID_VALUE error is generated by BufferStorageMemEXT and
- * NamedBufferStorageMemEXT if <memory> is 0, or ..."
- */
- if (!no_error && memory == 0) {
- _mesa_error(ctx, GL_INVALID_VALUE, "%s(memory == 0)", func);
+ if (!no_error) {
+ if (!ctx->Extensions.EXT_memory_object) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported)", func);
+ return;
+ }
+
+ /* From the EXT_external_objects spec:
+ *
+ * "An INVALID_VALUE error is generated by BufferStorageMemEXT and
+ * NamedBufferStorageMemEXT if <memory> is 0, or ..."
+ */
+ if (memory == 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s(memory == 0)", func);
+ }
}
memObj = _mesa_lookup_memory_object(ctx, memory);