GS/Vulkan: Fix incorrect push/pop with cleared colclip target

This commit is contained in:
Stenzek 2023-06-11 02:34:11 +10:00 committed by Connor McLaughlin
parent 601b75b611
commit 8af9aace3c
2 changed files with 12 additions and 7 deletions

View File

@ -3152,7 +3152,6 @@ void GSDevice12::RenderHW(GSHWDrawConfig& config)
{
EndRenderPass();
GL_PUSH_("HDR Render Target Setup");
hdr_rt = static_cast<GSTexture12*>(CreateRenderTarget(rtsize.x, rtsize.y, GSTexture::Format::HDRColor, false));
if (!hdr_rt)
{
@ -3168,8 +3167,11 @@ void GSDevice12::RenderHW(GSHWDrawConfig& config)
hdr_rt->SetState(GSTexture::State::Cleared);
hdr_rt->SetClearColor(draw_rt->GetClearColor());
}
draw_rt->TransitionToState(D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE);
else if (draw_rt->GetState() == GSTexture::State::Dirty)
{
GL_PUSH_("HDR Render Target Setup");
draw_rt->TransitionToState(D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE);
}
// we're not drawing to the RT, so we can use it as a source
if (config.require_one_barrier)
@ -3303,7 +3305,7 @@ void GSDevice12::RenderHW(GSHWDrawConfig& config)
// now blit the hdr texture back to the original target
if (hdr_rt)
{
GL_INS("Blit HDR back to RT");
GL_PUSH("Blit HDR back to RT");
EndRenderPass();
hdr_rt->TransitionToState(D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE);

View File

@ -3626,13 +3626,13 @@ void GSDeviceVK::RenderHW(GSHWDrawConfig& config)
{
EndRenderPass();
GL_PUSH_("HDR Render Target Setup");
hdr_rt = static_cast<GSTextureVK*>(CreateRenderTarget(rtsize.x, rtsize.y, GSTexture::Format::HDRColor, false));
if (!hdr_rt)
{
Console.WriteLn("Failed to allocate HDR render target, aborting draw.");
if (date_image)
Recycle(date_image);
GL_POP();
return;
}
@ -3642,8 +3642,11 @@ void GSDeviceVK::RenderHW(GSHWDrawConfig& config)
hdr_rt->SetState(GSTexture::State::Cleared);
hdr_rt->SetClearColor(draw_rt->GetClearColor());
}
draw_rt->TransitionToLayout(GSTextureVK::Layout::ShaderReadOnly);
else if (draw_rt->GetState() == GSTexture::State::Dirty)
{
GL_PUSH_("HDR Render Target Setup");
draw_rt->TransitionToLayout(GSTextureVK::Layout::ShaderReadOnly);
}
// we're not drawing to the RT, so we can use it as a source
if (config.require_one_barrier && !m_features.texture_barrier)