Skip to content

Commit b7f7169

Browse files
committed
Restored the removed system::to_string specializations
1 parent 2a43ae8 commit b7f7169

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

include/nbl/system/to_string.h

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#define _NBL_SYSTEM_TO_STRING_INCLUDED_
33

44
#include <nbl/builtin/hlsl/cpp_compat.hlsl>
5+
#include <nbl/builtin/hlsl/emulated/int64_t.hlsl>
6+
#include <nbl/builtin/hlsl/morton.hlsl>
57

68
namespace nbl
79
{
@@ -19,6 +21,24 @@ struct to_string_helper
1921
}
2022
};
2123

24+
template<>
25+
struct to_string_helper<hlsl::emulated_uint64_t>
26+
{
27+
static std::string __call(const hlsl::emulated_uint64_t& value)
28+
{
29+
return std::to_string(static_cast<uint64_t>(value));
30+
}
31+
};
32+
33+
template<>
34+
struct to_string_helper<hlsl::emulated_int64_t>
35+
{
36+
static std::string __call(const hlsl::emulated_int64_t& value)
37+
{
38+
return std::to_string(static_cast<int64_t>(value));
39+
}
40+
};
41+
2242
template<typename T, int16_t N>
2343
struct to_string_helper<hlsl::vector<T, N>>
2444
{
@@ -39,6 +59,18 @@ struct to_string_helper<hlsl::vector<T, N>>
3959
}
4060
};
4161

62+
template<bool Signed, uint16_t Bits, uint16_t D, typename _uint64_t>
63+
struct to_string_helper<hlsl::morton::code<Signed, Bits, D, _uint64_t>>
64+
{
65+
using value_t = hlsl::morton::code<Signed, Bits, D, _uint64_t>;
66+
static std::string __call(value_t value)
67+
{
68+
TestValueToTextConverter<value_t::storage_t> mortonCodeDataToTextConverter;
69+
return mortonCodeDataToTextConverter(value.value);
70+
}
71+
};
72+
73+
4274
}
4375

4476
template<typename T>

0 commit comments

Comments
 (0)