From 1f9ade0ab6f900c01e0a5d593d0749073141a156 Mon Sep 17 00:00:00 2001 From: kd-11 Date: Sun, 20 Feb 2022 17:32:21 +0300 Subject: [PATCH] vk: Remove pointless function (VKGSRender::open_command_buffer) A relic of the past, back before we wrote wrappers for raw handles. --- rpcs3/Emu/RSX/VK/VKGSRender.cpp | 10 ++-------- rpcs3/Emu/RSX/VK/VKGSRender.h | 1 - rpcs3/Emu/RSX/VK/VKPresent.cpp | 6 ++---- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/rpcs3/Emu/RSX/VK/VKGSRender.cpp b/rpcs3/Emu/RSX/VK/VKGSRender.cpp index 19ced3f39..8a7a29b84 100644 --- a/rpcs3/Emu/RSX/VK/VKGSRender.cpp +++ b/rpcs3/Emu/RSX/VK/VKGSRender.cpp @@ -409,6 +409,7 @@ VKGSRender::VKGSRender() : GSRender() m_command_buffer_pool.create((*m_device), m_device->get_graphics_queue_family()); m_primary_cb_list.create(m_command_buffer_pool, vk::command_buffer::access_type_hint::flush_only); m_current_command_buffer = m_primary_cb_list.get(); + m_current_command_buffer->begin(); //Create secondary command_buffer for parallel operations m_secondary_command_buffer_pool.create((*m_device), m_device->get_graphics_queue_family()); @@ -507,8 +508,6 @@ VKGSRender::VKGSRender() : GSRender() m_shaders_cache = std::make_unique(*m_prog_buffer, "vulkan", "v1.92"); - open_command_buffer(); - for (u32 i = 0; i < m_swapchain->get_swap_image_count(); ++i) { const auto target_layout = m_swapchain->get_optimal_present_layout(); @@ -1451,7 +1450,7 @@ void VKGSRender::flush_command_queue(bool hard_sync, bool do_not_switch) m_current_command_buffer->flags |= vk::command_buffer::cb_load_occluson_task; } - open_command_buffer(); + m_current_command_buffer->begin(); } void VKGSRender::sync_hint(rsx::FIFO_hint hint, void* args) @@ -2144,11 +2143,6 @@ void VKGSRender::close_and_submit_command_buffer(vk::fence* pFence, VkSemaphore m_queue_status.clear(flush_queue_state::flushing); } -void VKGSRender::open_command_buffer() -{ - m_current_command_buffer->begin(); -} - void VKGSRender::prepare_rtts(rsx::framebuffer_creation_context context) { const bool clipped_scissor = (context == rsx::framebuffer_creation_context::context_draw); diff --git a/rpcs3/Emu/RSX/VK/VKGSRender.h b/rpcs3/Emu/RSX/VK/VKGSRender.h index 20f3265e8..55cf87d40 100644 --- a/rpcs3/Emu/RSX/VK/VKGSRender.h +++ b/rpcs3/Emu/RSX/VK/VKGSRender.h @@ -198,7 +198,6 @@ public: private: void prepare_rtts(rsx::framebuffer_creation_context context); - void open_command_buffer(); void close_and_submit_command_buffer( vk::fence* fence = nullptr, VkSemaphore wait_semaphore = VK_NULL_HANDLE, diff --git a/rpcs3/Emu/RSX/VK/VKPresent.cpp b/rpcs3/Emu/RSX/VK/VKPresent.cpp index 0ea44f055..93f728a62 100644 --- a/rpcs3/Emu/RSX/VK/VKPresent.cpp +++ b/rpcs3/Emu/RSX/VK/VKPresent.cpp @@ -25,6 +25,7 @@ void VKGSRender::reinitialize_swapchain() // NOTE: This operation will create a hard sync point close_and_submit_command_buffer(); m_current_command_buffer->reset(); + m_current_command_buffer->begin(); for (auto &ctx : frame_context_storage) { @@ -46,13 +47,10 @@ void VKGSRender::reinitialize_swapchain() { rsx_log.warning("Swapchain initialization failed. Request ignored [%dx%d]", m_swapchain_dims.width, m_swapchain_dims.height); swapchain_unavailable = true; - open_command_buffer(); return; } // Prepare new swapchain images for use - open_command_buffer(); - for (u32 i = 0; i < m_swapchain->get_swap_image_count(); ++i) { const auto target_layout = m_swapchain->get_optimal_present_layout(); @@ -73,7 +71,7 @@ void VKGSRender::reinitialize_swapchain() vk::wait_for_fence(&resize_fence); m_current_command_buffer->reset(); - open_command_buffer(); + m_current_command_buffer->begin(); swapchain_unavailable = false; should_reinitialize_swapchain = false;