GS/HW: Fix some incorrect clear behavior

This commit is contained in:
Stenzek 2023-06-05 01:35:20 +10:00 committed by Connor McLaughlin
parent 350037fc75
commit 601b75b611
3 changed files with 8 additions and 12 deletions

View File

@ -3165,13 +3165,11 @@ void GSDevice12::RenderHW(GSHWDrawConfig& config)
// propagate clear value through if the hdr render is the first
if (draw_rt->GetState() == GSTexture::State::Cleared)
{
hdr_rt->SetState(GSTexture::State::Cleared);
hdr_rt->SetClearColor(draw_rt->GetClearColor());
}
else
{
hdr_rt->SetState(GSTexture::State::Invalidated);
draw_rt->TransitionToState(D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE);
}
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)

View File

@ -4868,9 +4868,9 @@ bool GSTextureCache::Target::ResizeTexture(int new_unscaled_width, int new_unsca
{
// Otherwise just pass the clear through.
if (tex->GetType() != GSTexture::Type::DepthStencil)
g_gs_device->ClearRenderTarget(tex, tex->GetClearColor());
g_gs_device->ClearRenderTarget(tex, m_texture->GetClearColor());
else
g_gs_device->ClearDepth(tex, tex->GetClearDepth());
g_gs_device->ClearDepth(tex, m_texture->GetClearDepth());
}
else
{

View File

@ -3639,13 +3639,11 @@ void GSDeviceVK::RenderHW(GSHWDrawConfig& config)
// propagate clear value through if the hdr render is the first
if (draw_rt->GetState() == GSTexture::State::Cleared)
{
hdr_rt->SetState(GSTexture::State::Cleared);
hdr_rt->SetClearColor(draw_rt->GetClearColor());
}
else
{
hdr_rt->SetState(GSTexture::State::Invalidated);
draw_rt->TransitionToLayout(GSTextureVK::Layout::ShaderReadOnly);
}
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)