mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-10 17:01:24 +12:00
Minor optimizations and fixes
- FIFO: avoid multiline spam - VK: Fix program setup counter - FS: Precalculate fragment constants buffer size during analysis step
This commit is contained in:
parent
9f0fada17a
commit
0267221586
5 changed files with 8 additions and 5 deletions
|
@ -329,6 +329,7 @@ fragment_program_utils::fragment_program_metadata fragment_program_utils::analys
|
||||||
s32 index = 0;
|
s32 index = 0;
|
||||||
s32 program_offset = -1;
|
s32 program_offset = -1;
|
||||||
u32 ucode_size = 0;
|
u32 ucode_size = 0;
|
||||||
|
u32 constants_size = 0;
|
||||||
u16 textures_mask = 0;
|
u16 textures_mask = 0;
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
|
@ -364,6 +365,7 @@ fragment_program_utils::fragment_program_metadata fragment_program_utils::analys
|
||||||
//Instruction references constant, skip one slot occupied by data
|
//Instruction references constant, skip one slot occupied by data
|
||||||
index++;
|
index++;
|
||||||
ucode_size += 16;
|
ucode_size += 16;
|
||||||
|
constants_size += 16;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -386,7 +388,7 @@ fragment_program_utils::fragment_program_metadata fragment_program_utils::analys
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return{ (u32)program_offset, ucode_size, textures_mask };
|
return{ (u32)program_offset, ucode_size, constants_size, textures_mask };
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t fragment_program_utils::get_fragment_program_ucode_hash(const RSXFragmentProgram& program)
|
size_t fragment_program_utils::get_fragment_program_ucode_hash(const RSXFragmentProgram& program)
|
||||||
|
|
|
@ -57,6 +57,7 @@ namespace program_hash_util
|
||||||
{
|
{
|
||||||
u32 program_start_offset;
|
u32 program_start_offset;
|
||||||
u32 program_ucode_length;
|
u32 program_ucode_length;
|
||||||
|
u32 program_constants_buffer_length;
|
||||||
u16 referenced_textures_mask;
|
u16 referenced_textures_mask;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1189,7 +1189,7 @@ void GLGSRender::load_program_env(const gl::vertex_upload_info& upload_info)
|
||||||
u32 vertex_constants_offset;
|
u32 vertex_constants_offset;
|
||||||
u32 fragment_constants_offset;
|
u32 fragment_constants_offset;
|
||||||
|
|
||||||
const u32 fragment_constants_size = (const u32)m_prog_buffer.get_fragment_constants_buffer_size(current_fragment_program);
|
const u32 fragment_constants_size = current_fp_metadata.program_constants_buffer_length;
|
||||||
const u32 fragment_buffer_size = fragment_constants_size + (18 * 4 * sizeof(float));
|
const u32 fragment_buffer_size = fragment_constants_size + (18 * 4 * sizeof(float));
|
||||||
const bool update_transform_constants = !!(m_graphics_state & rsx::pipeline_state::transform_constants_dirty);
|
const bool update_transform_constants = !!(m_graphics_state & rsx::pipeline_state::transform_constants_dirty);
|
||||||
|
|
||||||
|
|
|
@ -1326,7 +1326,7 @@ void VKGSRender::end()
|
||||||
m_vertex_upload_time += std::chrono::duration_cast<std::chrono::microseconds>(vertex_end - vertex_start).count();
|
m_vertex_upload_time += std::chrono::duration_cast<std::chrono::microseconds>(vertex_end - vertex_start).count();
|
||||||
|
|
||||||
// Load program execution environment
|
// Load program execution environment
|
||||||
program_start = textures_end;
|
program_start = vertex_end;
|
||||||
load_program_env(upload_info);
|
load_program_env(upload_info);
|
||||||
|
|
||||||
VkBufferView persistent_buffer = m_persistent_attribute_storage ? m_persistent_attribute_storage->value : null_buffer_view->value;
|
VkBufferView persistent_buffer = m_persistent_attribute_storage ? m_persistent_attribute_storage->value : null_buffer_view->value;
|
||||||
|
@ -2374,7 +2374,7 @@ void VKGSRender::load_program_env(const vk::vertex_upload_info& vertex_info)
|
||||||
|
|
||||||
if (1)//m_graphics_state & (rsx::pipeline_state::fragment_state_dirty | rsx::pipeline_state::vertex_state_dirty))
|
if (1)//m_graphics_state & (rsx::pipeline_state::fragment_state_dirty | rsx::pipeline_state::vertex_state_dirty))
|
||||||
{
|
{
|
||||||
const size_t fragment_constants_sz = m_prog_buffer->get_fragment_constants_buffer_size(current_fragment_program);
|
const size_t fragment_constants_sz = current_fp_metadata.program_constants_buffer_length;
|
||||||
const size_t fragment_buffer_sz = fragment_constants_sz + (18 * 4 * sizeof(float));
|
const size_t fragment_buffer_sz = fragment_constants_sz + (18 * 4 * sizeof(float));
|
||||||
const size_t required_mem = 512 + fragment_buffer_sz;
|
const size_t required_mem = 512 + fragment_buffer_sz;
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ namespace rsx
|
||||||
{
|
{
|
||||||
//Don't throw, gather information and ignore broken/garbage commands
|
//Don't throw, gather information and ignore broken/garbage commands
|
||||||
//TODO: Investigate why these commands are executed at all. (Heap corruption? Alignment padding?)
|
//TODO: Investigate why these commands are executed at all. (Heap corruption? Alignment padding?)
|
||||||
LOG_ERROR(RSX, "Invalid RSX method 0x%x (arg=0x%x)" HERE, _reg << 2, arg);
|
LOG_ERROR(RSX, "Invalid RSX method 0x%x (arg=0x%x)", _reg << 2, arg);
|
||||||
rsx->invalid_command_interrupt_raised = true;
|
rsx->invalid_command_interrupt_raised = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue