Skip to content

Commit d07fddf

Browse files
committed
fix after merge
1 parent 6cb62ba commit d07fddf

File tree

2 files changed

+5
-37
lines changed

2 files changed

+5
-37
lines changed

include/nbl/asset/ICPUImage.h

Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
namespace nbl::asset
1515
{
1616

17-
class ICPUImage final : public IImage, public IPreHashed
17+
class NBL_API2 ICPUImage final : public IImage, public IPreHashed
1818
{
1919
public:
2020
inline static core::smart_refctd_ptr<ICPUImage> create(const SCreationParams& _params)
@@ -44,38 +44,7 @@ class ICPUImage final : public IImage, public IPreHashed
4444
// Having regions specififed to upload is optional!
4545
inline size_t getDependantCount() const override {return !missingContent()&&buffer ? 1:0;}
4646

47-
//!
48-
inline core::blake3_hash_t computeContentHash() const override
49-
{
50-
// TODO: Arek turn this into an image filter maybe?
51-
core::blake3_hasher hasher;
52-
for (auto m=0; m<m_creationParams.mipLevels; m++)
53-
{
54-
const auto blockInfo = getTexelBlockInfo();
55-
const auto mipExtentInBlocks = blockInfo.convertTexelsToBlocks(getMipSize(m));
56-
core::blake3_hasher levelHasher;
57-
if (missingContent())
58-
{
59-
const auto zeroLength = blockInfo.getBlockByteSize()*mipExtentInBlocks[0];
60-
auto zeroArray = std::make_unique<uint8_t[]>(zeroLength);
61-
for (auto l=0; l<m_creationParams.arrayLayers; l++)
62-
{
63-
// layers could be run in parallel
64-
core::blake3_hasher layerHasher;
65-
for (auto z=0; z<mipExtentInBlocks[2]; z++)
66-
for (auto y=0; y<mipExtentInBlocks[1]; y++)
67-
layerHasher.update(zeroArray.get(),zeroLength);
68-
levelHasher << static_cast<core::blake3_hash_t>(layerHasher);
69-
}
70-
}
71-
else
72-
{
73-
_NBL_TODO(); // TODO: Arek
74-
}
75-
levelHasher << static_cast<core::blake3_hash_t>(levelHasher);
76-
}
77-
return static_cast<core::blake3_hash_t>(hasher);
78-
}
47+
core::blake3_hash_t computeContentHash() const override;
7948

8049
inline bool missingContent() const override
8150
{
@@ -95,14 +64,14 @@ class ICPUImage final : public IImage, public IPreHashed
9564
}
9665
inline const auto* getBuffer() const { return buffer.get(); }
9766

98-
inline core::SRange<const IImage::SBufferCopy> getRegions() const
67+
inline std::span<const IImage::SBufferCopy> getRegions() const
9968
{
10069
if (regions)
10170
return {regions->begin(),regions->end()};
102-
return {nullptr,nullptr};
71+
return {};
10372
}
10473

105-
inline core::SRange<const IImage::SBufferCopy> getRegions(uint32_t mipLevel) const
74+
inline std::span<const IImage::SBufferCopy> getRegions(uint32_t mipLevel) const
10675
{
10776
const IImage::SBufferCopy dummy = { 0ull,0u,0u,{static_cast<E_ASPECT_FLAGS>(0u),mipLevel,0u,0u},{},{} };
10877
auto begin = std::lower_bound(regions->begin(),regions->end(),dummy,mip_order_t());

include/nbl/asset/IDescriptorSetLayout.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,6 @@ class IDescriptorSetLayout : public IDescriptorSetLayoutBase
467467
if ((b.type == IDescriptor::E_TYPE::ET_SAMPLER or b.type == IDescriptor::E_TYPE::ET_COMBINED_IMAGE_SAMPLER) and b.immutableSamplers)
468468
{
469469
const auto localOffset = m_immutableSamplerRedirect.getStorageOffset(typename CBindingRedirect::binding_number_t(b.binding)).data;
470-
assert(bool(localOffset));
471470

472471
auto* dst = m_immutableSamplers->begin() + localOffset;
473472
std::copy_n(b.immutableSamplers, b.count, dst);

0 commit comments

Comments
 (0)