Skip to content

Commit b948b6f

Browse files
committed
zero-length hash
1 parent abf7bdc commit b948b6f

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/nbl/asset/ICPUImage.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -240,16 +240,7 @@ class CFlattenRegionsStreamHashImageFilter : public CMatchedSizeInOutImageFilter
240240
const auto regions = image->getRegions(miplevel);
241241
const bool performNullHash = regions.empty();
242242

243-
if (performNullHash)
244-
{
245-
const auto mipExtentInBlocks = info.convertTexelsToBlocks(image->getMipSize(miplevel));
246-
const auto zeroLength = info.getBlockByteSize() * mipExtentInBlocks.x;
247-
auto zeroArray = std::make_unique<uint8_t[]>(zeroLength);
248-
for (auto z = 0; z < mipExtentInBlocks.z; z++)
249-
for (auto y = 0; y < mipExtentInBlocks.y; y++)
250-
blake3_hasher_update(hasher, zeroArray.get(), zeroLength);
251-
}
252-
else
243+
if (!performNullHash)
253244
CBasicImageFilterCommon::executePerRegion(std::execution::seq, image, executePerTexelOrBlock, regions, clipFunctor); // fire the hasher for a layer, note we forcing seq policy because texels/blocks cannot be handled with par policies when we hash them
254245

255246
blake3_hasher_finalize(hasher, reinterpret_cast<uint8_t*>(hash), sizeof(CState::hash_t)); // finalize hash for layer + put it to heap for given mip level

0 commit comments

Comments
 (0)