MCPcopy Create free account
hub / github.com/InoriRus/Kyty / FreeDescriptor

Method FreeDescriptor

source/emulator/src/Graphics/GraphicsRender.cpp:3437–3470  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3435}
3436
3437void DescriptorCache::FreeDescriptor(VulkanBuffer* buffer)
3438{
3439 KYTY_PROFILER_FUNCTION();
3440
3441 EXIT_IF(buffer == nullptr);
3442
3443 Core::LockGuard lock(m_mutex);
3444
3445 int index = 0;
3446 for (auto& set: m_sets)
3447 {
3448 if (set.set != nullptr)
3449 {
3450 for (int i = 0; i < set.storage_buffers_num; i++)
3451 {
3452 if (set.storage_buffers_id[i] == buffer->memory.unique_id)
3453 {
3454 Free(set.set);
3455 set.set = nullptr;
3456 set.next_free_set = m_first_free_set;
3457 m_first_free_set = index;
3458 auto& ids = m_sets_map[set.hash];
3459 ids.Remove(index);
3460 if (ids.IsEmpty())
3461 {
3462 m_sets_map.Remove(set.hash);
3463 }
3464 break;
3465 }
3466 }
3467 }
3468 index++;
3469 }
3470}
3471
3472void DescriptorCache::FreeDescriptor(VulkanImage* image)
3473{

Callers 1

DeleteDescriptorFunction · 0.80

Calls 3

FreeFunction · 0.50
RemoveMethod · 0.45
IsEmptyMethod · 0.45

Tested by

no test coverage detected