mesa: fix error codes for importing memory/semaphore FDs
authorAndres Rodriguez <andresx7@gmail.com>
Thu, 21 Dec 2017 22:59:07 +0000 (17:59 -0500)
committerAndres Rodriguez <andresx7@gmail.com>
Tue, 30 Jan 2018 20:13:49 +0000 (15:13 -0500)
This fixes the following piglit tests:
spec/ext_semaphore_fd/api-errors/import-semaphore-fd-bad-enum
spec/ext_memory_object_fd/api-errors/import-memory-fd-bad-enum

Signed-off-by: Andres Rodriguez <andresx7@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/main/externalobjects.c

index 8f31ba4c354e4c46356020e226e2c4e9e554e49a..463debd268af26ea5b54537c0346189690538ab4 100644 (file)
@@ -809,7 +809,7 @@ _mesa_ImportMemoryFdEXT(GLuint memory,
    }
 
    if (handleType != GL_HANDLE_TYPE_OPAQUE_FD_EXT) {
-      _mesa_error(ctx, GL_INVALID_VALUE, "%s(handleType=%u)", func, handleType);
+      _mesa_error(ctx, GL_INVALID_ENUM, "%s(handleType=%u)", func, handleType);
       return;
    }
 
@@ -836,7 +836,7 @@ _mesa_ImportSemaphoreFdEXT(GLuint semaphore,
    }
 
    if (handleType != GL_HANDLE_TYPE_OPAQUE_FD_EXT) {
-      _mesa_error(ctx, GL_INVALID_VALUE, "%s(handleType=%u)", func, handleType);
+      _mesa_error(ctx, GL_INVALID_ENUM, "%s(handleType=%u)", func, handleType);
       return;
    }