On 05/02/2019 11:18 PM, Mathias Fröhlich wrote:
Hi Brian,

On Friday, 3 May 2019 00:17:51 CEST Brian Paul wrote:
On 05/02/2019 03:27 AM, mathias.froehl...@gmx.net wrote:
From: Mathias Fröhlich <mathias.froehl...@web.de>

In glArrayElement, use the bitmask trick to just walk the enabled
vao arrays. This should be about equivalent in execution time to
walk the prepare aelt_context list. Finally this will allow us to
reduce the _mesa_update_state calls in a few patches.

Signed-off-by: Mathias Fröhlich <mathias.froehl...@web.de>
---
   src/mesa/main/api_arrayelt.c | 78 ++++++++++++++++++++++++++++--------
   1 file changed, 61 insertions(+), 17 deletions(-)

diff --git a/src/mesa/main/api_arrayelt.c b/src/mesa/main/api_arrayelt.c
index d46c8d14b68..62f1e73ca4c 100644
--- a/src/mesa/main/api_arrayelt.c
+++ b/src/mesa/main/api_arrayelt.c
@@ -1541,32 +1541,76 @@ _ae_update_state(struct gl_context *ctx)
   }


+static inline attrib_func
+func_nv(const struct gl_vertex_format *vformat)
+{
+   return AttribFuncsNV[vformat->Normalized][vformat->Size-1]
+      [TYPE_IDX(vformat->Type)];
+}
+
+
+static inline attrib_func
+func_arb(const struct gl_vertex_format *vformat)
+{
+   return AttribFuncsARB[NORM_IDX(vformat)][vformat->Size-1]
+      [TYPE_IDX(vformat->Type)];
+}
+
+
+static inline const void *
+attrib_src(const struct gl_vertex_array_object *vao,
+           const struct gl_array_attributes *array, GLint elt)
+{
+   const struct gl_vertex_buffer_binding *binding =
+      &vao->BufferBinding[array->BufferBindingIndex];
+   const GLubyte *src
+      = ADD_POINTERS(binding->BufferObj->Mappings[MAP_INTERNAL].Pointer,
+                     _mesa_vertex_attrib_address(array, binding))
+      + elt * binding->Stride;
+   return src;
+}

Could you add some brief comments on those functions to explain what
they do?

Added brief comments:

/*
  * Return VertexAttrib*NV function pointer matching the provided vertex format.
  */
static inline attrib_func
func_nv(const struct gl_vertex_format *vformat)

[...]

/*
  * Return VertexAttrib*ARB function pointer matching the provided vertex 
format.
  */
static inline attrib_func
func_arb(const struct gl_vertex_format *vformat)

[...]

/*
  * Return the address of the array attribute array at elt in the
  * vertex array object vao.
  */
static inline const void *
attrib_src(const struct gl_vertex_array_object *vao,
            const struct gl_array_attributes *array, GLint elt)


Otherwise, for the rest of the series,
Reviewed-by: Brian Paul <bri...@vmware.com>

Nice work!!

Thanks for looking at the patches!

All your suggested changes look good.

Reviewed-by: Brian Paul <bri...@vmware.com>

Thanks.

-Brian



_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to