rsx: Improve framebuffer layout change detection

This commit is contained in:
kd-11 2025-12-27 02:29:55 +03:00 committed by kd-11
parent 316aa44d3e
commit f5be489d9f
4 changed files with 25 additions and 10 deletions

View file

@ -301,6 +301,7 @@ void GLGSRender::init_buffers(rsx::framebuffer_creation_context context, bool /*
}
m_graphics_state.set(rsx::rtt_config_valid);
on_framebuffer_layout_updated();
check_zcull_status(true);
set_viewport();

View file

@ -1740,14 +1740,7 @@ namespace rsx
}
}
if (::size32(mrt_buffers) != current_fragment_program.mrt_buffers_count &&
!m_graphics_state.test(rsx::pipeline_state::fragment_program_dirty) &&
!is_current_program_interpreted())
{
// Notify that we should recompile the FS
m_graphics_state |= rsx::pipeline_state::fragment_program_state_dirty;
}
on_framebuffer_layout_updated();
return any_found;
};
@ -1845,6 +1838,22 @@ namespace rsx
}
}
void thread::on_framebuffer_layout_updated()
{
if (m_graphics_state.test(rsx::fragment_program_state_dirty))
{
return;
}
const auto target = m_ctx->register_state->surface_color_target();
if (rsx::utility::get_mrt_buffers_count(target) == current_fragment_program.mrt_buffers_count)
{
return;
}
m_graphics_state |= rsx::fragment_program_state_dirty;
}
bool thread::get_scissor(areau& region, bool clip_viewport)
{
if (!m_graphics_state.test(rsx::pipeline_state::scissor_config_state_dirty))

View file

@ -257,6 +257,10 @@ namespace rsx
void get_framebuffer_layout(rsx::framebuffer_creation_context context, framebuffer_layout &layout);
bool get_scissor(areau& region, bool clip_viewport);
// Notify framebuffer layout has been committed.
// FIXME: This should not be here
void on_framebuffer_layout_updated();
RSXVertexProgram current_vertex_program = {};
RSXFragmentProgram current_fragment_program = {};

View file

@ -2469,7 +2469,7 @@ void VKGSRender::prepare_rtts(rsx::framebuffer_creation_context context)
m_surface_info[i].samples = samples;
}
//Process depth surface as well
// Process depth surface as well
{
if (m_depth_surface_info.pitch && g_cfg.video.write_depth_buffer)
{
@ -2486,7 +2486,7 @@ void VKGSRender::prepare_rtts(rsx::framebuffer_creation_context context)
m_depth_surface_info.samples = samples;
}
//Bind created rtts as current fbo...
// Bind created rtts as current fbo...
const auto draw_buffers = rsx::utility::get_rtt_indexes(m_framebuffer_layout.target);
m_draw_buffers.clear();
m_fbo_images.clear();
@ -2637,6 +2637,7 @@ void VKGSRender::prepare_rtts(rsx::framebuffer_creation_context context)
set_viewport();
set_scissor(clipped_scissor);
on_framebuffer_layout_updated();
check_zcull_status(true);
}