mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-19 19:15:26 +00:00
rsx: Rewrite the find method to avoid unnecessary allocations
This commit is contained in:
parent
97f7461aa9
commit
105205312b
1 changed files with 9 additions and 3 deletions
|
@ -481,13 +481,19 @@ namespace rsx
|
|||
|
||||
storage_type* find_vertex_range(uptr local_addr, upload_format fmt, u32 data_length) override
|
||||
{
|
||||
//const auto data_end = local_addr + data_length;
|
||||
auto found = vertex_ranges.find(local_addr);
|
||||
if (found == vertex_ranges.end())
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
for (auto &v : vertex_ranges[local_addr])
|
||||
for (auto &v : found->second)
|
||||
{
|
||||
// NOTE: This has to match exactly. Using sized shortcuts such as >= comparison causes artifacting in some applications (UC1)
|
||||
if (v.buffer_format == fmt && v.data_length == data_length)
|
||||
if (v.data_length == data_length && v.buffer_format == fmt)
|
||||
{
|
||||
return &v;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
|
|
Loading…
Add table
Reference in a new issue