Don't align transform_blend vertex column to 4 byte boundary

Somewhat improves performance of CPU vertex animation
This commit is contained in:
rdb 2016-06-09 21:48:57 +02:00
parent b303962e96
commit a1749b2f07
3 changed files with 7 additions and 6 deletions

View File

@ -2313,7 +2313,7 @@ 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);
Geom::NT_uint16, Geom::C_index, 0, 2);
temp_format->add_array(anim_array_format);
pmap<string, BitArray> slider_names;

View File

@ -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());
}
}
}

View File

@ -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);
}