mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-12-06 07:12:28 +01:00
vk/exp: Remove unnecessary locks and optimize VS
- Hoists the most common pointer-chase to local var
This commit is contained in:
parent
89e1c3ecfa
commit
d770c7d7fa
|
|
@ -559,7 +559,7 @@ namespace vk
|
||||||
};
|
};
|
||||||
|
|
||||||
{
|
{
|
||||||
std::lock_guard lock(m_descriptor_set);
|
//std::lock_guard lock(m_descriptor_set);
|
||||||
const bool cache_is_valid = m_descriptor_template_cache_id == m_descriptor_set.cache_id();
|
const bool cache_is_valid = m_descriptor_template_cache_id == m_descriptor_set.cache_id();
|
||||||
|
|
||||||
for (unsigned i = 0; i < m_descriptor_slots.size(); ++i)
|
for (unsigned i = 0; i < m_descriptor_slots.size(); ++i)
|
||||||
|
|
|
||||||
|
|
@ -82,8 +82,7 @@ void VKVertexDecompilerThread::insertHeader(std::stringstream &OS)
|
||||||
OS <<
|
OS <<
|
||||||
// Variable redirection
|
// Variable redirection
|
||||||
"#define get_draw_params() draw_parameters[draw_parameters_offset]\n"
|
"#define get_draw_params() draw_parameters[draw_parameters_offset]\n"
|
||||||
"#define vs_context_offset get_draw_params().vs_context_offset\n"
|
"#define vs_context_offset get_draw_params().vs_context_offset\n\n"
|
||||||
"#define xform_constants_offset get_draw_params().xform_constants_offset\n\n"
|
|
||||||
// Helpers
|
// Helpers
|
||||||
"#define get_vertex_context() vertex_contexts[vs_context_offset]\n"
|
"#define get_vertex_context() vertex_contexts[vs_context_offset]\n"
|
||||||
"#define get_user_clip_config() get_vertex_context().user_clip_configuration_bits\n\n";
|
"#define get_user_clip_config() get_vertex_context().user_clip_configuration_bits\n\n";
|
||||||
|
|
@ -410,6 +409,8 @@ void VKVertexDecompilerThread::insertMainStart(std::stringstream & OS)
|
||||||
OS << " vec4 " << PI.name << "= read_location(" << std::to_string(PI.location) << ");\n";
|
OS << " vec4 " << PI.name << "= read_location(" << std::to_string(PI.location) << ");\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OS << "\nuint xform_constants_offset = get_draw_params().xform_constants_offset;\n\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
void VKVertexDecompilerThread::insertMainEnd(std::stringstream & OS)
|
void VKVertexDecompilerThread::insertMainEnd(std::stringstream & OS)
|
||||||
|
|
|
||||||
|
|
@ -465,7 +465,7 @@ namespace vk
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::lock_guard lock(m_storage_lock);
|
//std::lock_guard lock(m_storage_lock);
|
||||||
|
|
||||||
const auto num_writes = ::size32(m_pending_writes);
|
const auto num_writes = ::size32(m_pending_writes);
|
||||||
const auto num_copies = ::size32(m_pending_copies);
|
const auto num_copies = ::size32(m_pending_copies);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue