vulkan: clean up framebuffers when textures they reference are deleted

Fixes corruption/crashing in some situations if a new texture's image view has the same pointer as a previously deleted texture's image view.
This commit is contained in:
Sasha Szpakowski
2024-12-20 23:37:06 -04:00
parent 1c0491c5c3
commit b87aed937c
3 changed files with 63 additions and 43 deletions
+2 -2
View File
@@ -281,6 +281,8 @@ public:
int getVsync() const;
void mapLocalUniformData(void *data, size_t size, VkDescriptorBufferInfo &bufferInfo);
void cleanupFramebuffers(VkImageView imageView, PixelFormat format);
VkPipeline createGraphicsPipeline(Shader *shader, const GraphicsPipelineConfigurationCore &configuration, const GraphicsPipelineConfigurationNoDynamicState *noDynamicStateConfiguration);
uint32 getDeviceApiVersion() const { return deviceApiVersion; }
@@ -346,7 +348,6 @@ private:
void endRenderPass();
void applyScissor();
VkSampler createSampler(const SamplerState &sampler);
void cleanupUnusedObjects();
void requestSwapchainRecreation();
VkInstance instance = VK_NULL_HANDLE;
@@ -389,7 +390,6 @@ private:
int vsync = 1;
VkDeviceSize minUniformBufferOffsetAlignment = 0;
bool imageRequested = false;
uint32_t frameCounter = 0;
size_t currentFrame = 0;
uint32_t imageIndex = 0;
bool swapChainRecreationRequested = false;