mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-20 01:21:09 +00:00
rsx: Rewrite the find method to avoid unnecessary allocations
This commit is contained in:
parent
97f7461aa9
commit
105205312b
@ -481,14 +481,20 @@ namespace rsx
|
|||||||
|
|
||||||
storage_type* find_vertex_range(uptr local_addr, upload_format fmt, u32 data_length) override
|
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)
|
// 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 &v;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user