diff options
Diffstat (limited to 'extern/draco/draco/src/draco/compression/attributes/kd_tree_attributes_encoder.cc')
-rw-r--r-- | extern/draco/draco/src/draco/compression/attributes/kd_tree_attributes_encoder.cc | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/extern/draco/draco/src/draco/compression/attributes/kd_tree_attributes_encoder.cc b/extern/draco/draco/src/draco/compression/attributes/kd_tree_attributes_encoder.cc index 0f9c31565e5..b70deb9e01f 100644 --- a/extern/draco/draco/src/draco/compression/attributes/kd_tree_attributes_encoder.cc +++ b/extern/draco/draco/src/draco/compression/attributes/kd_tree_attributes_encoder.cc @@ -71,16 +71,21 @@ bool KdTreeAttributesEncoder::TransformAttributesToPortableFormat() { att->num_components(), range); } else { // Compute quantization settings from the attribute values. - attribute_quantization_transform.ComputeParameters(*att, - quantization_bits); + if (!attribute_quantization_transform.ComputeParameters( + *att, quantization_bits)) { + return false; + } } attribute_quantization_transforms_.push_back( attribute_quantization_transform); // Store the quantized attribute in an array that will be used when we do // the actual encoding of the data. - quantized_portable_attributes_.push_back( - attribute_quantization_transform.GeneratePortableAttribute( - *att, static_cast<int>(num_points))); + auto portable_att = + attribute_quantization_transform.InitTransformedAttribute(*att, + num_points); + attribute_quantization_transform.TransformAttribute(*att, {}, + portable_att.get()); + quantized_portable_attributes_.push_back(std::move(portable_att)); } else if (att->data_type() == DT_INT32 || att->data_type() == DT_INT16 || att->data_type() == DT_INT8) { // For signed types, find the minimum value for each component. These |