mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-03-13 22:42:07 +00:00
Fix crash when frame buffers are resized
This commit is contained in:
parent
ff7dff993d
commit
a45fab65e8
5 changed files with 19 additions and 0 deletions
|
@ -70,6 +70,7 @@ void VkRenderBuffers::BeginFrame(int width, int height, int sceneWidth, int scen
|
|||
{
|
||||
fb->GetCommands()->WaitForCommands(false);
|
||||
fb->GetRenderPassManager()->RenderBuffersReset();
|
||||
fb->ResetRenderStateCache();
|
||||
}
|
||||
|
||||
if (width != mWidth || height != mHeight)
|
||||
|
|
|
@ -493,6 +493,14 @@ void VulkanRenderDevice::WaitForCommands(bool finish)
|
|||
mCommands->WaitForCommands(finish);
|
||||
}
|
||||
|
||||
void VulkanRenderDevice::ResetRenderStateCache()
|
||||
{
|
||||
for (auto& renderstate : mRenderState)
|
||||
{
|
||||
renderstate->ResetCache();
|
||||
}
|
||||
}
|
||||
|
||||
void VulkanRenderDevice::PrintStartupLog()
|
||||
{
|
||||
const auto &props = mDevice->PhysicalDevice.Properties.Properties;
|
||||
|
|
|
@ -85,6 +85,8 @@ public:
|
|||
|
||||
void WaitForCommands(bool finish) override;
|
||||
|
||||
void ResetRenderStateCache();
|
||||
|
||||
std::mutex ThreadMutex;
|
||||
|
||||
private:
|
||||
|
|
|
@ -740,6 +740,12 @@ void VkRenderState::EndFrame()
|
|||
mStreamBufferWriter.Reset();
|
||||
}
|
||||
|
||||
void VkRenderState::ResetCache()
|
||||
{
|
||||
mRenderPassSetups.clear();
|
||||
mPipelineLayouts.clear();
|
||||
}
|
||||
|
||||
void VkRenderState::EnableDrawBuffers(int count, bool apply)
|
||||
{
|
||||
if (mRenderTarget.DrawBuffers != count)
|
||||
|
|
|
@ -64,6 +64,8 @@ public:
|
|||
void EndRenderPass();
|
||||
void EndFrame();
|
||||
|
||||
void ResetCache();
|
||||
|
||||
protected:
|
||||
void Apply(int dt);
|
||||
void ApplyRenderPass(int dt);
|
||||
|
|
Loading…
Reference in a new issue