diff options
author | Marek Olšák <[email protected]> | 2020-02-19 22:06:53 -0500 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-03-06 01:06:14 +0000 |
commit | b5c58bbf6ce49199eca076225a7985f3e149ffd3 (patch) | |
tree | fdb99bbc247fef7f1c4d2871d4c9a743a38b3fed /src | |
parent | 1668a9390321e31ee19292590874e9b16a498936 (diff) |
glthread: add support for glCallLists, glPatchParameterfv
Reviewed-by: Timothy Arceri <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3948>
Diffstat (limited to 'src')
-rw-r--r-- | src/mapi/glapi/gen/ARB_tessellation_shader.xml | 2 | ||||
-rw-r--r-- | src/mapi/glapi/gen/gl_API.xml | 3 | ||||
-rw-r--r-- | src/mesa/main/marshal.h | 36 |
3 files changed, 39 insertions, 2 deletions
diff --git a/src/mapi/glapi/gen/ARB_tessellation_shader.xml b/src/mapi/glapi/gen/ARB_tessellation_shader.xml index d0b03750eaf..696dfe42581 100644 --- a/src/mapi/glapi/gen/ARB_tessellation_shader.xml +++ b/src/mapi/glapi/gen/ARB_tessellation_shader.xml @@ -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"> diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml index ff4bd8144d7..e9f2713ac9d 100644 --- a/src/mapi/glapi/gen/gl_API.xml +++ b/src/mapi/glapi/gen/gl_API.xml @@ -1127,7 +1127,8 @@ <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> diff --git a/src/mesa/main/marshal.h b/src/mesa/main/marshal.h index a9d9569ad11..350e7c47d30 100644 --- a/src/mesa/main/marshal.h +++ b/src/mesa/main/marshal.h @@ -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 */ |