mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-07 15:31:26 +12:00
rsx: Optimizations
- Replace a few more vectors with simple_array<T> - Avoid unnecessary string comparisons in backends. We already know referenced textures from the program analysers!
This commit is contained in:
parent
677b16f5c6
commit
b0a6b72ce8
5 changed files with 10 additions and 8 deletions
|
@ -400,7 +400,7 @@ void GLGSRender::end()
|
||||||
|
|
||||||
for (int i = 0; i < rsx::limits::fragment_textures_count; ++i)
|
for (int i = 0; i < rsx::limits::fragment_textures_count; ++i)
|
||||||
{
|
{
|
||||||
if (m_program->uniforms.has_location(rsx::constants::fragment_texture_names[i]))
|
if (current_fp_metadata.referenced_textures_mask & (1 << i))
|
||||||
{
|
{
|
||||||
auto sampler_state = static_cast<gl::texture_cache::sampled_image_descriptor*>(fs_sampler_state[i].get());
|
auto sampler_state = static_cast<gl::texture_cache::sampled_image_descriptor*>(fs_sampler_state[i].get());
|
||||||
auto &tex = rsx::method_registers.fragment_textures[i];
|
auto &tex = rsx::method_registers.fragment_textures[i];
|
||||||
|
@ -436,7 +436,7 @@ void GLGSRender::end()
|
||||||
|
|
||||||
for (int i = 0; i < rsx::limits::vertex_textures_count; ++i)
|
for (int i = 0; i < rsx::limits::vertex_textures_count; ++i)
|
||||||
{
|
{
|
||||||
if (m_program->uniforms.has_location(rsx::constants::vertex_texture_names[i]))
|
if (current_vp_metadata.referenced_textures_mask & (1 << i))
|
||||||
{
|
{
|
||||||
auto sampler_state = static_cast<gl::texture_cache::sampled_image_descriptor*>(vs_sampler_state[i].get());
|
auto sampler_state = static_cast<gl::texture_cache::sampled_image_descriptor*>(vs_sampler_state[i].get());
|
||||||
glActiveTexture(GL_TEXTURE0 + rsx::limits::fragment_textures_count + i);
|
glActiveTexture(GL_TEXTURE0 + rsx::limits::fragment_textures_count + i);
|
||||||
|
|
|
@ -242,7 +242,7 @@ namespace rsx
|
||||||
|
|
||||||
if ((cmd & RSX_METHOD_NOP_MASK) == RSX_METHOD_NOP_CMD)
|
if ((cmd & RSX_METHOD_NOP_MASK) == RSX_METHOD_NOP_CMD)
|
||||||
{
|
{
|
||||||
if (commands.back().reg != RSX_METHOD_NOP_CMD)
|
if (commands.empty() || commands.back().reg != RSX_METHOD_NOP_CMD)
|
||||||
{
|
{
|
||||||
// Insert one NOP only
|
// Insert one NOP only
|
||||||
commands.push_back({ RSX_METHOD_NOP_CMD, 0, get_pointer });
|
commands.push_back({ RSX_METHOD_NOP_CMD, 0, get_pointer });
|
||||||
|
@ -601,6 +601,7 @@ namespace rsx
|
||||||
{
|
{
|
||||||
m_internal_get = m_ctrl->get;
|
m_internal_get = m_ctrl->get;
|
||||||
read_ahead(m_fifo_info, m_queue, m_internal_get);
|
read_ahead(m_fifo_info, m_queue, m_internal_get);
|
||||||
|
//optimize(m_fifo_info, m_queue);
|
||||||
|
|
||||||
m_ctrl->get = m_internal_get;
|
m_ctrl->get = m_internal_get;
|
||||||
m_ctrl_tag++;
|
m_ctrl_tag++;
|
||||||
|
|
|
@ -1266,7 +1266,7 @@ void VKGSRender::end()
|
||||||
|
|
||||||
auto ds = std::get<1>(m_rtts.m_bound_depth_stencil);
|
auto ds = std::get<1>(m_rtts.m_bound_depth_stencil);
|
||||||
//Clear any 'dirty' surfaces - possible is a recycled cache surface is used
|
//Clear any 'dirty' surfaces - possible is a recycled cache surface is used
|
||||||
std::vector<VkClearAttachment> buffers_to_clear;
|
rsx::simple_array<VkClearAttachment> buffers_to_clear;
|
||||||
buffers_to_clear.reserve(4);
|
buffers_to_clear.reserve(4);
|
||||||
|
|
||||||
//Check for memory clears
|
//Check for memory clears
|
||||||
|
@ -1510,7 +1510,7 @@ void VKGSRender::end()
|
||||||
|
|
||||||
for (int i = 0; i < rsx::limits::fragment_textures_count; ++i)
|
for (int i = 0; i < rsx::limits::fragment_textures_count; ++i)
|
||||||
{
|
{
|
||||||
if (m_program->has_uniform(rsx::constants::fragment_texture_names[i]))
|
if (current_fp_metadata.referenced_textures_mask & (1 << i))
|
||||||
{
|
{
|
||||||
if (!rsx::method_registers.fragment_textures[i].enabled())
|
if (!rsx::method_registers.fragment_textures[i].enabled())
|
||||||
{
|
{
|
||||||
|
@ -1540,7 +1540,7 @@ void VKGSRender::end()
|
||||||
|
|
||||||
for (int i = 0; i < rsx::limits::vertex_textures_count; ++i)
|
for (int i = 0; i < rsx::limits::vertex_textures_count; ++i)
|
||||||
{
|
{
|
||||||
if (m_program->has_uniform(rsx::constants::vertex_texture_names[i]))
|
if (current_vp_metadata.referenced_textures_mask & (1 << i))
|
||||||
{
|
{
|
||||||
if (!rsx::method_registers.vertex_textures[i].enabled())
|
if (!rsx::method_registers.vertex_textures[i].enabled())
|
||||||
{
|
{
|
||||||
|
|
|
@ -142,7 +142,7 @@ struct command_buffer_chunk: public vk::command_buffer
|
||||||
|
|
||||||
struct occlusion_data
|
struct occlusion_data
|
||||||
{
|
{
|
||||||
std::vector<u32> indices;
|
rsx::simple_array<u32> indices;
|
||||||
command_buffer_chunk* command_buffer_to_wait = nullptr;
|
command_buffer_chunk* command_buffer_to_wait = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -2505,7 +2505,8 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void reset_queries(vk::command_buffer &cmd, std::vector<u32> &list)
|
template<template<class> class _List>
|
||||||
|
void reset_queries(vk::command_buffer &cmd, _List<u32> &list)
|
||||||
{
|
{
|
||||||
for (const auto index : list)
|
for (const auto index : list)
|
||||||
reset_query(cmd, index);
|
reset_query(cmd, index);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue