vk: Rework multi-heap health checks for performance
This commit is contained in:
@@ -1141,12 +1141,8 @@ void VKGSRender::end()
|
|||||||
m_frame_stats.textures_upload_time += m_profiler.duration();
|
m_frame_stats.textures_upload_time += m_profiler.duration();
|
||||||
|
|
||||||
// Final heap check...
|
// Final heap check...
|
||||||
check_heap_status(
|
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);
|
||||||
std::ref(m_attrib_ring_info),
|
|
||||||
std::ref(m_index_buffer_ring_info),
|
|
||||||
std::ref(m_draw_indirect_count_ring_info)
|
|
||||||
});
|
|
||||||
|
|
||||||
u32 sub_index = 0; // RSX subdraw ID
|
u32 sub_index = 0; // RSX subdraw ID
|
||||||
m_current_draw.subdraw_id = 0; // Host subdraw ID. Invalid RSX subdraws do not increment this value
|
m_current_draw.subdraw_id = 0; // Host subdraw ID. Invalid RSX subdraws do not increment this value
|
||||||
|
|||||||
@@ -1150,24 +1150,26 @@ void VKGSRender::notify_tile_unbound(u32 tile)
|
|||||||
|
|
||||||
bool VKGSRender::check_heap_status(const vk::data_heap& heap)
|
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 false;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
handle_heap_critical();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VKGSRender::check_heap_status(std::initializer_list<std::reference_wrapper<vk::data_heap>> heaps)
|
bool VKGSRender::check_heap_status(const std::span<vk::data_heap*>& 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();
|
continue;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handle_heap_critical();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ private:
|
|||||||
|
|
||||||
void handle_heap_critical();
|
void handle_heap_critical();
|
||||||
bool check_heap_status(const vk::data_heap& heap);
|
bool check_heap_status(const vk::data_heap& heap);
|
||||||
bool check_heap_status(std::initializer_list<std::reference_wrapper<vk::data_heap>> heaps);
|
bool check_heap_status(const std::span<vk::data_heap*>& heaps);
|
||||||
void check_present_status();
|
void check_present_status();
|
||||||
|
|
||||||
VkDescriptorSet allocate_descriptor_set();
|
VkDescriptorSet allocate_descriptor_set();
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
namespace vk
|
namespace vk
|
||||||
{
|
{
|
||||||
render_device* get_current_renderer();
|
const render_device* get_current_renderer();
|
||||||
|
|
||||||
void init()
|
void init()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user