Skip to content

Commit 3fa43e2

Browse files
author
devsh
committed
something should be on screen but my fast_affine.hlsl is busted
1 parent 5462fe3 commit 3fa43e2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

include/nbl/builtin/hlsl/math/linalg/fast_affine.hlsl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ matrix<T,N,M> promoted_mul(NBL_CONST_REF_ARG(matrix<T,N,P>) lhs, NBL_CONST_REF_A
3838
// out[i] == lhs[i][0]*rhs[0]+...+lhs[i][3]*rhs[3]
3939
NBL_UNROLL for (uint32_t i=0; i<N; i++)
4040
{
41-
vector<T,M> acc = rhs[i];
41+
vector<T,M> acc = i<Q ? rhs[i]:promote<vector<T,M> >(0);
42+
if (i>=Q)
43+
acc[i] = T(1);
4244
// multiply if not outside of `lhs` matrix
4345
// otherwise the diagonal element is just unity
4446
if (i<P)

0 commit comments

Comments
 (0)