mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-30 12:32:43 +00:00
vk: Fix comparison between composite memory types
This commit is contained in:
parent
a4cd9e022a
commit
e5029c532b
@ -47,6 +47,32 @@ namespace vk
|
|||||||
memory_type_info::operator bool() const
|
memory_type_info::operator bool() const
|
||||||
{
|
{
|
||||||
return !type_ids.empty();
|
return !type_ids.empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool memory_type_info::operator == (const memory_type_info& other) const
|
||||||
|
{
|
||||||
|
if (type_ids.size() != other.type_ids.size())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (type_ids.size())
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
return type_ids[0] == other.type_ids[0];
|
||||||
|
case 2:
|
||||||
|
return ((type_ids[0] == other.type_ids[0] && type_ids[1] == other.type_ids[1]) ||
|
||||||
|
(type_ids[0] == other.type_ids[1] && type_ids[1] == other.type_ids[0]));
|
||||||
|
default:
|
||||||
|
for (const auto& id : other.type_ids)
|
||||||
|
{
|
||||||
|
if (std::find(type_ids.begin(), type_ids.end(), id) == type_ids.end())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
memory_type_info memory_type_info::get(const render_device& dev, u32 access_flags, u32 type_mask) const
|
memory_type_info memory_type_info::get(const render_device& dev, u32 access_flags, u32 type_mask) const
|
||||||
|
@ -42,6 +42,7 @@ namespace vk
|
|||||||
size_t count() const;
|
size_t count() const;
|
||||||
|
|
||||||
operator bool() const;
|
operator bool() const;
|
||||||
|
bool operator == (const memory_type_info& other) const;
|
||||||
|
|
||||||
memory_type_info get(const render_device& dev, u32 access_flags, u32 type_mask) const;
|
memory_type_info get(const render_device& dev, u32 access_flags, u32 type_mask) const;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user