From 08399e498653d64b7412f382f328927d95769d74 Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Mon, 12 Oct 2026 16:54:01 +0200 Subject: [PATCH] MathUtils: let bringTo* deduce the type of the call they forward to The parameter is a reference, so T is deduced with the address space attached, and forcing that same T on a by-value parameter is a substitution failure on Metal. Letting the inner call deduce its own type gives the same T everywhere else, where the address space is not part of it. --- Common/MathUtils/include/MathUtils/detail/trigonometric.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Common/MathUtils/include/MathUtils/detail/trigonometric.h b/Common/MathUtils/include/MathUtils/detail/trigonometric.h index fd80f3a928b60..3b363d1955a18 100644 --- a/Common/MathUtils/include/MathUtils/detail/trigonometric.h +++ b/Common/MathUtils/include/MathUtils/detail/trigonometric.h @@ -48,7 +48,7 @@ GPUhdi() T to02Pi(T phi) template GPUhdi() void bringTo02Pi(T& phi) { - phi = to02Pi(phi); + phi = to02Pi(phi); } template @@ -68,7 +68,7 @@ inline T to02PiGen(T phi) template inline void bringTo02PiGen(T& phi) { - phi = to02PiGen(phi); + phi = to02PiGen(phi); } template @@ -87,7 +87,7 @@ GPUhdi() T toPMPi(T phi) template GPUhdi() void bringToPMPi(T& phi) { - phi = toPMPi(phi); + phi = toPMPi(phi); } template @@ -107,7 +107,7 @@ inline T toPMPiGen(T phi) template inline void bringToPMPiGen(T& phi) { - phi = toPMPiGen(phi); + phi = toPMPiGen(phi); } #if defined(__OPENCL__) || defined(__METAL__) // TODO: get rid of that stupid workaround for OpenCL template address spaces