diff options
author | Samuel Pitoiset <[email protected]> | 2017-08-21 22:22:29 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2017-08-22 11:54:32 +0200 |
commit | 46a8c4ef811ce1b909615f29a4059e079db3b930 (patch) | |
tree | 4d25a59de0a897470b8589f275f13c845da714f3 /src/mesa/main/bufferobj.c | |
parent | 44cd9aeeec58ef2c271cc7d5b89ea5eda906e78e (diff) |
mesa: only expose EXT_memory_object functions if the ext is supported
They should not be exposed when the extension is unsupported.
Note that ARB_direct_state_access is always exposed and
EXT_semaphore is not supported at all.
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/main/bufferobj.c')
-rw-r--r-- | src/mesa/main/bufferobj.c | 21 |
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); |