Skip to content

Commit fe308ed

Browse files
committed
Add some useful comments and commented out immutability checks.
1 parent 63bea08 commit fe308ed

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

include/nbl/asset/ICPUDescriptorSet.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ class ICPUDescriptorSet final : public IDescriptorSet<ICPUDescriptorSetLayout>,
7070

7171
inline core::SRange<SDescriptorInfo> getDescriptorInfoStorage(const IDescriptor::E_TYPE type) const
7272
{
73+
// TODO: @Hazardu
74+
// Cannot do the mutability check here because it requires the function to be non-const, but the function cannot be non-const because it's called
75+
// from const functions in the asset converter.
76+
// Relevant comments/conversations:
77+
// https://github.com/Devsh-Graphics-Programming/Nabla/pull/345#discussion_r1054258384
78+
// https://github.com/Devsh-Graphics-Programming/Nabla/pull/345#discussion_r1056289599
79+
//
80+
// assert(!isImmutable_debug());
7381
if (!m_descriptorInfos[static_cast<uint32_t>(type)])
7482
return { nullptr, nullptr };
7583
else

include/nbl/video/IDescriptorPool.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class IDescriptorPool : public core::IReferenceCounted, public IBackendObject
7272
for (auto i = 0; i < static_cast<uint32_t>(asset::IDescriptor::E_TYPE::ET_COUNT); ++i)
7373
m_descriptorAllocators[i] = std::make_unique<allocator_state_t>(m_creationParameters.maxDescriptorCount[i], m_creationParameters.flags.hasFlags(ECF_FREE_DESCRIPTOR_SET_BIT));
7474

75-
// For (possibly) mutable samplers.
75+
// For mutable samplers. We don't know if there will be mutable samplers in sets allocated by this pool when we create the pool.
7676
m_descriptorAllocators[static_cast<uint32_t>(asset::IDescriptor::E_TYPE::ET_COUNT)] = std::make_unique<allocator_state_t>(m_creationParameters.maxDescriptorCount[static_cast<uint32_t>(asset::IDescriptor::E_TYPE::ET_COMBINED_IMAGE_SAMPLER)], m_creationParameters.flags.hasFlags(ECF_FREE_DESCRIPTOR_SET_BIT));
7777

7878
// Initialize the storages.

src/nbl/video/IDescriptorPool.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ bool IDescriptorPool::reset()
2727
if (!m_descriptorAllocators[t])
2828
continue;
2929

30+
// TODO(achal): I should call the dtors on descriptors only after calling vkResetDescriptorPool (in reset_impl)
3031
const uint32_t allocatedCount = m_descriptorAllocators[t]->getAllocatedDescriptorCount(allowsFreeing);
3132
std::destroy_n(getDescriptorStorage(static_cast<asset::IDescriptor::E_TYPE>(t)), allocatedCount);
3233

0 commit comments

Comments
 (0)