@@ -528,9 +528,38 @@ class ICPUVirtualTexture final : public IVirtualTexture<ICPUImageView, ICPUSampl
528
528
return getDSlayoutBindings_internal<ICPUDescriptorSetLayout>(_outBindings, _outSamplers, _pgtBinding, _fsamplersBinding, _isamplersBinding, _usamplersBinding);
529
529
}
530
530
531
- auto getDescriptorSetWrites (ICPUDescriptorSet::SWriteDescriptorSet* _outWrites, ICPUDescriptorSet::SDescriptorInfo* _outInfo, ICPUDescriptorSet* _dstSet, uint32_t _pgtBinding = 0u , uint32_t _fsamplersBinding = 1u , uint32_t _isamplersBinding = 2u , uint32_t _usamplersBinding = 3u ) const
531
+ bool updateDescriptorSet ( ICPUDescriptorSet* _dstSet, uint32_t _pgtBinding = 0u , uint32_t _fsamplersBinding = 1u , uint32_t _isamplersBinding = 2u , uint32_t _usamplersBinding = 3u ) const
532
532
{
533
- return getDescriptorSetWrites_internal<ICPUDescriptorSet>(_outWrites, _outInfo, _dstSet, _pgtBinding, _fsamplersBinding, _isamplersBinding, _usamplersBinding);
533
+ // Update _pgtBinding.
534
+ {
535
+ auto pgtInfos = _dstSet->getDescriptorInfos (_pgtBinding, IDescriptor::E_TYPE::ET_COMBINED_IMAGE_SAMPLER);
536
+ if (pgtInfos.empty ())
537
+ return false ;
538
+
539
+ assert (pgtInfos.size () == 1ull );
540
+ auto & info = pgtInfos.begin ()[0 ];
541
+ info.info .image .imageLayout = IImage::EL_UNDEFINED;
542
+ info.info .image .sampler = nullptr ;
543
+ info.desc = core::smart_refctd_ptr<ICPUImageView>(getPageTableView ());
544
+ }
545
+
546
+ auto updateSamplersBinding = [&](const uint32_t binding, const auto & views)
547
+ {
548
+ auto infos = _dstSet->getDescriptorInfos (binding, IDescriptor::E_TYPE::ET_COMBINED_IMAGE_SAMPLER);
549
+
550
+ for (uint32_t i = 0 ; i < infos.size (); ++i)
551
+ {
552
+ auto & info = infos.begin ()[i];
553
+
554
+ info.info .image .imageLayout = IImage::EL_UNDEFINED;
555
+ info.info .image .sampler = nullptr ;
556
+ info.desc = views.begin ()[i].view ;
557
+ }
558
+ };
559
+
560
+ updateSamplersBinding (_fsamplersBinding, getFloatViews ());
561
+ updateSamplersBinding (_isamplersBinding, getIntViews ());
562
+ updateSamplersBinding (_usamplersBinding, getUintViews ());
534
563
}
535
564
536
565
protected:
0 commit comments