+ const char *value_ptr = static_cast<const char *>(value);
+ if(packed)
+ {
+ const char *data_end = value_ptr+array_size*get_type_size(info.type);
+ copy(value_ptr, data_end, store_ptr);
+ }
+ else if(is_matrix(info.type))
+ {
+ unsigned col_size = get_type_size(get_matrix_column_type(info.type));
+ unsigned cols = get_type_size(info.type)/col_size;
+ for(unsigned i=0; i<array_size; ++i)
+ {
+ char *elem_ptr = store_ptr;
+ for(unsigned j=0; j<cols; ++j)
+ {
+ copy(value_ptr, value_ptr+col_size, elem_ptr);
+ value_ptr += col_size;
+ elem_ptr += info.matrix_stride;
+ }
+ store_ptr += info.array_stride;
+ }