mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-02-21 09:40:01 +00:00
rsx: Move shader analysis+prefetch to the end of the draw call
This commit is contained in:
parent
8e07b19bc7
commit
d775c8dc73
@ -612,10 +612,10 @@ void GLGSRender::end()
|
||||
return;
|
||||
}
|
||||
|
||||
analyse_current_rsx_pipeline();
|
||||
m_frame_stats.setup_time += m_profiler.duration();
|
||||
|
||||
// Active texture environment is used to decode shaders
|
||||
m_profiler.start();
|
||||
load_texture_env();
|
||||
m_frame_stats.textures_upload_time += m_profiler.duration();
|
||||
|
||||
|
@ -360,16 +360,6 @@ namespace rsx
|
||||
}
|
||||
}
|
||||
|
||||
if (m_graphics_state & rsx::pipeline_state::fragment_program_ucode_dirty)
|
||||
{
|
||||
// Request for update of fragment constants if the program block is invalidated
|
||||
m_graphics_state |= rsx::pipeline_state::fragment_constants_dirty;
|
||||
}
|
||||
|
||||
// Preload the GPU programs for this draw call if needed
|
||||
prefetch_vertex_program();
|
||||
prefetch_fragment_program();
|
||||
|
||||
in_begin_end = true;
|
||||
}
|
||||
|
||||
@ -1575,6 +1565,18 @@ namespace rsx
|
||||
}
|
||||
}
|
||||
|
||||
void thread::analyse_current_rsx_pipeline()
|
||||
{
|
||||
if (m_graphics_state & rsx::pipeline_state::fragment_program_ucode_dirty)
|
||||
{
|
||||
// Request for update of fragment constants if the program block is invalidated
|
||||
m_graphics_state |= rsx::pipeline_state::fragment_constants_dirty;
|
||||
}
|
||||
|
||||
prefetch_vertex_program();
|
||||
prefetch_fragment_program();
|
||||
}
|
||||
|
||||
void thread::get_current_vertex_program(const std::array<std::unique_ptr<rsx::sampled_image_descriptor_base>, rsx::limits::vertex_textures_count>& sampler_descriptors)
|
||||
{
|
||||
if (!(m_graphics_state & rsx::pipeline_state::vertex_program_dirty))
|
||||
|
@ -773,6 +773,9 @@ namespace rsx
|
||||
RSXVertexProgram current_vertex_program = {};
|
||||
RSXFragmentProgram current_fragment_program = {};
|
||||
|
||||
// Runs shader prefetch and resolves pipeline status flags
|
||||
void analyse_current_rsx_pipeline();
|
||||
|
||||
// Prefetch and analyze the currently active fragment program ucode
|
||||
void prefetch_fragment_program();
|
||||
|
||||
@ -783,8 +786,6 @@ namespace rsx
|
||||
|
||||
/**
|
||||
* Gets current fragment program and associated fragment state
|
||||
* get_surface_info is a helper takes 2 parameters: rsx_texture_address and surface_is_depth
|
||||
* returns whether surface is a render target and surface pitch in native format
|
||||
*/
|
||||
void get_current_fragment_program(const std::array<std::unique_ptr<rsx::sampled_image_descriptor_base>, rsx::limits::fragment_textures_count>& sampler_descriptors);
|
||||
|
||||
|
@ -894,6 +894,8 @@ void VKGSRender::end()
|
||||
return;
|
||||
}
|
||||
|
||||
m_profiler.start();
|
||||
|
||||
// Check for frame resource status here because it is possible for an async flip to happen between begin/end
|
||||
if (m_current_frame->flags & frame_context_state::dirty) [[unlikely]]
|
||||
{
|
||||
@ -916,7 +918,8 @@ void VKGSRender::end()
|
||||
m_current_frame->flags &= ~frame_context_state::dirty;
|
||||
}
|
||||
|
||||
m_profiler.start();
|
||||
analyse_current_rsx_pipeline();
|
||||
m_frame_stats.setup_time += m_profiler.duration();
|
||||
|
||||
load_texture_env();
|
||||
m_frame_stats.textures_upload_time += m_profiler.duration();
|
||||
|
Loading…
x
Reference in New Issue
Block a user