rsx: use std::span and const ref

This commit is contained in:
Megamouse
2026-09-30 16:33:05 +02:00
parent a8fabaf570
commit da0dc28841
3 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -743,7 +743,7 @@ namespace rsx
// indirection table size
const auto full_reupload = !prog || prog->has_indexed_constants;
const auto reloc_table = full_reupload ? decltype(prog->constant_ids){} : prog->constant_ids;
const auto reloc_table = full_reupload ? std::span<const u16>{} : std::span<const u16>(prog->constant_ids);
const auto redirection_table_size = full_reupload ? 468u : ::size32(prog->constant_ids);
instancing_indirection_table.resize(redirection_table_size);
+2 -2
View File
@@ -839,7 +839,7 @@ void GLGSRender::emit_geometry(u32 sub_index)
}
else
{
const auto subranges = draw_call.get_subranges();
const auto& subranges = draw_call.get_subranges();
const auto draw_count = subranges.size();
const u32 type_scale = (index_type == GL_UNSIGNED_SHORT) ? 1 : 2;
uptr index_ptr = index_offset;
@@ -849,7 +849,7 @@ void GLGSRender::emit_geometry(u32 sub_index)
const GLvoid** offsets = utils::bless<const GLvoid*>(counts + draw_count);
int dst_index = 0;
for (const auto &range : subranges)
for (const auto& range : subranges)
{
const auto index_size = get_index_count(draw_call.primitive, range.count);
counts[dst_index] = index_size;
+7 -7
View File
@@ -1166,15 +1166,15 @@ void VKGSRender::emit_geometry(u32 sub_index)
}
else if (m_device->get_multidraw_support())
{
const auto subranges = draw_call.get_subranges();
auto ptr = utils::bless<const VkMultiDrawInfoEXT>(& subranges.front().first);
const auto& subranges = draw_call.get_subranges();
auto ptr = utils::bless<const VkMultiDrawInfoEXT>(&subranges.front().first);
_vkCmdDrawMultiEXT(*m_current_command_buffer, ::size32(subranges), ptr, 1, 0, sizeof(rsx::draw_range_t));
}
else
{
u32 vertex_offset = 0;
const auto subranges = draw_call.get_subranges();
for (const auto &range : subranges)
const auto& subranges = draw_call.get_subranges();
for (const auto& range : subranges)
{
vkCmdDraw(*m_current_command_buffer, range.count, 1, vertex_offset, 0);
vertex_offset += range.count;
@@ -1198,7 +1198,7 @@ void VKGSRender::emit_geometry(u32 sub_index)
}
else if (m_device->get_multidraw_support())
{
const auto subranges = draw_call.get_subranges();
const auto& subranges = draw_call.get_subranges();
const auto subranges_count = ::size32(subranges);
const auto allocation_size = subranges_count * sizeof(VkMultiDrawIndexedInfoEXT);
@@ -1223,8 +1223,8 @@ void VKGSRender::emit_geometry(u32 sub_index)
else
{
u32 vertex_offset = 0;
const auto subranges = draw_call.get_subranges();
for (const auto &range : subranges)
const auto& subranges = draw_call.get_subranges();
for (const auto& range : subranges)
{
const auto count = get_index_count(draw_call.primitive, range.count);
vkCmdDrawIndexed(*m_current_command_buffer, count, 1, vertex_offset, 0, 0);