Skip to content

Commit c7caf76

Browse files
author
kevyuu
committed
Fix uninitialized bug in quantization cache
1 parent 86dae55 commit c7caf76

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/nbl/asset/utils/CDirQuantCacheBase.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,12 +496,13 @@ class CDirQuantCacheBase : public virtual core::IReferenceCounted, public impl::
496496
};
497497

498498
constexpr uint32_t cubeHalfSize = (0x1u << quantizationBits) - 1u;
499+
const auto test = core::vectorSIMDf(cubeHalfSize);
499500
const hlsl::vector<hlsl::float32_t, dimensions> cubeHalfSizeND = hlsl::vector<hlsl::float32_t, dimensions>(cubeHalfSize);
500501
for (uint32_t n=cubeHalfSize; n>0u; n--)
501502
{
502503
//we'd use float addition in the interest of speed, to increment the loop
503504
//but adding a small number to a large one loses precision, so multiplication preferrable
504-
const auto bottomFit = floor(fittingVector * float(n) + floorOffset);
505+
const auto bottomFit = glm::floor(fittingVector * float(n) + floorOffset);
505506
if (hlsl::all(glm::lessThanEqual(bottomFit, cubeHalfSizeND)))
506507
evaluateFit(bottomFit);
507508
for (auto i = 0u; i < cornerCount; i++)

0 commit comments

Comments
 (0)