vktRayTracingMiscTests.cpp: abs -> fabsf
authorRobert Morell <rmorell@nvidia.com>
Thu, 10 Dec 2020 01:23:48 +0000 (17:23 -0800)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 10 Dec 2020 15:27:57 +0000 (10:27 -0500)
Fixes these errors building for FreeBSD 10.4 with llvm60:
/root/nvt/tests/buildvulkancts/vk-gl-cts/external/vulkancts/modules/vulkan/ray_tracing/vktRayTracingMiscTests.cpp:2248:11: error: call to 'abs' is ambiguous
                                                if (abs(currentItem.dataChunk.at(nItem) - static_cast<float>(nRay + nItem)) > 1e-3f)
                                                    ^~~
/usr/include/stdlib.h:83:6: note: candidate function
int      abs(int) __pure2;
         ^
/usr/include/c++/v1/cstdlib:159:44: note: candidate function
inline _LIBCPP_INLINE_VISIBILITY long      abs(     long __x) _NOEXCEPT {return  labs(__x);}
                                           ^
/usr/include/c++/v1/cstdlib:161:44: note: candidate function
inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT {return llabs(__x);}
                                           ^

VK-GL-CTS issue: 2696

Components: Vulkan

Affects:
dEQP-VK.ray_tracing_pipeline.misc.callableshaderstress*

Change-Id: I0be12116f368d02251a7b1d6a560d1ff898f78dd

external/vulkancts/modules/vulkan/ray_tracing/vktRayTracingMiscTests.cpp

index 3d9be19..caab036 100644 (file)
@@ -2245,7 +2245,7 @@ public:
 
                                        for (deUint32 nItem = 0; nItem < nValidItemsRequired; ++nItem)
                                        {
-                                               if (abs(currentItem.dataChunk.at(nItem) - static_cast<float>(nRay + nItem)) > 1e-3f)
+                                               if (fabsf(currentItem.dataChunk.at(nItem) - static_cast<float>(nRay + nItem)) > 1e-3f)
                                                {
                                                        goto end;
                                                }