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
+1
View File
@@ -301,6 +301,7 @@ void GLGSRender::init_buffers(rsx::framebuffer_creation_context context, bool /*
} }
m_graphics_state.set(rsx::rtt_config_valid); m_graphics_state.set(rsx::rtt_config_valid);
on_framebuffer_layout_updated();
check_zcull_status(true); check_zcull_status(true);
set_viewport(); set_viewport();
+17 -8
View File
@@ -1740,14 +1740,7 @@ namespace rsx
} }
} }
if (::size32(mrt_buffers) != current_fragment_program.mrt_buffers_count && on_framebuffer_layout_updated();
!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;
}
return any_found; 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) bool thread::get_scissor(areau& region, bool clip_viewport)
{ {
if (!m_graphics_state.test(rsx::pipeline_state::scissor_config_state_dirty)) if (!m_graphics_state.test(rsx::pipeline_state::scissor_config_state_dirty))
+4
View File
@@ -257,6 +257,10 @@ namespace rsx
void get_framebuffer_layout(rsx::framebuffer_creation_context context, framebuffer_layout &layout); void get_framebuffer_layout(rsx::framebuffer_creation_context context, framebuffer_layout &layout);
bool get_scissor(areau& region, bool clip_viewport); 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 = {}; RSXVertexProgram current_vertex_program = {};
RSXFragmentProgram current_fragment_program = {}; RSXFragmentProgram current_fragment_program = {};
+3 -2
View File
@@ -2469,7 +2469,7 @@ void VKGSRender::prepare_rtts(rsx::framebuffer_creation_context context)
m_surface_info[i].samples = samples; 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) 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; 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); const auto draw_buffers = rsx::utility::get_rtt_indexes(m_framebuffer_layout.target);
m_draw_buffers.clear(); m_draw_buffers.clear();
m_fbo_images.clear(); m_fbo_images.clear();
@@ -2637,6 +2637,7 @@ void VKGSRender::prepare_rtts(rsx::framebuffer_creation_context context)
set_viewport(); set_viewport();
set_scissor(clipped_scissor); set_scissor(clipped_scissor);
on_framebuffer_layout_updated();
check_zcull_status(true); check_zcull_status(true);
} }