Browse Source

Don't align transform_blend vertex column to 4 byte boundary
Somewhat improves performance of CPU vertex animation

rdb 9 years ago
parent
commit
a1749b2f07

+ 2 - 2
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<string, BitArray> slider_names;

+ 2 - 1
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());
     }
   }
 }

+ 3 - 3
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);
   }