Skip to content

Commit 0d5ede1

Browse files
committed
Resolved conflicts, merged master
2 parents abf6ed7 + 099693e commit 0d5ede1

File tree

22 files changed

+1874
-84
lines changed

22 files changed

+1874
-84
lines changed

examples_tests

Submodule examples_tests updated 41 files

include/nbl/asset/utils/CCompilerSet.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ namespace nbl::asset
3333

3434
#ifdef _NBL_PLATFORM_WINDOWS_
3535
return m_HLSLCompiler;
36+
#else
37+
return nullptr;
3638
#endif
3739
}
3840
else if (contentType == IShader::E_CONTENT_TYPE::ECT_GLSL)

include/nbl/builtin/hlsl/algorithm.hlsl

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,84 @@ namespace nbl
1111
namespace hlsl
1212
{
1313

14+
namespace impl
15+
{
16+
#ifdef __HLSL_VERSION
17+
18+
// TODO: use structs
19+
20+
template<typename T>
21+
NBL_CONSTEXPR_INLINE_FUNC void swap(NBL_REF_ARG(T) lhs, NBL_REF_ARG(T) rhs)
22+
{
23+
T tmp = lhs;
24+
lhs = rhs;
25+
rhs = tmp;
26+
}
27+
28+
template<>
29+
NBL_CONSTEXPR_INLINE_FUNC void swap(NBL_REF_ARG(uint16_t) lhs, NBL_REF_ARG(uint16_t) rhs)
30+
{
31+
lhs ^= rhs;
32+
rhs ^= lhs;
33+
lhs ^= rhs;
34+
}
35+
36+
template<>
37+
NBL_CONSTEXPR_INLINE_FUNC void swap(NBL_REF_ARG(uint32_t) lhs, NBL_REF_ARG(uint32_t) rhs)
38+
{
39+
lhs ^= rhs;
40+
rhs ^= lhs;
41+
lhs ^= rhs;
42+
}
43+
44+
template<>
45+
NBL_CONSTEXPR_INLINE_FUNC void swap(NBL_REF_ARG(uint64_t) lhs, NBL_REF_ARG(uint64_t) rhs)
46+
{
47+
lhs ^= rhs;
48+
rhs ^= lhs;
49+
lhs ^= rhs;
50+
}
51+
52+
template<>
53+
NBL_CONSTEXPR_INLINE_FUNC void swap(NBL_REF_ARG(int16_t) lhs, NBL_REF_ARG(int16_t) rhs)
54+
{
55+
lhs ^= rhs;
56+
rhs ^= lhs;
57+
lhs ^= rhs;
58+
}
59+
60+
template<>
61+
NBL_CONSTEXPR_INLINE_FUNC void swap(NBL_REF_ARG(int32_t) lhs, NBL_REF_ARG(int32_t) rhs)
62+
{
63+
lhs ^= rhs;
64+
rhs ^= lhs;
65+
lhs ^= rhs;
66+
}
67+
68+
template<>
69+
NBL_CONSTEXPR_INLINE_FUNC void swap(NBL_REF_ARG(int64_t) lhs, NBL_REF_ARG(int64_t) rhs)
70+
{
71+
lhs ^= rhs;
72+
rhs ^= lhs;
73+
lhs ^= rhs;
74+
}
75+
#else
76+
template<typename T>
77+
NBL_CONSTEXPR_INLINE_FUNC void swap(NBL_REF_ARG(T) lhs, NBL_REF_ARG(T) rhs)
78+
{
79+
std::swap(lhs, rhs);
80+
}
81+
#endif
82+
}
83+
84+
template<typename T>
85+
NBL_CONSTEXPR_INLINE_FUNC void swap(NBL_REF_ARG(T) lhs, NBL_REF_ARG(T) rhs)
86+
{
87+
impl::swap<T>(lhs, rhs);
88+
}
89+
90+
91+
#ifdef __HLSL_VERSION
1492

1593
namespace impl
1694
{
@@ -146,6 +224,7 @@ uint upper_bound(inout Accessor accessor, const uint begin, const uint end, cons
146224
return impl::upper_bound<Accessor,typename Accessor::value_type>(accessor,begin,end,value);
147225
}
148226

227+
#endif
149228
}
150229
}
151230

include/nbl/builtin/hlsl/cpp_compat/intrinsics.hlsl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <nbl/builtin/hlsl/array_accessors.hlsl>
88
#include <nbl/builtin/hlsl/cpp_compat/impl/intrinsics_impl.hlsl>
99
#include <nbl/builtin/hlsl/matrix_utils/matrix_traits.hlsl>
10+
#include <nbl/builtin/hlsl/ieee754.hlsl>
1011

1112
#ifndef __HLSL_VERSION
1213
#include <algorithm>

0 commit comments

Comments
 (0)