[Mesa-dev] [PATCH 08/10] tnl: Use gl_array_attribute::_ElementSize.

Mathias.Froehlich at gmx.net Mathias.Froehlich at gmx.net
Sat Nov 17 12:14:56 UTC 2018


From: Mathias Fröhlich <mathias.froehlich at web.de>

Instead of open coding the size computation, use the
already available gl_array_attribute::_ElementSize value.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich at web.de>
---
 src/mesa/tnl/t_split_copy.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/src/mesa/tnl/t_split_copy.c b/src/mesa/tnl/t_split_copy.c
index 085ae9a28c..1732b4c9ca 100644
--- a/src/mesa/tnl/t_split_copy.c
+++ b/src/mesa/tnl/t_split_copy.c
@@ -105,13 +105,6 @@ struct copy_context {
 };
 
 
-static GLuint
-attr_size(const struct gl_array_attributes *attrib)
-{
-   return attrib->Size * _mesa_sizeof_type(attrib->Type);
-}
-
-
 /**
  * Shallow copy one vertex array to another.
  */
@@ -458,8 +451,8 @@ replay_init(struct copy_context *copy)
 
          copy->varying[j].attr = i;
          copy->varying[j].array = &copy->array[i];
-         copy->varying[j].size = attr_size(attrib);
-         copy->vertex_size += attr_size(attrib);
+         copy->varying[j].size = attrib->_ElementSize;
+         copy->vertex_size += attrib->_ElementSize;
 
          if (_mesa_is_bufferobj(vbo) &&
              !_mesa_bufferobj_mapped(vbo, MAP_INTERNAL))
-- 
2.17.2



More information about the mesa-dev mailing list