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
146146 inline uint32_t getCount (const binding_number_t binding) const
147147 {
148148 const auto index = findBindingStorageIndex (binding);
149- if (index == Invalid)
149+ if (index. data == Invalid)
150150 return 0 ;
151151
152- return getDescriptorCount (index);
152+ return getCount (index);
153153 }
154154
155155 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
549549
550550 const auto * infoSrc = pDescriptorWrites[i].info ;
551551 auto * infoDst = const_cast <VkDescriptorImageInfo*>(vk_writeDescriptorSets[i].pImageInfo );
552+
552553 for (uint32_t j = 0 ; j < pDescriptorWrites[i].count ; ++j, ++infoSrc, ++infoDst)
553554 {
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;
557556
558557 infoDst->sampler = vk_sampler;
559558 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
5858 core::smart_refctd_ptr<video::IGPUSampler>* mutableSamplers = nullptr ;
5959 if (write.descriptorType == asset::IDescriptor::E_TYPE::ET_COMBINED_IMAGE_SAMPLER && write.info ->info .image .sampler )
6060 {
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
6171 mutableSamplers = getMutableSamplers (write.binding );
6272 if (!mutableSamplers)
6373 {
You can’t perform that action at this time.
0 commit comments