mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-18 13:21:09 +00:00
rsx: Rewrite the find method to avoid unnecessary allocations
This commit is contained in:
parent
97f7461aa9
commit
105205312b
@ -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…
x
Reference in New Issue
Block a user