Skip to content

Commit 0365e30

Browse files
committed
Bit shift masks change
1 parent aae1dd8 commit 0365e30

File tree

1 file changed

+2
-2
lines changed
  • include/nbl/builtin/hlsl/workgroup

1 file changed

+2
-2
lines changed

include/nbl/builtin/hlsl/workgroup/fft.hlsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ namespace impl
5757
// Lowest bits numbered from 0 through N - H - 1
5858
NBL_CONSTEXPR_STATIC_INLINE uint32_t lowMask = (1 << (N - H)) - 1;
5959
NBL_CONSTEXPR_STATIC_INLINE uint32_t midMask = 1 << (N - H);
60-
NBL_CONSTEXPR_STATIC_INLINE uint32_t highMask = ~((1 << (N - H + 1)) - 1);
60+
NBL_CONSTEXPR_STATIC_INLINE uint32_t highMask = ~(lowMask | midMask);
6161

6262
uint32_t low = i & lowMask;
6363
uint32_t mid = i & midMask;
@@ -76,8 +76,8 @@ namespace impl
7676
// N - 1 is then the highest bit, and N - 2 through N - H are the middle bits
7777
// Lowest bits numbered from 0 through N - H - 1
7878
NBL_CONSTEXPR_STATIC_INLINE uint32_t lowMask = (1 << (N - H)) - 1;
79-
NBL_CONSTEXPR_STATIC_INLINE uint32_t midMask = ~((1 << (N - H)) - 1) | ~(1 << (N - 1));
8079
NBL_CONSTEXPR_STATIC_INLINE uint32_t highMask = 1 << (N - 1);
80+
NBL_CONSTEXPR_STATIC_INLINE uint32_t midMask = ~(lowMask | highMask);
8181

8282
uint32_t low = i & lowMask;
8383
uint32_t mid = i & midMask;

0 commit comments

Comments
 (0)