Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3948>
</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">
<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>
}
}
+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 */