glthread: add support for glCallLists, glPatchParameterfv
authorMarek Olšák <marek.olsak@amd.com>
Thu, 20 Feb 2020 03:06:53 +0000 (22:06 -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/ARB_tessellation_shader.xml
src/mapi/glapi/gen/gl_API.xml
src/mesa/main/marshal.h

index d0b03750eaf2da125d4471f26bc8c341854ca777..696dfe4258172a51af9e61ccba31dc0f286b8fef 100644 (file)
@@ -56,7 +56,7 @@
     </function>
     <function name="PatchParameterfv">
         <param name="pname" type="GLenum"/>
-        <param name="values" type="const GLfloat *"/>
+        <param name="values" type="const GLfloat *" count="_mesa_patch_param_enum_to_count(pname)"/>
     </function>
 
     <function name="PatchParameteriEXT" es2="3.1" alias="PatchParameteri">
index ff4bd8144d7d9d630aafc561aca24a980b23111b..e9f2713ac9d84d8622588e373cf6f40de4443c5f 100644 (file)
     <function name="CallLists" deprecated="3.1">
         <param name="n" type="GLsizei" counter="true"/>
         <param name="type" type="GLenum"/>
-        <param name="lists" type="const GLvoid *" variable_param="type" count="n"/>
+        <param name="lists" type="const GLvoid *" variable_param="type" count="n"
+               marshal_count="(n * _mesa_calllists_enum_to_count(type))"/>
         <glx rop="2" large="true"/>
     </function>
 
index a9d9569ad1172b91d0429acb69018cc423db2b1e..350e7c47d30beb3a2383d3a05ff38c93497108fa 100644 (file)
@@ -440,4 +440,40 @@ _mesa_point_param_enum_to_count(GLenum pname)
    }
 }
 
+static inline unsigned
+_mesa_calllists_enum_to_count(GLenum type)
+{
+   switch (type) {
+   case GL_BYTE:
+   case GL_UNSIGNED_BYTE:
+      return 1;
+   case GL_SHORT:
+   case GL_UNSIGNED_SHORT:
+   case GL_2_BYTES:
+      return 2;
+   case GL_3_BYTES:
+      return 3;
+   case GL_INT:
+   case GL_UNSIGNED_INT:
+   case GL_FLOAT:
+   case GL_4_BYTES:
+      return 4;
+   default:
+      return 0;
+   }
+}
+
+static inline unsigned
+_mesa_patch_param_enum_to_count(GLenum pname)
+{
+   switch (pname) {
+   case GL_PATCH_DEFAULT_OUTER_LEVEL:
+      return 4;
+   case GL_PATCH_DEFAULT_INNER_LEVEL:
+      return 2;
+   default:
+      return 0;
+   }
+}
+
 #endif /* MARSHAL_H */