mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-08-20 01:11:31 +00:00
vk: Add deregister event for sets
- Unused in practice, but this is more for peace of mind.
This commit is contained in:
parent
eed38e1bbc
commit
3d49976b3c
2 changed files with 28 additions and 5 deletions
|
@ -8,7 +8,7 @@ namespace vk
|
||||||
class dispatch_manager
|
class dispatch_manager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void flush_all()
|
inline void flush_all()
|
||||||
{
|
{
|
||||||
for (auto& set : m_notification_list)
|
for (auto& set : m_notification_list)
|
||||||
{
|
{
|
||||||
|
@ -16,7 +16,7 @@ namespace vk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void notify(descriptor_set* set)
|
void register_(descriptor_set* set)
|
||||||
{
|
{
|
||||||
// Rare event, upon creation of a new set tracker.
|
// Rare event, upon creation of a new set tracker.
|
||||||
// Check for spurious 'new' events when the aux context is taking over
|
// Check for spurious 'new' events when the aux context is taking over
|
||||||
|
@ -26,7 +26,22 @@ namespace vk
|
||||||
}
|
}
|
||||||
|
|
||||||
m_notification_list.push_back(set);
|
m_notification_list.push_back(set);
|
||||||
rsx_log.error("Now monitoring %u descriptor sets", m_notification_list.size());
|
rsx_log.warning("[descriptor_manager::register] Now monitoring %u descriptor sets", m_notification_list.size());
|
||||||
|
}
|
||||||
|
|
||||||
|
void deregister(descriptor_set* set)
|
||||||
|
{
|
||||||
|
for (auto it = m_notification_list.begin(); it != m_notification_list.end(); ++it)
|
||||||
|
{
|
||||||
|
if (*it == set)
|
||||||
|
{
|
||||||
|
*it = m_notification_list.back();
|
||||||
|
m_notification_list.pop_back();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
rsx_log.warning("[descriptor_manager::deregister] Now monitoring %u descriptor sets", m_notification_list.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
dispatch_manager() = default;
|
dispatch_manager() = default;
|
||||||
|
@ -206,6 +221,14 @@ namespace vk
|
||||||
m_handle = set;
|
m_handle = set;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
descriptor_set::~descriptor_set()
|
||||||
|
{
|
||||||
|
if (m_update_after_bind_mask)
|
||||||
|
{
|
||||||
|
g_fxo->get<descriptors::dispatch_manager>().deregister(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void descriptor_set::init(VkDescriptorSet new_set)
|
void descriptor_set::init(VkDescriptorSet new_set)
|
||||||
{
|
{
|
||||||
if (!m_in_use) [[unlikely]]
|
if (!m_in_use) [[unlikely]]
|
||||||
|
@ -219,7 +242,7 @@ namespace vk
|
||||||
|
|
||||||
if (m_update_after_bind_mask)
|
if (m_update_after_bind_mask)
|
||||||
{
|
{
|
||||||
g_fxo->get<descriptors::dispatch_manager>().notify(this);
|
g_fxo->get<descriptors::dispatch_manager>().register_(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_push_type_mask & ~m_update_after_bind_mask)
|
else if (m_push_type_mask & ~m_update_after_bind_mask)
|
||||||
|
|
|
@ -50,7 +50,7 @@ namespace vk
|
||||||
public:
|
public:
|
||||||
descriptor_set(VkDescriptorSet set);
|
descriptor_set(VkDescriptorSet set);
|
||||||
descriptor_set() = default;
|
descriptor_set() = default;
|
||||||
~descriptor_set() = default;
|
~descriptor_set();
|
||||||
|
|
||||||
descriptor_set(const descriptor_set&) = delete;
|
descriptor_set(const descriptor_set&) = delete;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue