From d73d4b1af1628661af2e13ddac8a1faa4a54d4fd Mon Sep 17 00:00:00 2001 From: Nicholas Frechette Date: Mon, 5 Feb 2024 21:39:52 -0500 Subject: [PATCH] fix: use as_scalar where possible to avoid deprecated usage --- .../acl/compression/impl/rigid_shell_utils.h | 12 ++++++------ includes/acl/compression/impl/track_array.impl.h | 8 ++++---- .../acl/compression/impl/track_list_context.h | 2 +- .../acl/compression/transform_error_metrics.h | 16 ++++++++-------- .../decompression/impl/decompression.scalar.h | 12 ++++++------ 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/includes/acl/compression/impl/rigid_shell_utils.h b/includes/acl/compression/impl/rigid_shell_utils.h index a4b25c04..9d962a58 100644 --- a/includes/acl/compression/impl/rigid_shell_utils.h +++ b/includes/acl/compression/impl/rigid_shell_utils.h @@ -129,9 +129,9 @@ namespace acl const rtm::vector4f raw_vtx1 = rtm::qvv_mul_point3(vtx1, raw_transform); const rtm::vector4f raw_vtx2 = rtm::qvv_mul_point3(vtx2, raw_transform); - const rtm::scalarf vtx0_distance = rtm::vector_length3(raw_vtx0); - const rtm::scalarf vtx1_distance = rtm::vector_length3(raw_vtx1); - const rtm::scalarf vtx2_distance = rtm::vector_length3(raw_vtx2); + const rtm::scalarf vtx0_distance = rtm::vector_length3_as_scalar(raw_vtx0); + const rtm::scalarf vtx1_distance = rtm::vector_length3_as_scalar(raw_vtx1); + const rtm::scalarf vtx2_distance = rtm::vector_length3_as_scalar(raw_vtx2); const rtm::scalarf transform_length = rtm::scalar_max(rtm::scalar_max(vtx0_distance, vtx1_distance), vtx2_distance); parent_shell_distance = rtm::scalar_max(parent_shell_distance, transform_length); @@ -245,9 +245,9 @@ namespace acl const rtm::vector4f raw_vtx1 = rtm::qvv_mul_point3(vtx1, raw_transform); const rtm::vector4f raw_vtx2 = rtm::qvv_mul_point3(vtx2, raw_transform); - const rtm::scalarf vtx0_distance = rtm::vector_length3(raw_vtx0); - const rtm::scalarf vtx1_distance = rtm::vector_length3(raw_vtx1); - const rtm::scalarf vtx2_distance = rtm::vector_length3(raw_vtx2); + const rtm::scalarf vtx0_distance = rtm::vector_length3_as_scalar(raw_vtx0); + const rtm::scalarf vtx1_distance = rtm::vector_length3_as_scalar(raw_vtx1); + const rtm::scalarf vtx2_distance = rtm::vector_length3_as_scalar(raw_vtx2); const rtm::scalarf transform_length = rtm::scalar_max(rtm::scalar_max(vtx0_distance, vtx1_distance), vtx2_distance); parent_shell_distance = rtm::scalar_max(parent_shell_distance, transform_length); diff --git a/includes/acl/compression/impl/track_array.impl.h b/includes/acl/compression/impl/track_array.impl.h index 3c5c26e3..b0216c22 100644 --- a/includes/acl/compression/impl/track_array.impl.h +++ b/includes/acl/compression/impl/track_array.impl.h @@ -251,8 +251,8 @@ namespace acl ACL_ASSERT(rounding_policy_ != sample_rounding_policy::per_track, "track_writer::get_rounding_policy() cannot return per_track"); const float alpha = interpolation_alpha_per_policy[static_cast(rounding_policy_)]; - const rtm::scalarf value0 = rtm::scalar_load(&track__[key_frame0]); - const rtm::scalarf value1 = rtm::scalar_load(&track__[key_frame1]); + const rtm::scalarf value0 = rtm::scalar_load_as_scalar(&track__[key_frame0]); + const rtm::scalarf value1 = rtm::scalar_load_as_scalar(&track__[key_frame1]); const rtm::scalarf value = rtm::scalar_lerp(value0, value1, rtm::scalar_set(alpha)); writer.write_float1(track_index, value); } @@ -371,8 +371,8 @@ namespace acl { const track_float1f& track__ = track_cast(track_); - const rtm::scalarf value0 = rtm::scalar_load(&track__[key_frame0]); - const rtm::scalarf value1 = rtm::scalar_load(&track__[key_frame1]); + const rtm::scalarf value0 = rtm::scalar_load_as_scalar(&track__[key_frame0]); + const rtm::scalarf value1 = rtm::scalar_load_as_scalar(&track__[key_frame1]); const rtm::scalarf value = rtm::scalar_lerp(value0, value1, rtm::scalar_set(interpolation_alpha)); writer.write_float1(track_index, value); break; diff --git a/includes/acl/compression/impl/track_list_context.h b/includes/acl/compression/impl/track_list_context.h index 9dfd2545..0b7e811f 100644 --- a/includes/acl/compression/impl/track_list_context.h +++ b/includes/acl/compression/impl/track_list_context.h @@ -137,7 +137,7 @@ namespace acl for (uint32_t sample_index = 0; sample_index < num_samples; ++sample_index) { const vector4f sample = vector_load1(&typed_ref_track[sample_index]); - are_samples_valid &= scalar_is_finite(scalarf(vector_get_x(sample))); + are_samples_valid &= scalar_is_finite(vector_get_x_as_scalar(sample)); track[sample_index] = sample; } out_track = std::move(track); diff --git a/includes/acl/compression/transform_error_metrics.h b/includes/acl/compression/transform_error_metrics.h index 73edd131..fc5c7b97 100644 --- a/includes/acl/compression/transform_error_metrics.h +++ b/includes/acl/compression/transform_error_metrics.h @@ -350,9 +350,9 @@ namespace acl const rtm::vector4f lossy_vtx1 = rtm::qvv_mul_point3(vtx1, lossy_transform_); const rtm::vector4f lossy_vtx2 = rtm::qvv_mul_point3(vtx2, lossy_transform_); - const rtm::scalarf vtx0_error = rtm::vector_distance3(raw_vtx0, lossy_vtx0); - const rtm::scalarf vtx1_error = rtm::vector_distance3(raw_vtx1, lossy_vtx1); - const rtm::scalarf vtx2_error = rtm::vector_distance3(raw_vtx2, lossy_vtx2); + const rtm::scalarf vtx0_error = rtm::vector_distance3_as_scalar(raw_vtx0, lossy_vtx0); + const rtm::scalarf vtx1_error = rtm::vector_distance3_as_scalar(raw_vtx1, lossy_vtx1); + const rtm::scalarf vtx2_error = rtm::vector_distance3_as_scalar(raw_vtx2, lossy_vtx2); return rtm::scalar_max(rtm::scalar_max(vtx0_error, vtx1_error), vtx2_error); } @@ -371,8 +371,8 @@ namespace acl const rtm::vector4f lossy_vtx0 = rtm::qvv_mul_point3_no_scale(vtx0, lossy_transform_); const rtm::vector4f lossy_vtx1 = rtm::qvv_mul_point3_no_scale(vtx1, lossy_transform_); - const rtm::scalarf vtx0_error = rtm::vector_distance3(raw_vtx0, lossy_vtx0); - const rtm::scalarf vtx1_error = rtm::vector_distance3(raw_vtx1, lossy_vtx1); + const rtm::scalarf vtx0_error = rtm::vector_distance3_as_scalar(raw_vtx0, lossy_vtx0); + const rtm::scalarf vtx1_error = rtm::vector_distance3_as_scalar(raw_vtx1, lossy_vtx1); return rtm::scalar_max(vtx0_error, vtx1_error); } @@ -453,9 +453,9 @@ namespace acl const rtm::vector4f lossy_vtx1 = rtm::matrix_mul_point3(vtx1, lossy_transform_); const rtm::vector4f lossy_vtx2 = rtm::matrix_mul_point3(vtx2, lossy_transform_); - const rtm::scalarf vtx0_error = rtm::vector_distance3(raw_vtx0, lossy_vtx0); - const rtm::scalarf vtx1_error = rtm::vector_distance3(raw_vtx1, lossy_vtx1); - const rtm::scalarf vtx2_error = rtm::vector_distance3(raw_vtx2, lossy_vtx2); + const rtm::scalarf vtx0_error = rtm::vector_distance3_as_scalar(raw_vtx0, lossy_vtx0); + const rtm::scalarf vtx1_error = rtm::vector_distance3_as_scalar(raw_vtx1, lossy_vtx1); + const rtm::scalarf vtx2_error = rtm::vector_distance3_as_scalar(raw_vtx2, lossy_vtx2); return rtm::scalar_max(rtm::scalar_max(vtx0_error, vtx1_error), vtx2_error); } diff --git a/includes/acl/decompression/impl/decompression.scalar.h b/includes/acl/decompression/impl/decompression.scalar.h index acbf01c7..09526c6e 100644 --- a/includes/acl/decompression/impl/decompression.scalar.h +++ b/includes/acl/decompression/impl/decompression.scalar.h @@ -284,7 +284,7 @@ namespace acl rtm::scalarf value; if (num_bits_per_component == 0) // Constant bit rate { - value = rtm::scalar_load(constant_values); + value = rtm::scalar_load_as_scalar(constant_values); constant_values += 1; } else @@ -301,8 +301,8 @@ namespace acl value0 = unpack_scalarf_uXX_unsafe(num_bits_per_component, animated_values, track_bit_offset0); value1 = unpack_scalarf_uXX_unsafe(num_bits_per_component, animated_values, track_bit_offset1); - const rtm::scalarf range_min = rtm::scalar_load(range_values); - const rtm::scalarf range_extent = rtm::scalar_load(range_values + 1); + const rtm::scalarf range_min = rtm::scalar_load_as_scalar(range_values); + const rtm::scalarf range_extent = rtm::scalar_load_as_scalar(range_values + 1); value0 = rtm::scalar_mul_add(value0, range_extent, range_min); value1 = rtm::scalar_mul_add(value1, range_extent, range_min); range_values += 2; @@ -548,7 +548,7 @@ namespace acl { rtm::scalarf value; if (num_bits_per_component == 0) // Constant bit rate - value = rtm::scalar_load(constant_values); + value = rtm::scalar_load_as_scalar(constant_values); else { rtm::scalarf value0; @@ -563,8 +563,8 @@ namespace acl value0 = unpack_scalarf_uXX_unsafe(num_bits_per_component, animated_values, context.key_frame_bit_offsets[0] + track_bit_offset); value1 = unpack_scalarf_uXX_unsafe(num_bits_per_component, animated_values, context.key_frame_bit_offsets[1] + track_bit_offset); - const rtm::scalarf range_min = rtm::scalar_load(range_values); - const rtm::scalarf range_extent = rtm::scalar_load(range_values + num_element_components); + const rtm::scalarf range_min = rtm::scalar_load_as_scalar(range_values); + const rtm::scalarf range_extent = rtm::scalar_load_as_scalar(range_values + num_element_components); value0 = rtm::scalar_mul_add(value0, range_extent, range_min); value1 = rtm::scalar_mul_add(value1, range_extent, range_min); }