@@ -67,6 +67,7 @@ class SubAllocatedDescriptorSet : public core::IReferenceCounted
67
67
};
68
68
MultiTimelineEventHandlerST<DeferredFreeFunctor> eventHandler;
69
69
std::map<uint32_t , SubAllocDescriptorSetRange> m_allocatableRanges = {};
70
+ core::smart_refctd_ptr<video::IGPUDescriptorSet> m_descriptorSet;
70
71
71
72
#ifdef _NBL_DEBUG
72
73
std::recursive_mutex stAccessVerfier;
@@ -79,8 +80,9 @@ class SubAllocatedDescriptorSet : public core::IReferenceCounted
79
80
80
81
// constructors
81
82
template <typename ... Args>
82
- inline SubAllocatedDescriptorSet (video::IGPUDescriptorSetLayout* layout )
83
+ inline SubAllocatedDescriptorSet (video::IGPUDescriptorSet* descriptorSet )
83
84
{
85
+ auto layout = descriptorSet->getLayout ();
84
86
for (uint32_t descriptorType = 0 ; descriptorType < static_cast <uint32_t >(asset::IDescriptor::E_TYPE::ET_COUNT); descriptorType++)
85
87
{
86
88
auto descType = static_cast <asset::IDescriptor::E_TYPE>(descriptorType);
@@ -111,6 +113,7 @@ class SubAllocatedDescriptorSet : public core::IReferenceCounted
111
113
}
112
114
}
113
115
}
116
+ m_descriptorSet = core::smart_refctd_ptr (descriptorSet);
114
117
}
115
118
116
119
~SubAllocatedDescriptorSet ()
@@ -161,6 +164,7 @@ class SubAllocatedDescriptorSet : public core::IReferenceCounted
161
164
continue ;
162
165
163
166
outAddresses[i] = allocator->alloc_addr (1 ,1 );
167
+ // TODO: should also write something to the descriptor set (or probably leave that to the caller?)
164
168
}
165
169
}
166
170
inline void multi_deallocate (uint32_t binding, size_type count, const size_type* addr)
@@ -174,6 +178,7 @@ class SubAllocatedDescriptorSet : public core::IReferenceCounted
174
178
continue ;
175
179
176
180
allocator->free_addr (addr[i],1 );
181
+ // TODO: should also write something to the descriptor sets
177
182
}
178
183
}
179
184
// !
@@ -187,7 +192,7 @@ class SubAllocatedDescriptorSet : public core::IReferenceCounted
187
192
inline void multi_deallocate (uint32_t binding, uint32_t count, const value_type* addr, const ISemaphore::SWaitInfo& futureWait) noexcept
188
193
{
189
194
if (futureWait.semaphore )
190
- multi_deallocate (futureWait, DeferredFreeFunctor (&m_composed , binding, count, addr));
195
+ multi_deallocate (futureWait, DeferredFreeFunctor (&this , binding, count, addr));
191
196
else
192
197
multi_deallocate (binding, count, addr);
193
198
}
0 commit comments