diff --git a/rpcs3/Emu/RSX/VK/VKDraw.cpp b/rpcs3/Emu/RSX/VK/VKDraw.cpp index b7d3d46d3b..6a505eff64 100644 --- a/rpcs3/Emu/RSX/VK/VKDraw.cpp +++ b/rpcs3/Emu/RSX/VK/VKDraw.cpp @@ -1141,12 +1141,8 @@ void VKGSRender::end() m_frame_stats.textures_upload_time += m_profiler.duration(); // Final heap check... - check_heap_status( - { - std::ref(m_attrib_ring_info), - std::ref(m_index_buffer_ring_info), - std::ref(m_draw_indirect_count_ring_info) - }); + vk::data_heap* vertex_storage_heaps[] = { &m_attrib_ring_info, &m_index_buffer_ring_info, &m_draw_indirect_count_ring_info }; + check_heap_status(vertex_storage_heaps); u32 sub_index = 0; // RSX subdraw ID m_current_draw.subdraw_id = 0; // Host subdraw ID. Invalid RSX subdraws do not increment this value diff --git a/rpcs3/Emu/RSX/VK/VKGSRender.cpp b/rpcs3/Emu/RSX/VK/VKGSRender.cpp index ad77bcc7fc..e044649d82 100644 --- a/rpcs3/Emu/RSX/VK/VKGSRender.cpp +++ b/rpcs3/Emu/RSX/VK/VKGSRender.cpp @@ -1150,24 +1150,26 @@ void VKGSRender::notify_tile_unbound(u32 tile) bool VKGSRender::check_heap_status(const vk::data_heap& heap) { - if (heap.heap && heap.is_critical()) + if (!heap.heap || !heap.is_critical()) [[ likely ]] { - handle_heap_critical(); - return true; + return false; } - return false; + handle_heap_critical(); + return true; } -bool VKGSRender::check_heap_status(std::initializer_list> heaps) +bool VKGSRender::check_heap_status(const std::span& heaps) { - for (const vk::data_heap& heap : heaps) + for (const auto& heap : heaps) { - if (heap.heap && heap.is_critical()) + if (!heap->heap || !heap->is_critical()) [[ likely ]] { - handle_heap_critical(); - return true; + continue; } + + handle_heap_critical(); + return true; } return false; diff --git a/rpcs3/Emu/RSX/VK/VKGSRender.h b/rpcs3/Emu/RSX/VK/VKGSRender.h index 91cfa4dfb1..0fc1e54950 100644 --- a/rpcs3/Emu/RSX/VK/VKGSRender.h +++ b/rpcs3/Emu/RSX/VK/VKGSRender.h @@ -221,7 +221,7 @@ private: void handle_heap_critical(); bool check_heap_status(const vk::data_heap& heap); - bool check_heap_status(std::initializer_list> heaps); + bool check_heap_status(const std::span& heaps); void check_present_status(); VkDescriptorSet allocate_descriptor_set(); diff --git a/rpcs3/Emu/RSX/VK/VulkanAPI.cpp b/rpcs3/Emu/RSX/VK/VulkanAPI.cpp index d866710355..6e2eb89e3a 100644 --- a/rpcs3/Emu/RSX/VK/VulkanAPI.cpp +++ b/rpcs3/Emu/RSX/VK/VulkanAPI.cpp @@ -8,7 +8,7 @@ namespace vk { - render_device* get_current_renderer(); + const render_device* get_current_renderer(); void init() {