mirror of https://github.com/PCSX2/pcsx2.git
GS/DX12: Fix targets getting stuck undirtied
This commit is contained in:
parent
a2c9069dda
commit
ebb291e06d
|
@ -729,6 +729,8 @@ void GSDevice12::CopyRect(GSTexture* sTex, GSTexture* dTex, const GSVector4i& r,
|
||||||
// otherwise we need to do an attachment clear
|
// otherwise we need to do an attachment clear
|
||||||
EndRenderPass();
|
EndRenderPass();
|
||||||
|
|
||||||
|
dTexVK->SetState(GSTexture::State::Dirty);
|
||||||
|
|
||||||
if (dTexVK->GetType() != GSTexture::Type::DepthStencil)
|
if (dTexVK->GetType() != GSTexture::Type::DepthStencil)
|
||||||
{
|
{
|
||||||
dTexVK->TransitionToState(D3D12_RESOURCE_STATE_RENDER_TARGET);
|
dTexVK->TransitionToState(D3D12_RESOURCE_STATE_RENDER_TARGET);
|
||||||
|
@ -1523,6 +1525,25 @@ void GSDevice12::OMSetRenderTargets(GSTexture* rt, GSTexture* ds, const GSVector
|
||||||
// framebuffer change
|
// framebuffer change
|
||||||
EndRenderPass();
|
EndRenderPass();
|
||||||
}
|
}
|
||||||
|
else if (InRenderPass())
|
||||||
|
{
|
||||||
|
// Framebuffer unchanged, but check for clears. Have to restart render pass, unlike Vulkan.
|
||||||
|
// We'll take care of issuing the actual clear there, because we have to start one anyway.
|
||||||
|
if (vkRt && vkRt->GetState() != GSTexture::State::Dirty)
|
||||||
|
{
|
||||||
|
if (vkRt->GetState() == GSTexture::State::Cleared)
|
||||||
|
EndRenderPass();
|
||||||
|
else
|
||||||
|
vkRt->SetState(GSTexture::State::Dirty);
|
||||||
|
}
|
||||||
|
if (vkDs && vkDs->GetState() != GSTexture::State::Dirty)
|
||||||
|
{
|
||||||
|
if (vkDs->GetState() == GSTexture::State::Cleared)
|
||||||
|
EndRenderPass();
|
||||||
|
else
|
||||||
|
vkDs->SetState(GSTexture::State::Dirty);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
m_current_render_target = vkRt;
|
m_current_render_target = vkRt;
|
||||||
m_current_depth_target = vkDs;
|
m_current_depth_target = vkDs;
|
||||||
|
|
Loading…
Reference in New Issue