Skip to content

Commit 535c5f2

Browse files
committed
Cad example compiles again
1 parent 43b271d commit 535c5f2

File tree

3 files changed

+10
-24
lines changed

3 files changed

+10
-24
lines changed

include/nbl/builtin/hlsl/cpp_compat/impl/intrinsics_impl.hlsl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@
1212
#include <nbl/builtin/hlsl/concepts/matrix.hlsl>
1313
#include <nbl/builtin/hlsl/cpp_compat/promote.hlsl>
1414
#include <nbl/builtin/hlsl/numbers.hlsl>
15-
#ifndef __HLSL_VERSION
1615
#include <boost/preprocessor/comparison/not_equal.hpp>
1716
#include <boost/preprocessor/punctuation/comma_if.hpp>
1817
#include <boost/preprocessor/seq/for_each_i.hpp>
19-
#endif
2018

2119
namespace nbl
2220
{

include/nbl/builtin/hlsl/emulated/float64_t.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ namespace impl
596596
template<bool FastMath, bool FlushDenormToZero>
597597
struct is_emulating_floating_point_scalar<emulated_float64_t<FastMath, FlushDenormToZero> >
598598
{
599-
NBL_CONSTEXPR_STATIC_INLINE value = true;
599+
NBL_CONSTEXPR_STATIC_INLINE bool value = true;
600600
};
601601
}
602602
}

include/nbl/builtin/hlsl/emulated/matrix_t.hlsl

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,6 @@ DEFINE_MATRIX_TRAITS_TEMPLATE_SPECIALIZATION(3, 4)
6969

7070
#undef DEFINE_MATRIX_TRAITS_TEMPLATE_SPECIALIZATION
7171

72-
template<typename T, int N, int M, int O>
73-
struct mul_output<emulated_matrix<T, N, M>, emulated_matrix<T, M, O> >
74-
{
75-
using type = emulated_matrix<T, N, O>;
76-
};
77-
78-
template<typename T, int N, int M>
79-
struct mul_output<emulated_matrix<T, N, M>, emulated_vector_t<T, N> >
80-
{
81-
using type = emulated_vector_t<T, N>;
82-
};
83-
8472
namespace cpp_compat_intrinsics_impl
8573
{
8674
template<typename T, int N, int M>
@@ -99,18 +87,18 @@ struct mul_helper<emulated_matrix<ComponentT, N, M>, emulated_matrix<ComponentT,
9987
{
10088
using LhsT = emulated_matrix<ComponentT, N, M>;
10189
using RhsT = emulated_matrix<ComponentT, M, O>;
102-
using OutputT = typename mul_output<LhsT, RhsT>::type;
90+
using return_t = emulated_matrix<ComponentT, N, O>;
10391

104-
static inline OutputT __call(LhsT lhs, RhsT rhs)
92+
static inline return_t __call(LhsT lhs, RhsT rhs)
10593
{
10694
typename matrix_traits<RhsT>::transposed_type rhsTransposed = rhs.getTransposed();
107-
const uint32_t outputRowCount = matrix_traits<OutputT>::RowCount;
108-
const uint32_t outputColumnCount = matrix_traits<OutputT>::ColumnCount;
109-
using OutputVecType = typename matrix_traits<OutputT>::row_type;
95+
const uint32_t outputRowCount = matrix_traits<return_t>::RowCount;
96+
const uint32_t outputColumnCount = matrix_traits<return_t>::ColumnCount;
97+
using OutputVecType = typename matrix_traits<return_t>::row_type;
11098

11199
nbl::hlsl::array_set<OutputVecType, typename vector_traits<OutputVecType>::scalar_type> setter;
112100

113-
OutputT output;
101+
return_t output;
114102
for (int r = 0; r < outputRowCount; ++r)
115103
{
116104
for (int c = 0; c < outputColumnCount; ++c)
@@ -126,14 +114,14 @@ struct mul_helper<emulated_matrix<ComponentT, RowCount, ColumnCount>, emulated_v
126114
{
127115
using MatT = emulated_matrix<ComponentT, RowCount, ColumnCount>;
128116
using VecT = emulated_vector_t<ComponentT, ColumnCount>;
129-
using OutVecT = emulated_vector_t<ComponentT, RowCount>;
117+
using return_t = emulated_vector_t<ComponentT, RowCount>;
130118

131-
static inline OutVecT __call(MatT mat, VecT vec)
119+
static inline return_t __call(MatT mat, VecT vec)
132120
{
133121
nbl::hlsl::array_get<VecT, typename vector_traits<VecT>::scalar_type> getter;
134122
nbl::hlsl::array_set<VecT, typename vector_traits<VecT>::scalar_type> setter;
135123

136-
OutVecT output;
124+
return_t output;
137125
for (int i = 0; i < RowCount; ++i)
138126
setter(output, i, nbl::hlsl::dot<VecT>(mat.rows[i], vec));
139127

0 commit comments

Comments
 (0)