@@ -36,7 +36,7 @@ class NBL_API ICPUDescriptorSet final : public IDescriptorSet<ICPUDescriptorSetL
36
36
// ! @see getDescriptors()
37
37
ICPUDescriptorSet (core::smart_refctd_ptr<ICPUDescriptorSetLayout>&& _layout) : base_t (std::move(_layout)), IAsset(), impl_t (m_layout.get())
38
38
{
39
- for (uint32_t t = 0u ; t < EDT_COUNT ; ++t)
39
+ for (uint32_t t = 0u ; t < static_cast < uint32_t >(IDescriptor::E_TYPE::ET_COUNT) ; ++t)
40
40
{
41
41
if (m_descriptors[t])
42
42
m_descriptorInfos[t] = core::make_refctd_dynamic_array<core::smart_refctd_dynamic_array<ICPUDescriptorSet::SDescriptorInfo::SBufferImageInfo>>(m_descriptors[t]->size ());
@@ -85,11 +85,11 @@ class NBL_API ICPUDescriptorSet final : public IDescriptorSet<ICPUDescriptorSetL
85
85
return nullptr ;
86
86
};
87
87
88
- for (uint32_t t = 0u ; t < EDT_COUNT ; ++t)
88
+ for (uint32_t t = 0u ; t < static_cast < uint32_t >(IDescriptor::E_TYPE::ET_COUNT) ; ++t)
89
89
{
90
- const auto type = static_cast <E_DESCRIPTOR_TYPE >(t);
90
+ const auto type = static_cast <IDescriptor::E_TYPE >(t);
91
91
92
- for (uint32_t i = 0u ; i < m_descriptors[type ]->size (); ++i)
92
+ for (uint32_t i = 0u ; i < m_descriptors[t ]->size (); ++i)
93
93
{
94
94
const auto & srcDescriptor = getDescriptorStorage (type)[i];
95
95
const auto & srcDescriptorInfo = getDescriptorInfoStorage (type)[i];
@@ -123,14 +123,14 @@ class NBL_API ICPUDescriptorSet final : public IDescriptorSet<ICPUDescriptorSetL
123
123
--referenceLevelsBelowToConvert;
124
124
m_layout->convertToDummyObject (referenceLevelsBelowToConvert);
125
125
126
- for (uint32_t t = 0u ; t < EDT_COUNT ; ++t)
126
+ for (uint32_t t = 0u ; t < static_cast < uint32_t >(IDescriptor::E_TYPE::ET_COUNT) ; ++t)
127
127
{
128
- const auto type = static_cast <E_DESCRIPTOR_TYPE >(t);
128
+ const auto type = static_cast <IDescriptor::E_TYPE >(t);
129
129
const auto descriptorCount = m_layout->getTotalDescriptorCount (type);
130
130
if (descriptorCount == 0ull )
131
131
continue ;
132
132
133
- auto descriptors = m_descriptors[type ]->begin ();
133
+ auto descriptors = m_descriptors[t ]->begin ();
134
134
assert (descriptors);
135
135
136
136
for (uint32_t i = 0u ; i < descriptorCount; ++i)
@@ -171,13 +171,13 @@ class NBL_API ICPUDescriptorSet final : public IDescriptorSet<ICPUDescriptorSetL
171
171
}
172
172
inline const ICPUDescriptorSetLayout* getLayout () const { return m_layout.get (); }
173
173
174
- std::pair<core::SRange<core::smart_refctd_ptr<IDescriptor>>, core::SRange<SDescriptorInfo::SBufferImageInfo>> getDescriptors (const uint32_t binding, E_DESCRIPTOR_TYPE type = EDT_COUNT )
174
+ std::pair<core::SRange<core::smart_refctd_ptr<IDescriptor>>, core::SRange<SDescriptorInfo::SBufferImageInfo>> getDescriptors (const uint32_t binding, IDescriptor::E_TYPE type = IDescriptor::E_TYPE::ET_COUNT )
175
175
{
176
- if (type == EDT_COUNT )
176
+ if (type == IDescriptor::E_TYPE::ET_COUNT )
177
177
{
178
- for (uint32_t t = 0 ; t < EDT_COUNT ; ++t)
178
+ for (uint32_t t = 0 ; t < static_cast < uint32_t >(IDescriptor::E_TYPE::ET_COUNT) ; ++t)
179
179
{
180
- const auto possibleType = static_cast <E_DESCRIPTOR_TYPE >(t);
180
+ const auto possibleType = static_cast <IDescriptor::E_TYPE >(t);
181
181
const auto & redirect = getLayout ()->getDescriptorRedirect (possibleType);
182
182
if (redirect.searchForBinding (binding) != redirect.Invalid )
183
183
{
@@ -186,7 +186,7 @@ class NBL_API ICPUDescriptorSet final : public IDescriptorSet<ICPUDescriptorSetL
186
186
}
187
187
}
188
188
189
- if (type == EDT_COUNT )
189
+ if (type == IDescriptor::E_TYPE::ET_COUNT )
190
190
return { {nullptr , nullptr }, {nullptr , nullptr } };
191
191
}
192
192
@@ -198,8 +198,8 @@ class NBL_API ICPUDescriptorSet final : public IDescriptorSet<ICPUDescriptorSetL
198
198
const auto descriptorOffset = redirect.getStorageOffset (bindingNumberIndex).data ;
199
199
const auto descriptorCount = redirect.getCount (bindingNumberIndex);
200
200
201
- auto descriptorsBegin = m_descriptors[type]->begin () + descriptorOffset;
202
- auto descriptorInfosBegin = m_descriptorInfos[type]->begin () + descriptorOffset;
201
+ auto descriptorsBegin = m_descriptors[static_cast < uint32_t >( type) ]->begin () + descriptorOffset;
202
+ auto descriptorInfosBegin = m_descriptorInfos[static_cast < uint32_t >( type) ]->begin () + descriptorOffset;
203
203
204
204
return { {descriptorsBegin, descriptorsBegin+descriptorCount}, {descriptorInfosBegin, descriptorInfosBegin+descriptorCount} };
205
205
}
@@ -221,8 +221,8 @@ class NBL_API ICPUDescriptorSet final : public IDescriptorSet<ICPUDescriptorSetL
221
221
return { samplersBegin, samplersBegin + count };
222
222
}
223
223
224
- inline core::smart_refctd_ptr<IDescriptor>* getDescriptorStorage (const E_DESCRIPTOR_TYPE type) const { return m_descriptors[type]->begin (); }
225
- inline SDescriptorInfo::SBufferImageInfo* getDescriptorInfoStorage (const E_DESCRIPTOR_TYPE type) const { return m_descriptorInfos[type]->begin (); }
224
+ inline core::smart_refctd_ptr<IDescriptor>* getDescriptorStorage (const IDescriptor::E_TYPE type) const { return m_descriptors[static_cast < uint32_t >( type) ]->begin (); }
225
+ inline SDescriptorInfo::SBufferImageInfo* getDescriptorInfoStorage (const IDescriptor::E_TYPE type) const { return m_descriptorInfos[static_cast < uint32_t >( type) ]->begin (); }
226
226
inline core::smart_refctd_ptr<ICPUSampler>* getMutableSamplerStorage () const { return m_mutableSamplers->begin (); }
227
227
228
228
bool canBeRestoredFrom (const IAsset* _other) const override
@@ -241,17 +241,17 @@ class NBL_API ICPUDescriptorSet final : public IDescriptorSet<ICPUDescriptorSetL
241
241
--_levelsBelow;
242
242
restoreFromDummy_impl_call (m_layout.get (), other->getLayout (), _levelsBelow);
243
243
244
- for (uint32_t t = 0u ; t < EDT_COUNT ; ++t)
244
+ for (uint32_t t = 0u ; t < static_cast < uint32_t >(IDescriptor::E_TYPE::ET_COUNT) ; ++t)
245
245
{
246
- const auto type = static_cast <E_DESCRIPTOR_TYPE >(t);
246
+ const auto type = static_cast <IDescriptor::E_TYPE >(t);
247
247
const auto descriptorCount = m_layout->getTotalDescriptorCount (type);
248
248
if (descriptorCount == 0ull )
249
249
continue ;
250
250
251
- auto descriptors = m_descriptors[type ]->begin ();
251
+ auto descriptors = m_descriptors[t ]->begin ();
252
252
assert (descriptors);
253
253
254
- auto otherDescriptors = other->m_descriptors [type ]->begin ();
254
+ auto otherDescriptors = other->m_descriptors [t ]->begin ();
255
255
256
256
for (uint32_t i = 0u ; i < descriptorCount; ++i)
257
257
{
@@ -286,14 +286,14 @@ class NBL_API ICPUDescriptorSet final : public IDescriptorSet<ICPUDescriptorSetL
286
286
if (m_layout->isAnyDependencyDummy (_levelsBelow))
287
287
return true ;
288
288
289
- for (uint32_t t = 0u ; t < EDT_COUNT ; ++t)
289
+ for (uint32_t t = 0u ; t < static_cast < uint32_t >(IDescriptor::E_TYPE::ET_COUNT) ; ++t)
290
290
{
291
- const auto type = static_cast <E_DESCRIPTOR_TYPE >(t);
291
+ const auto type = static_cast <IDescriptor::E_TYPE >(t);
292
292
const auto descriptorCount = m_layout->getTotalDescriptorCount (type);
293
293
if (descriptorCount == 0ull )
294
294
continue ;
295
295
296
- auto descriptors = m_descriptors[type ]->begin ();
296
+ auto descriptors = m_descriptors[t ]->begin ();
297
297
assert (descriptors);
298
298
299
299
for (uint32_t i = 0u ; i < descriptorCount; ++i)
@@ -336,7 +336,7 @@ class NBL_API ICPUDescriptorSet final : public IDescriptorSet<ICPUDescriptorSetL
336
336
void allocateDescriptors () override { assert (!" Invalid code path." ); }
337
337
338
338
// Mutable samplers are NOT stored in this array (in SDescriptorInfo::SImageInfo::sampler member), but in IEmulatedDescriptorSet::m_mutableSamplers.
339
- core::smart_refctd_dynamic_array<ICPUDescriptorSet::SDescriptorInfo::SBufferImageInfo> m_descriptorInfos[EDT_COUNT ];
339
+ core::smart_refctd_dynamic_array<ICPUDescriptorSet::SDescriptorInfo::SBufferImageInfo> m_descriptorInfos[static_cast < uint32_t >(IDescriptor::E_TYPE::ET_COUNT) ];
340
340
};
341
341
342
342
}
0 commit comments