rsx: Minor annotations and refactoring

This commit is contained in:
kd-11 2023-06-09 00:22:51 +03:00 committed by kd-11
parent 4d565eade6
commit 72abc0f219

View file

@ -1218,7 +1218,7 @@ namespace rsx
std::span<const std::byte> thread::get_raw_index_array(const draw_clause& draw_indexed_clause) const std::span<const std::byte> thread::get_raw_index_array(const draw_clause& draw_indexed_clause) const
{ {
if (!element_push_buffer.empty()) if (!element_push_buffer.empty()) [[ unlikely ]]
{ {
// Indices provided via immediate mode // Indices provided via immediate mode
return {reinterpret_cast<const std::byte*>(element_push_buffer.data()), ::narrow<u32>(element_push_buffer.size() * sizeof(u32))}; return {reinterpret_cast<const std::byte*>(element_push_buffer.data()), ::narrow<u32>(element_push_buffer.size() * sizeof(u32))};
@ -1230,9 +1230,6 @@ namespace rsx
// Force aligned indices as realhw // Force aligned indices as realhw
const u32 address = (0 - type_size) & get_address(rsx::method_registers.index_array_address(), rsx::method_registers.index_array_location()); const u32 address = (0 - type_size) & get_address(rsx::method_registers.index_array_address(), rsx::method_registers.index_array_location());
//const bool is_primitive_restart_enabled = rsx::method_registers.restart_index_enabled();
//const u32 primitive_restart_index = rsx::method_registers.restart_index();
const u32 first = draw_indexed_clause.min_index(); const u32 first = draw_indexed_clause.min_index();
const u32 count = draw_indexed_clause.get_elements_count(); const u32 count = draw_indexed_clause.get_elements_count();
@ -1243,12 +1240,7 @@ namespace rsx
std::variant<draw_array_command, draw_indexed_array_command, draw_inlined_array> std::variant<draw_array_command, draw_indexed_array_command, draw_inlined_array>
thread::get_draw_command(const rsx::rsx_state& state) const thread::get_draw_command(const rsx::rsx_state& state) const
{ {
if (rsx::method_registers.current_draw_clause.command == rsx::draw_command::array) if (rsx::method_registers.current_draw_clause.command == rsx::draw_command::indexed) [[ likely ]]
{
return draw_array_command{};
}
if (rsx::method_registers.current_draw_clause.command == rsx::draw_command::indexed)
{ {
return draw_indexed_array_command return draw_indexed_array_command
{ {
@ -1256,6 +1248,11 @@ namespace rsx
}; };
} }
if (rsx::method_registers.current_draw_clause.command == rsx::draw_command::array)
{
return draw_array_command{};
}
if (rsx::method_registers.current_draw_clause.command == rsx::draw_command::inlined_array) if (rsx::method_registers.current_draw_clause.command == rsx::draw_command::inlined_array)
{ {
return draw_inlined_array{}; return draw_inlined_array{};