mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-09 08:21:29 +12:00
vk: Reuse discarded memory whenever possible instead of recreating new
objects - Memory allocations are surprisingly expensive when spammed
This commit is contained in:
parent
71e809a78b
commit
ad10eb391e
5 changed files with 155 additions and 88 deletions
|
@ -796,3 +796,17 @@ size_t get_texture_size(const rsx::vertex_texture &texture)
|
|||
return get_texture_size(texture.format(), texture.width(), texture.height(), texture.depth(),
|
||||
texture.pitch(), texture.get_exact_mipmap_count(), texture.cubemap() ? 6 : 1);
|
||||
}
|
||||
|
||||
u32 get_remap_encoding(const std::pair<std::array<u8, 4>, std::array<u8, 4>>& remap)
|
||||
{
|
||||
u32 encode = 0;
|
||||
encode |= (remap.first[0] << 0);
|
||||
encode |= (remap.first[1] << 2);
|
||||
encode |= (remap.first[2] << 4);
|
||||
encode |= (remap.first[3] << 6);
|
||||
encode |= (remap.second[0] << 8);
|
||||
encode |= (remap.second[1] << 10);
|
||||
encode |= (remap.second[2] << 12);
|
||||
encode |= (remap.second[3] << 14);
|
||||
return encode;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue