Fixing synchronization problem between descriptor sets and command buffers

This commit is contained in:
Dynamitos
2020-11-03 01:18:30 +01:00
parent 799ba20d49
commit 65caae9e21
24 changed files with 203 additions and 58 deletions
@@ -93,6 +93,14 @@ public:
virtual void updateSampler(uint32_t binding, Gfx::PSamplerState samplerState);
virtual void updateTexture(uint32_t binding, Gfx::PTexture texture, Gfx::PSamplerState sampler = nullptr);
virtual bool operator<(Gfx::PDescriptorSet other);
void setCurrentlyBound(PCmdBuffer boundBy)
{
currentlyBound = boundBy;
}
void releaseFromCmd()
{
currentlyBound = nullptr;
}
inline VkDescriptorSet getHandle() const
{
return setHandle[Gfx::currentFrameIndex];
@@ -112,6 +120,7 @@ private:
Array<void*> cachedData[Gfx::numFramesBuffered];
VkDescriptorSet setHandle[Gfx::numFramesBuffered];
PDescriptorAllocator owner;
PCmdBuffer currentlyBound;
PGraphics graphics;
friend class DescriptorAllocator;
};