vk/exp: Remove unnecessary locks and optimize VS

- Hoists the most common pointer-chase to local var
This commit is contained in:
kd-11 2025-08-19 02:50:47 +03:00 committed by kd-11
parent 89e1c3ecfa
commit d770c7d7fa
3 changed files with 5 additions and 4 deletions

View file

@ -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();
for (unsigned i = 0; i < m_descriptor_slots.size(); ++i)

View file

@ -82,8 +82,7 @@ void VKVertexDecompilerThread::insertHeader(std::stringstream &OS)
OS <<
// Variable redirection
"#define get_draw_params() draw_parameters[draw_parameters_offset]\n"
"#define vs_context_offset get_draw_params().vs_context_offset\n"
"#define xform_constants_offset get_draw_params().xform_constants_offset\n\n"
"#define vs_context_offset get_draw_params().vs_context_offset\n\n"
// Helpers
"#define get_vertex_context() vertex_contexts[vs_context_offset]\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 << "\nuint xform_constants_offset = get_draw_params().xform_constants_offset;\n\n";
}
void VKVertexDecompilerThread::insertMainEnd(std::stringstream & OS)

View file

@ -465,7 +465,7 @@ namespace vk
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_copies = ::size32(m_pending_copies);