glthread: add support for glMemoryObjectParameteriv, glSemaphoreParameterui64v
authorMarek Olšák <marek.olsak@amd.com>
Thu, 20 Feb 2020 03:15:51 +0000 (22:15 -0500)
committerMarge Bot <eric+marge@anholt.net>
Fri, 6 Mar 2020 01:06:14 +0000 (01:06 +0000)
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3948>

src/mapi/glapi/gen/EXT_external_objects.xml
src/mesa/main/marshal.h

index ebcf6d7a4ac732ea176384c147cb784c8272936f..d8e4f9a57f68c7c76a54979e90a6cb5234b01884 100644 (file)
@@ -55,7 +55,7 @@
     <function name="MemoryObjectParameterivEXT" es2="3.2">
         <param name="memoryObject" type="GLuint"/>
         <param name="pname" type="GLenum"/>
-        <param name="params" type="const GLint *"/>
+        <param name="params" type="const GLint *" count="_mesa_memobj_enum_to_count(pname)"/>
     </function>
 
     <function name="GetMemoryObjectParameterivEXT" es2="3.2">
     <function name="SemaphoreParameterui64vEXT" es2="3.2">
         <param name="semaphore" type="GLuint"/>
         <param name="pname" type="GLenum"/>
-        <param name="params" type="const GLuint64 *"/>
+        <param name="params" type="const GLuint64 *" count="_mesa_semaphore_enum_to_count(pname)"/>
     </function>
 
     <function name="GetSemaphoreParameterui64vEXT" es2="3.2">
index 350e7c47d30beb3a2383d3a05ff38c93497108fa..5754d66f6e608e3c21c787437ec4cbe71d4e95ff 100644 (file)
@@ -476,4 +476,25 @@ _mesa_patch_param_enum_to_count(GLenum pname)
    }
 }
 
+static inline unsigned
+_mesa_memobj_enum_to_count(GLenum pname)
+{
+   switch (pname) {
+   case GL_DEDICATED_MEMORY_OBJECT_EXT:
+      return 1;
+   default:
+      return 0;
+   }
+}
+
+static inline unsigned
+_mesa_semaphore_enum_to_count(GLenum pname)
+{
+   switch (pname) {
+   /* EXT_semaphore and EXT_semaphore_fd define no parameters */
+   default:
+      return 0;
+   }
+}
+
 #endif /* MARSHAL_H */