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

@ -2312,8 +2312,8 @@ make_vertex_data(const EggRenderState *render_state,
PT(GeomVertexArrayFormat) anim_array_format = new GeomVertexArrayFormat; PT(GeomVertexArrayFormat) anim_array_format = new GeomVertexArrayFormat;
anim_array_format->add_column anim_array_format->add_column
(InternalName::get_transform_blend(), 1, (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); temp_format->add_array(anim_array_format);
pmap<string, BitArray> slider_names; 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); add_column(column->get_name(), 4, column->get_numeric_type(), column->get_contents(), -1, 16);
} else { } else {
add_column(column->get_name(), column->get_num_components(), 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()); PT(GeomVertexFormat) format = new GeomVertexFormat(*orig->get_format());
if (!orig->get_format()->has_column(InternalName::get_transform_blend())) { if (!orig->get_format()->has_column(InternalName::get_transform_blend())) {
PT(GeomVertexArrayFormat) af = PT(GeomVertexArrayFormat) af = new GeomVertexArrayFormat();
new GeomVertexArrayFormat(InternalName::get_transform_blend(), 1, af->add_column(InternalName::get_transform_blend(), 1,
Geom::NT_uint16, Geom::C_index); Geom::NT_uint16, Geom::C_index, 0, 2);
format->add_array(af); format->add_array(af);
} }