From a1749b2f07b62eccd3a8c5ac105536499c215fa9 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 9 Jun 2016 21:48:57 +0200 Subject: [PATCH] Don't align transform_blend vertex column to 4 byte boundary Somewhat improves performance of CPU vertex animation --- panda/src/egg2pg/eggLoader.cxx | 4 ++-- panda/src/gobj/geomVertexArrayFormat.cxx | 3 ++- panda/src/grutil/rigidBodyCombiner.cxx | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/panda/src/egg2pg/eggLoader.cxx b/panda/src/egg2pg/eggLoader.cxx index d6b41df09a..06afac8aa0 100644 --- a/panda/src/egg2pg/eggLoader.cxx +++ b/panda/src/egg2pg/eggLoader.cxx @@ -2312,8 +2312,8 @@ make_vertex_data(const EggRenderState *render_state, PT(GeomVertexArrayFormat) anim_array_format = new GeomVertexArrayFormat; anim_array_format->add_column - (InternalName::get_transform_blend(), 1, - Geom::NT_uint16, Geom::C_index); + (InternalName::get_transform_blend(), 1, + Geom::NT_uint16, Geom::C_index, 0, 2); temp_format->add_array(anim_array_format); pmap slider_names; diff --git a/panda/src/gobj/geomVertexArrayFormat.cxx b/panda/src/gobj/geomVertexArrayFormat.cxx index be82d262fd..bc139e2335 100644 --- a/panda/src/gobj/geomVertexArrayFormat.cxx +++ b/panda/src/gobj/geomVertexArrayFormat.cxx @@ -403,7 +403,8 @@ align_columns_for_animation() { add_column(column->get_name(), 4, column->get_numeric_type(), column->get_contents(), -1, 16); } else { add_column(column->get_name(), column->get_num_components(), - column->get_numeric_type(), column->get_contents()); + column->get_numeric_type(), column->get_contents(), + -1, column->get_column_alignment()); } } } diff --git a/panda/src/grutil/rigidBodyCombiner.cxx b/panda/src/grutil/rigidBodyCombiner.cxx index 1ae3a0b1a4..e46f65e424 100644 --- a/panda/src/grutil/rigidBodyCombiner.cxx +++ b/panda/src/grutil/rigidBodyCombiner.cxx @@ -244,9 +244,9 @@ convert_vd(const VertexTransform *transform, const GeomVertexData *orig) { PT(GeomVertexFormat) format = new GeomVertexFormat(*orig->get_format()); if (!orig->get_format()->has_column(InternalName::get_transform_blend())) { - PT(GeomVertexArrayFormat) af = - new GeomVertexArrayFormat(InternalName::get_transform_blend(), 1, - Geom::NT_uint16, Geom::C_index); + PT(GeomVertexArrayFormat) af = new GeomVertexArrayFormat(); + af->add_column(InternalName::get_transform_blend(), 1, + Geom::NT_uint16, Geom::C_index, 0, 2); format->add_array(af); }