Skip to content

Commit 19b8f02

Browse files
committed
Fixed countl_zero_bit
1 parent 56354d0 commit 19b8f02

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/nbl/builtin/hlsl/bit.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ template<typename T>
6161
uint16_t countl_zero(T n)
6262
{
6363
uint16_t result = 0u;
64-
for(uint32_t bits_log2 = 6u; bits_log2 >= 0u; bits_log2--)
64+
for(int32_t bits_log2 = 6u; bits_log2 >= 0u; bits_log2--)
6565
{
6666
const uint16_t shift = bits_log2 ? uint16_t(1)<<(bits_log2-1) : 0;
6767
const uint64_t loMask = bits_log2 ? (1ull<<shift)-1 : 0;

0 commit comments

Comments
 (0)