Skip to content

Commit a6ef74c

Browse files
author
kevyuu
committed
Small fixes on quantization cache.
1 parent daea0ad commit a6ef74c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

include/nbl/asset/utils/CDirQuantCacheBase.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ class CDirQuantCacheBase : public virtual core::IReferenceCounted, public impl::
438438
// for positive number xoring with 0 keep its value
439439
// for negative number we xor with all one which will flip the bits, then we add one later. Flipping the bits then adding one will turn positive number into negative number
440440
auto restoredAsVec = quantized.getValue() ^ select(hlsl::uint32_t4(0u), hlsl::uint32_t4(xorflag), negativeMask);
441-
restoredAsVec += (hlsl::uint32_t4(1u) & hlsl::uint32_t4(negativeMask));
441+
restoredAsVec += hlsl::uint32_t4(negativeMask);
442442

443443
return value_type_t<CacheFormat>(restoredAsVec);
444444
}
@@ -504,8 +504,7 @@ class CDirQuantCacheBase : public virtual core::IReferenceCounted, public impl::
504504
};
505505

506506
constexpr uint32_t cubeHalfSize = (0x1u << quantizationBits) - 1u;
507-
const auto test = core::vectorSIMDf(cubeHalfSize);
508-
const float32_tN cubeHalfSizeND = float32_tN(cubeHalfSize);
507+
const float32_tN cubeHalfSizeND = hlsl::promote<float32_tN>(cubeHalfSize);
509508
for (uint32_t n=cubeHalfSize; n>0u; n--)
510509
{
511510
//we'd use float addition in the interest of speed, to increment the loop

0 commit comments

Comments
 (0)