[Mesa-dev] [PATCH 12/14] mesa/vbo: Move src/mesa/vbo/vbo_exec_array.c -> src/mesa/main/draw.c

Brian Paul brianp at vmware.com
Tue Oct 30 12:06:50 UTC 2018


The series looks great, Mathias.

Reviewed-by: Brian Paul <brianp at vmware.com>

A comment/question below...


On 10/29/2018 11:07 PM, Mathias.Froehlich at gmx.net wrote:
> From: Mathias Fröhlich <mathias.froehlich at web.de>
> 
> The array type draw is no longer directly dependent on the vbo module.
> Thus move array type draws into mesa/main/draw.c.
> Rename symbols starting with vbo_* to _mesa_* and apply some
> reindenting to make it consistent.
> 
> Signed-off-by: Mathias Fröhlich <Mathias.Froehlich at web.de>
> ---
>   src/mapi/glapi/gen/gl_genexec.py              |   4 +-
>   src/mesa/Makefile.sources                     |   3 +-
>   .../{vbo/vbo_exec_array.c => main/draw.c}     | 487 +++++++++---------
>   src/mesa/main/draw.h                          |  83 +++
>   src/mesa/meson.build                          |   3 +-
>   src/mesa/vbo/vbo.h                            |  34 +-
>   6 files changed, 334 insertions(+), 280 deletions(-)
>   rename src/mesa/{vbo/vbo_exec_array.c => main/draw.c} (79%)
>   create mode 100644 src/mesa/main/draw.h
> 
[...]

>   
>      if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
> -      SET_DrawArraysInstancedARB(exec, vbo_exec_DrawArraysInstanced);
> -      SET_DrawElementsInstancedARB(exec, vbo_exec_DrawElementsInstanced);
> +      SET_DrawArraysInstancedARB(exec, _mesa_exec_DrawArraysInstanced);
> +      SET_DrawElementsInstancedARB(exec, _mesa_exec_DrawElementsInstanced);
>      }
>   
>      if (_mesa_is_desktop_gl(ctx)) {
> -      SET_DrawTransformFeedback(exec, vbo_exec_DrawTransformFeedback);
> +      SET_DrawTransformFeedback(exec, _mesa_exec_DrawTransformFeedback);
>         SET_DrawTransformFeedbackStream(exec,
> -                                      vbo_exec_DrawTransformFeedbackStream);
> +                                      _mesa_exec_DrawTransformFeedbackStream);
>         SET_DrawTransformFeedbackInstanced(exec,
> -                                         vbo_exec_DrawTransformFeedbackInstanced);
> +                                         _mesa_exec_DrawTransformFeedbackInstanced);
>         SET_DrawTransformFeedbackStreamInstanced(exec,
> -                                               vbo_exec_DrawTransformFeedbackStreamInstanced);
> -      SET_MultiDrawArraysIndirect(exec, vbo_exec_MultiDrawArraysIndirect);
> -      SET_MultiDrawElementsIndirect(exec, vbo_exec_MultiDrawElementsIndirect);
> +                                               _mesa_exec_DrawTransformFeedbackStreamInstanced);
> +      SET_MultiDrawArraysIndirect(exec, _mesa_exec_MultiDrawArraysIndirect);
> +      SET_MultiDrawElementsIndirect(exec, _mesa_exec_MultiDrawElementsIndirect);
>         SET_MultiDrawArraysIndirectCountARB(exec,
> -                                          vbo_exec_MultiDrawArraysIndirectCount);
> +                                          _mesa_exec_MultiDrawArraysIndirectCount);
>         SET_MultiDrawElementsIndirectCountARB(exec,
> -                                            vbo_exec_MultiDrawElementsIndirectCount);
> +                                            _mesa_exec_MultiDrawElementsIndirectCount);
>      }
>   }
>   
> @@ -2072,7 +2073,7 @@ vbo_initialize_exec_dispatch(const struct gl_context *ctx,
>   void GLAPIENTRY
>   _mesa_DrawArrays(GLenum mode, GLint first, GLsizei count)
>   {
> -   vbo_exec_DrawArrays(mode, first, count);
> +   _mesa_exec_DrawArrays(mode, first, count);
>   }

It would be nice to avoid this pattern of simply calling another 
function like this.

The complication, though, is that the _mesa_exec_Draw*() functions get 
put into the dispatch table, but the _mesa_Draw*() functions are 
decorated with GLAPIENTRY since they're Windows dll export functions.

We'd have to decorate some entries in the dispatch table with 
GLAPIENTRY, but that could involve some messy python script work.

What do you think?

-Brian



More information about the mesa-dev mailing list