Отказ от restrict функций для упрощения библиотеки. Компиляторы достаточно хорошо оптимизируют не-restrict inline-функции
This commit is contained in:
parent
f402f68516
commit
ed404690ed
17 changed files with 48 additions and 257 deletions
|
|
@ -132,7 +132,7 @@ inline int bgc_fp64_affine3_get_inverse(BGC_FP64_Affine3* const destination, con
|
|||
inline void bgc_fp32_affine3_combine(BGC_FP32_Affine3* const combination, const BGC_FP32_Affine3* const first, const BGC_FP32_Affine3* const second)
|
||||
{
|
||||
BGC_FP32_Vector3 first_shift;
|
||||
_bgc_fp32_restrict_matrix3x3_multiply_by_vector3(&first_shift, &second->distortion, &first->shift);
|
||||
bgc_fp32_matrix3x3_multiply_by_vector3(&first_shift, &second->distortion, &first->shift);
|
||||
bgc_fp32_vector3_add(&combination->shift, &first_shift, &second->shift);
|
||||
bgc_fp32_matrix3x3_multiply_by_matrix3x3(&combination->distortion, &second->distortion, &first->distortion);
|
||||
}
|
||||
|
|
@ -140,7 +140,7 @@ inline void bgc_fp32_affine3_combine(BGC_FP32_Affine3* const combination, const
|
|||
inline void bgc_fp64_affine3_combine(BGC_FP64_Affine3* const combination, const BGC_FP64_Affine3* const first, const BGC_FP64_Affine3* const second)
|
||||
{
|
||||
BGC_FP64_Vector3 first_shift;
|
||||
_bgc_fp64_restrict_matrix3x3_multiply_by_vector3(&first_shift, &second->distortion, &first->shift);
|
||||
bgc_fp64_matrix3x3_multiply_by_vector3(&first_shift, &second->distortion, &first->shift);
|
||||
bgc_fp64_vector3_add(&combination->shift, &first_shift, &second->shift);
|
||||
bgc_fp64_matrix3x3_multiply_by_matrix3x3(&combination->distortion, &second->distortion, &first->distortion);
|
||||
}
|
||||
|
|
@ -150,14 +150,14 @@ inline void bgc_fp64_affine3_combine(BGC_FP64_Affine3* const combination, const
|
|||
inline void bgc_fp32_affine3_transform_point(BGC_FP32_Vector3* const transformed_point, const BGC_FP32_Affine3* const affine, const BGC_FP32_Vector3* const initial_point)
|
||||
{
|
||||
BGC_FP32_Vector3 distorted;
|
||||
_bgc_fp32_restrict_matrix3x3_multiply_by_vector3(&distorted, &affine->distortion, initial_point);
|
||||
bgc_fp32_matrix3x3_multiply_by_vector3(&distorted, &affine->distortion, initial_point);
|
||||
bgc_fp32_vector3_add(transformed_point, &affine->shift, &distorted);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_affine3_transform_point(BGC_FP64_Vector3* const transformed_point, const BGC_FP64_Affine3* const affine, const BGC_FP64_Vector3* const initial_point)
|
||||
{
|
||||
BGC_FP64_Vector3 distorted;
|
||||
_bgc_fp64_restrict_matrix3x3_multiply_by_vector3(&distorted, &affine->distortion, initial_point);
|
||||
bgc_fp64_matrix3x3_multiply_by_vector3(&distorted, &affine->distortion, initial_point);
|
||||
bgc_fp64_vector3_add(transformed_point, &affine->shift, &distorted);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue