From c545d00f92594af20c0e34559f4e29306de7cd41 Mon Sep 17 00:00:00 2001 From: Vladyslav Baranovskyi Date: Wed, 19 Feb 2025 12:07:14 +0200 Subject: [PATCH] Defined USING_CUSTOM_FLOAT16 preproc constant along with float16 class and gated formatter for float16 --- openVulkanoCpp/Extensions/FmtFormatter.hpp | 2 ++ openVulkanoCpp/Math/Float16.hpp | 1 + 2 files changed, 3 insertions(+) diff --git a/openVulkanoCpp/Extensions/FmtFormatter.hpp b/openVulkanoCpp/Extensions/FmtFormatter.hpp index 737ec30..48c22d0 100644 --- a/openVulkanoCpp/Extensions/FmtFormatter.hpp +++ b/openVulkanoCpp/Extensions/FmtFormatter.hpp @@ -323,6 +323,7 @@ struct fmt::formatter } }; +#ifdef USING_CUSTOM_FLOAT16 template<> struct fmt::formatter : fmt::formatter { @@ -332,6 +333,7 @@ struct fmt::formatter : fmt::formatter return fmt::formatter::format(static_cast(f), ctx); } }; +#endif template<> struct fmt::formatter : fmt::formatter diff --git a/openVulkanoCpp/Math/Float16.hpp b/openVulkanoCpp/Math/Float16.hpp index 160e6f4..8cc7531 100644 --- a/openVulkanoCpp/Math/Float16.hpp +++ b/openVulkanoCpp/Math/Float16.hpp @@ -18,6 +18,7 @@ #elif __has_keyword(__fp16) typedef __fp16 float16; #else +#define USING_CUSTOM_FLOAT16 class float16 {