diff options
author | Samuel Pitoiset <[email protected]> | 2017-08-21 22:22:28 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2017-08-22 11:54:29 +0200 |
commit | 44cd9aeeec58ef2c271cc7d5b89ea5eda906e78e (patch) | |
tree | dafbdc6c9bb65c7e1dbfff85f2d131e7423b5945 /src/mesa/main/externalobjects.c | |
parent | 39a35eb0c1ae0fc572e2c4a89b5e79197aa63bf5 (diff) |
mesa: only expose glImportMemoryFdEXT if the ext is supported
From the EXT_external_objects_fd spec:
"If the GL_EXT_memory_object_fd string is reported, the following
commands are added:
void ImportMemoryFdEXT(uint memory,
uint64 size,
enum handleType,
int fd);"
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/main/externalobjects.c')
-rw-r--r-- | src/mesa/main/externalobjects.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/main/externalobjects.c b/src/mesa/main/externalobjects.c index 098a0999208..127b2039c64 100644 --- a/src/mesa/main/externalobjects.c +++ b/src/mesa/main/externalobjects.c @@ -560,6 +560,12 @@ _mesa_ImportMemoryFdEXT(GLuint memory, { GET_CURRENT_CONTEXT(ctx); + if (!ctx->Extensions.EXT_memory_object_fd) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glImportMemoryFdEXT(unsupported)"); + return; + } + if (handleType != GL_HANDLE_TYPE_OPAQUE_FD_EXT) { _mesa_error(ctx, GL_INVALID_VALUE, "glImportMemoryFdEXT(handleType=%u)", handleType); |