From a9e107835c0c0735cb0a83c70908c8375c7e544a Mon Sep 17 00:00:00 2001 From: Przemog1 Date: Mon, 1 Dec 2025 13:57:18 +0100 Subject: [PATCH 1/2] Resolved conflicts cherry-picked from the `unified_testing_interface` branch --- examples_tests | 2 +- include/nbl/system/to_string.h | 84 ++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 include/nbl/system/to_string.h diff --git a/examples_tests b/examples_tests index 829ea34183..e5d5ae2ca9 160000 --- a/examples_tests +++ b/examples_tests @@ -1 +1 @@ -Subproject commit 829ea34183a0a62a3bd68ded4dd9e451b97126d4 +Subproject commit e5d5ae2ca9137a6966d00aa039f3e6dae7c23fb9 diff --git a/include/nbl/system/to_string.h b/include/nbl/system/to_string.h new file mode 100644 index 0000000000..70ecfba211 --- /dev/null +++ b/include/nbl/system/to_string.h @@ -0,0 +1,84 @@ +#ifndef _NBL_SYSTEM_TO_STRING_INCLUDED_ +#define _NBL_SYSTEM_TO_STRING_INCLUDED_ + +#include +#include +#include + +namespace nbl +{ +namespace system +{ +namespace impl +{ + +template +struct to_string_helper +{ + static std::string __call(const T& value) + { + return std::to_string(value); + } +}; + +template<> +struct to_string_helper +{ + static std::string __call(const hlsl::emulated_uint64_t& value) + { + return std::to_string(static_cast(value)); + } +}; + +template<> +struct to_string_helper +{ + static std::string __call(const hlsl::emulated_int64_t& value) + { + return std::to_string(static_cast(value)); + } +}; + +template +struct to_string_helper> +{ + static std::string __call(const hlsl::vector& value) + { + std::stringstream output; + output << "{ "; + for (int i = 0; i < N; ++i) + { + output << to_string_helper::__call(value[i]); + + if (i < N - 1) + output << ", "; + } + output << " }"; + + return output.str(); + } +}; + +template +struct to_string_helper> +{ + using value_t = hlsl::morton::code; + static std::string __call(value_t value) + { + TestValueToTextConverter mortonCodeDataToTextConverter; + return mortonCodeDataToTextConverter(value.value); + } +}; + + +} + +template +std::string to_string(T value) +{ + return impl::to_string_helper::__call(value); +} +} +} + +#endif \ No newline at end of file From 1e7ea64e23be96f204d87dc98b5913cb5db44664 Mon Sep 17 00:00:00 2001 From: Przemog1 Date: Mon, 1 Dec 2025 15:37:21 +0100 Subject: [PATCH 2/2] Removed from the `to_string` function specialization of types not present yet in the master branch --- include/nbl/system/to_string.h | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/include/nbl/system/to_string.h b/include/nbl/system/to_string.h index 70ecfba211..92888704c0 100644 --- a/include/nbl/system/to_string.h +++ b/include/nbl/system/to_string.h @@ -2,8 +2,6 @@ #define _NBL_SYSTEM_TO_STRING_INCLUDED_ #include -#include -#include namespace nbl { @@ -21,24 +19,6 @@ struct to_string_helper } }; -template<> -struct to_string_helper -{ - static std::string __call(const hlsl::emulated_uint64_t& value) - { - return std::to_string(static_cast(value)); - } -}; - -template<> -struct to_string_helper -{ - static std::string __call(const hlsl::emulated_int64_t& value) - { - return std::to_string(static_cast(value)); - } -}; - template struct to_string_helper> { @@ -59,18 +39,6 @@ struct to_string_helper> } }; -template -struct to_string_helper> -{ - using value_t = hlsl::morton::code; - static std::string __call(value_t value) - { - TestValueToTextConverter mortonCodeDataToTextConverter; - return mortonCodeDataToTextConverter(value.value); - } -}; - - } template