Bug Fixes in Image init and Texture GRM.

Image flags now init to 0 (Image invalid by default).
GPU Resource manager correctly adds Texture Descriptor Write Ownership.
This commit is contained in:
Anish Bhobe 2024-07-27 13:00:18 +02:00
parent 1e58446940
commit f9517db592
2 changed files with 3 additions and 2 deletions

View File

@ -41,7 +41,7 @@ struct Image
vk::Extent3D m_Extent;
// Image.m_MipLevels_ is used for bookkeeping
// If the image is Invalid, the remaining data in Image is used intrusively by `GpuResourceManager`.
u32 m_MipLevels_;
u32 m_MipLevels_ = 0;
[[nodiscard]] bool IsValid() const;
[[nodiscard]] bool IsOwned() const;

View File

@ -294,7 +294,7 @@ GpuResourceManager::Commit(Texture *texture)
.pImageInfo = &m_WriteInfos.back().uImageInfo,
});
m_WriteOwner.emplace_back(HandleType::eBuffer, handle.m_Index);
m_WriteOwner.emplace_back(HandleType::eTexture, handle.m_Index);
#if !defined(NDEBUG)
++m_CommitedTextureCount;
@ -428,6 +428,7 @@ GpuResourceManager::~GpuResourceManager()
#endif
m_BufferManager.Destroy(m_Device);
m_TextureManager.Destroy(m_Device);
m_Device->m_Device.destroy(m_ImmutableSampler, nullptr);
m_Device->m_Device.destroy(m_DescriptorPool, nullptr);
m_Device->m_Device.destroy(m_SetLayout, nullptr);