mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-01 07:13:36 +00:00
rsx/vk: More optimizations
- Do not bother rechecking the dirty sampler pool for hits. Its faster to create new sampler than to search the pool - Reserve some memory on vertex layout struct to reduce reallocation penalty
This commit is contained in:
parent
8ccaabb502
commit
af1b13550b
@ -1264,6 +1264,7 @@ namespace rsx
|
||||
if (state.current_draw_clause.command == rsx::draw_command::inlined_array)
|
||||
{
|
||||
vertex_input_layout result = {};
|
||||
result.interleaved_blocks.reserve(8);
|
||||
|
||||
interleaved_range_info info = {};
|
||||
info.interleaved = true;
|
||||
@ -1288,6 +1289,8 @@ namespace rsx
|
||||
|
||||
const u32 frequency_divider_mask = rsx::method_registers.frequency_divider_operation_mask();
|
||||
vertex_input_layout result = {};
|
||||
result.interleaved_blocks.reserve(8);
|
||||
result.referenced_registers.reserve(4);
|
||||
|
||||
for (u8 index = 0; index < rsx::limits::vertex_count; ++index)
|
||||
{
|
||||
|
@ -1129,22 +1129,8 @@ void VKGSRender::end()
|
||||
|
||||
if (replace)
|
||||
{
|
||||
for (auto &sampler : m_current_frame->samplers_to_clean)
|
||||
{
|
||||
if (sampler->matches(wrap_s, wrap_t, wrap_r, false, lod_bias, af_level, min_lod, max_lod,
|
||||
min_filter, mag_filter, mip_mode, border_color, compare_enabled, depth_compare_mode))
|
||||
{
|
||||
fs_sampler_handles[i] = std::move(sampler);
|
||||
replace = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (replace)
|
||||
{
|
||||
fs_sampler_handles[i] = std::make_unique<vk::sampler>(*m_device, wrap_s, wrap_t, wrap_r, false, lod_bias, af_level, min_lod, max_lod,
|
||||
min_filter, mag_filter, mip_mode, border_color, compare_enabled, depth_compare_mode);
|
||||
}
|
||||
fs_sampler_handles[i] = std::make_unique<vk::sampler>(*m_device, wrap_s, wrap_t, wrap_r, false, lod_bias, af_level, min_lod, max_lod,
|
||||
min_filter, mag_filter, mip_mode, border_color, compare_enabled, depth_compare_mode);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1188,7 +1174,6 @@ void VKGSRender::end()
|
||||
|
||||
if (replace)
|
||||
{
|
||||
//This is unlikely, there is no need to check the dirty pool
|
||||
vs_sampler_handles[i] = std::make_unique<vk::sampler>(
|
||||
*m_device,
|
||||
VK_SAMPLER_ADDRESS_MODE_REPEAT, VK_SAMPLER_ADDRESS_MODE_REPEAT, VK_SAMPLER_ADDRESS_MODE_REPEAT,
|
||||
|
Loading…
x
Reference in New Issue
Block a user