File tree Expand file tree Collapse file tree 3 files changed +14
-5
lines changed Expand file tree Collapse file tree 3 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -146,10 +146,10 @@ class IDescriptorSetLayout : public virtual core::IReferenceCounted
146
146
inline uint32_t getCount (const binding_number_t binding) const
147
147
{
148
148
const auto index = findBindingStorageIndex (binding);
149
- if (index == Invalid)
149
+ if (index. data == Invalid)
150
150
return 0 ;
151
151
152
- return getDescriptorCount (index);
152
+ return getCount (index);
153
153
}
154
154
155
155
inline storage_offset_t getStorageOffset (const binding_number_t binding) const
Original file line number Diff line number Diff line change @@ -549,11 +549,10 @@ class CVulkanLogicalDevice final : public ILogicalDevice
549
549
550
550
const auto * infoSrc = pDescriptorWrites[i].info ;
551
551
auto * infoDst = const_cast <VkDescriptorImageInfo*>(vk_writeDescriptorSets[i].pImageInfo );
552
+
552
553
for (uint32_t j = 0 ; j < pDescriptorWrites[i].count ; ++j, ++infoSrc, ++infoDst)
553
554
{
554
- VkSampler vk_sampler = VK_NULL_HANDLE;
555
- if (infoSrc->info .image .sampler && (infoSrc->info .image .sampler ->getAPIType () == EAT_VULKAN))
556
- vk_sampler = static_cast <const CVulkanSampler*>(infoSrc->info .image .sampler .get ())->getInternalObject ();
555
+ VkSampler vk_sampler = infoSrc->info .image .sampler ? static_cast <const CVulkanSampler*>(infoSrc->info .image .sampler .get ())->getInternalObject () : VK_NULL_HANDLE;
557
556
558
557
infoDst->sampler = vk_sampler;
559
558
infoDst->imageView = static_cast <const CVulkanImageView*>(infoSrc->desc .get ())->getInternalObject ();
Original file line number Diff line number Diff line change @@ -58,6 +58,16 @@ bool IGPUDescriptorSet::validateWrite(const IGPUDescriptorSet::SWriteDescriptorS
58
58
core::smart_refctd_ptr<video::IGPUSampler>* mutableSamplers = nullptr ;
59
59
if (write.descriptorType == asset::IDescriptor::E_TYPE::ET_COMBINED_IMAGE_SAMPLER && write.info ->info .image .sampler )
60
60
{
61
+ #ifdef _NBL_DEBUG
62
+ if (m_layout->getImmutableSamplerRedirect ().getCount (IGPUDescriptorSetLayout::CBindingRedirect::binding_number_t { write.binding }) != 0 )
63
+ return false ;
64
+
65
+ for (uint32_t i = 0 ; i < write.count ; ++i)
66
+ {
67
+ if (!write.info [i].info .image .sampler || !write.info [i].info .image .sampler ->isCompatibleDevicewise (write.dstSet ))
68
+ return false ;
69
+ }
70
+ #endif
61
71
mutableSamplers = getMutableSamplers (write.binding );
62
72
if (!mutableSamplers)
63
73
{
You can’t perform that action at this time.
0 commit comments