mirror of https://github.com/RPCS3/rpcs3.git
vk: Avoid multimap when handling image views
This commit is contained in:
parent
e1b95913ea
commit
360fdca5ac
|
@ -391,13 +391,12 @@ namespace vk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto found = views.equal_range(remap_encoding);
|
const auto storage_key = remap_encoding | (mask << 16);
|
||||||
for (auto It = found.first; It != found.second; ++It)
|
auto found = views.find(storage_key);
|
||||||
|
if (found != views.end() &&
|
||||||
|
found->second->info.subresourceRange.aspectMask & mask)
|
||||||
{
|
{
|
||||||
if (It->second->info.subresourceRange.aspectMask & mask)
|
return found->second.get();
|
||||||
{
|
|
||||||
return It->second.get();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VkComponentMapping real_mapping;
|
VkComponentMapping real_mapping;
|
||||||
|
@ -423,7 +422,7 @@ namespace vk
|
||||||
|
|
||||||
auto view = std::make_unique<vk::image_view>(*g_render_device, this, VK_IMAGE_VIEW_TYPE_MAX_ENUM, real_mapping, range);
|
auto view = std::make_unique<vk::image_view>(*g_render_device, this, VK_IMAGE_VIEW_TYPE_MAX_ENUM, real_mapping, range);
|
||||||
auto result = view.get();
|
auto result = view.get();
|
||||||
views.emplace(remap_encoding, std::move(view));
|
views.emplace(storage_key, std::move(view));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -124,7 +124,7 @@ namespace vk
|
||||||
class viewable_image : public image
|
class viewable_image : public image
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
std::unordered_multimap<u32, std::unique_ptr<vk::image_view>> views;
|
std::unordered_map<u32, std::unique_ptr<vk::image_view>> views;
|
||||||
viewable_image* clone();
|
viewable_image* clone();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Reference in New Issue