glthread: autogenerate prototypes for custom-marshalled functions
authorMarek Olšák <marek.olsak@amd.com>
Thu, 19 Mar 2020 05:56:57 +0000 (01:56 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Sat, 21 Mar 2020 03:01:13 +0000 (23:01 -0400)
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4124>

src/mapi/glapi/gen/gl_marshal_h.py
src/mesa/main/marshal.c
src/mesa/main/marshal.h

index 94926b99a0f7cd5064152c76d799c924430c2a46..8a23b146e0e7a80a3d77a76b42492db647825e88 100644 (file)
@@ -63,6 +63,15 @@ class PrintCode(gl_XML.gl_print_base):
             print('   DISPATCH_CMD_{0},'.format(func.name))
         print('   NUM_DISPATCH_CMD,')
         print('};')
+        print('')
+
+        for func in api.functionIterateAll():
+            flavor = func.marshal_flavor()
+            if flavor == 'custom':
+                print('struct marshal_cmd_{0};'.format(func.name))
+                print(('void _mesa_unmarshal_{0}(struct gl_context *ctx, '
+                       'const struct marshal_cmd_{0} *cmd);').format(func.name))
+                print('void GLAPIENTRY _mesa_marshal_{0}({1});'.format(func.name, func.get_parameter_string()))
 
 
 def show_usage():
index cbcb7c58750b6f02f9753dc2e65ee1e6dd3291c1..d68dadaabcad0e56b5a0d8a33bd6f735d2133c5c 100644 (file)
@@ -213,14 +213,14 @@ _mesa_unmarshal_BufferData(struct gl_context *ctx,
 
 void
 _mesa_unmarshal_NamedBufferData(struct gl_context *ctx,
-                                const struct marshal_cmd_BufferData *cmd)
+                                const struct marshal_cmd_NamedBufferData *cmd)
 {
    unreachable("never used - all BufferData variants use DISPATCH_CMD_BufferData");
 }
 
 void
 _mesa_unmarshal_NamedBufferDataEXT(struct gl_context *ctx,
-                                   const struct marshal_cmd_BufferData *cmd)
+                                   const struct marshal_cmd_NamedBufferDataEXT *cmd)
 {
    unreachable("never used - all BufferData variants use DISPATCH_CMD_BufferData");
 }
@@ -328,14 +328,14 @@ _mesa_unmarshal_BufferSubData(struct gl_context *ctx,
 
 void
 _mesa_unmarshal_NamedBufferSubData(struct gl_context *ctx,
-                                   const struct marshal_cmd_BufferSubData *cmd)
+                                   const struct marshal_cmd_NamedBufferSubData *cmd)
 {
    unreachable("never used - all BufferSubData variants use DISPATCH_CMD_BufferSubData");
 }
 
 void
 _mesa_unmarshal_NamedBufferSubDataEXT(struct gl_context *ctx,
-                                      const struct marshal_cmd_BufferSubData *cmd)
+                                      const struct marshal_cmd_NamedBufferSubDataEXT *cmd)
 {
    unreachable("never used - all BufferSubData variants use DISPATCH_CMD_BufferSubData");
 }
index 9688012bb3bf51018b5f21bd758a718d9273963b..c5b3209201b631268cef2239044b8ae20f552323 100644 (file)
@@ -120,69 +120,9 @@ _mesa_glthread_is_non_vbo_draw_elements_indirect(const struct gl_context *ctx)
 struct _glapi_table *
 _mesa_create_marshal_table(const struct gl_context *ctx);
 
-struct marshal_cmd_ShaderSource;
-struct marshal_cmd_BufferData;
-struct marshal_cmd_BufferSubData;
-
-void GLAPIENTRY
-_mesa_marshal_ShaderSource(GLuint shader, GLsizei count,
-                           const GLchar * const *string, const GLint *length);
-
-void
-_mesa_unmarshal_ShaderSource(struct gl_context *ctx,
-                             const struct marshal_cmd_ShaderSource *cmd);
-
 void
 _mesa_glthread_BindBuffer(struct gl_context *ctx, GLenum target, GLuint buffer);
 
-void
-_mesa_unmarshal_BufferData(struct gl_context *ctx,
-                           const struct marshal_cmd_BufferData *cmd);
-
-void
-_mesa_unmarshal_NamedBufferData(struct gl_context *ctx,
-                                const struct marshal_cmd_BufferData *cmd);
-
-void
-_mesa_unmarshal_NamedBufferDataEXT(struct gl_context *ctx,
-                                   const struct marshal_cmd_BufferData *cmd);
-
-void GLAPIENTRY
-_mesa_marshal_BufferData(GLenum target, GLsizeiptr size, const GLvoid * data,
-                         GLenum usage);
-
-void GLAPIENTRY
-_mesa_marshal_NamedBufferData(GLuint buffer, GLsizeiptr size,
-                              const GLvoid * data, GLenum usage);
-
-void GLAPIENTRY
-_mesa_marshal_NamedBufferDataEXT(GLuint buffer, GLsizeiptr size,
-                                 const GLvoid *data, GLenum usage);
-
-void
-_mesa_unmarshal_BufferSubData(struct gl_context *ctx,
-                              const struct marshal_cmd_BufferSubData *cmd);
-
-void
-_mesa_unmarshal_NamedBufferSubData(struct gl_context *ctx,
-                                   const struct marshal_cmd_BufferSubData *cmd);
-
-void
-_mesa_unmarshal_NamedBufferSubDataEXT(struct gl_context *ctx,
-                                      const struct marshal_cmd_BufferSubData *cmd);
-
-void GLAPIENTRY
-_mesa_marshal_BufferSubData(GLenum target, GLintptr offset, GLsizeiptr size,
-                            const GLvoid * data);
-
-void GLAPIENTRY
-_mesa_marshal_NamedBufferSubData(GLuint buffer, GLintptr offset, GLsizeiptr size,
-                                 const GLvoid * data);
-
-void GLAPIENTRY
-_mesa_marshal_NamedBufferSubDataEXT(GLuint buffer, GLintptr offset,
-                                    GLsizeiptr size, const GLvoid * data);
-
 static inline unsigned
 _mesa_buffer_enum_to_count(GLenum buffer)
 {