From 9f5c8d0e2f5db880082bbd20518da7b60bb4db3f Mon Sep 17 00:00:00 2001 From: GPUCode Date: Mon, 29 Jan 2024 22:00:25 +0200 Subject: [PATCH] renderer_vulkan: Remove vulkan prefix in SetObjectName --- .../renderer_vulkan/vk_master_semaphore.cpp | 12 +++++------- src/video_core/renderer_vulkan/vk_master_semaphore.h | 1 + src/video_core/renderer_vulkan/vk_swapchain.cpp | 8 +++----- .../renderer_vulkan/vk_texture_runtime.cpp | 8 ++++---- 4 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/video_core/renderer_vulkan/vk_master_semaphore.cpp b/src/video_core/renderer_vulkan/vk_master_semaphore.cpp index c298a2591..f8542524d 100644 --- a/src/video_core/renderer_vulkan/vk_master_semaphore.cpp +++ b/src/video_core/renderer_vulkan/vk_master_semaphore.cpp @@ -98,8 +98,7 @@ void MasterSemaphoreTimeline::SubmitWork(vk::CommandBuffer cmdbuf, vk::Semaphore try { instance.GetGraphicsQueue().submit(submit_info); } catch (vk::DeviceLostError& err) { - LOG_CRITICAL(Render_Vulkan, "Device lost during submit: {}", err.what()); - UNREACHABLE(); + UNREACHABLE_MSG("Device lost during submit: {}", err.what()); } } @@ -114,7 +113,8 @@ MasterSemaphoreFence::MasterSemaphoreFence(const Instance& instance_) : instance } MasterSemaphoreFence::~MasterSemaphoreFence() { - std::ranges::for_each(free_queue, [this](auto fence) { instance.GetDevice().destroyFence(fence); }); + std::ranges::for_each(free_queue, + [this](auto fence) { instance.GetDevice().destroyFence(fence); }); } void MasterSemaphoreFence::Refresh() {} @@ -150,8 +150,7 @@ void MasterSemaphoreFence::SubmitWork(vk::CommandBuffer cmdbuf, vk::Semaphore wa try { instance.GetGraphicsQueue().submit(submit_info, fence); } catch (vk::DeviceLostError& err) { - LOG_CRITICAL(Render_Vulkan, "Device lost during submit: {}", err.what()); - UNREACHABLE(); + UNREACHABLE_MSG("Device lost during submit: {}", err.what()); } std::scoped_lock lock{wait_mutex}; @@ -176,8 +175,7 @@ void MasterSemaphoreFence::WaitThread(std::stop_token token) { const vk::Result result = device.waitForFences(fence, true, WAIT_TIMEOUT); if (result != vk::Result::eSuccess) { - LOG_CRITICAL(Render_Vulkan, "Fence wait failed with error {}", vk::to_string(result)); - UNREACHABLE(); + UNREACHABLE_MSG("Fence wait failed with error {}", vk::to_string(result)); } device.resetFences(fence); diff --git a/src/video_core/renderer_vulkan/vk_master_semaphore.h b/src/video_core/renderer_vulkan/vk_master_semaphore.h index 9ece95abd..f147128d0 100644 --- a/src/video_core/renderer_vulkan/vk_master_semaphore.h +++ b/src/video_core/renderer_vulkan/vk_master_semaphore.h @@ -73,6 +73,7 @@ private: class MasterSemaphoreFence : public MasterSemaphore { using Waitable = std::pair; + public: explicit MasterSemaphoreFence(const Instance& instance); ~MasterSemaphoreFence() override; diff --git a/src/video_core/renderer_vulkan/vk_swapchain.cpp b/src/video_core/renderer_vulkan/vk_swapchain.cpp index 5e725be1e..498a921a8 100644 --- a/src/video_core/renderer_vulkan/vk_swapchain.cpp +++ b/src/video_core/renderer_vulkan/vk_swapchain.cpp @@ -250,10 +250,8 @@ void Swapchain::RefreshSemaphores() { if (instance.HasDebuggingToolAttached()) { for (u32 i = 0; i < image_count; ++i) { - Vulkan::SetObjectName(device, image_acquired[i], - "Swapchain Semaphore: image_acquired {}", i); - Vulkan::SetObjectName(device, present_ready[i], "Swapchain Semaphore: present_ready {}", - i); + SetObjectName(device, image_acquired[i], "Swapchain Semaphore: image_acquired {}", i); + SetObjectName(device, present_ready[i], "Swapchain Semaphore: present_ready {}", i); } } } @@ -265,7 +263,7 @@ void Swapchain::SetupImages() { if (instance.HasDebuggingToolAttached()) { for (u32 i = 0; i < image_count; ++i) { - Vulkan::SetObjectName(device, images[i], "Swapchain Image {}", i); + SetObjectName(device, images[i], "Swapchain Image {}", i); } } } diff --git a/src/video_core/renderer_vulkan/vk_texture_runtime.cpp b/src/video_core/renderer_vulkan/vk_texture_runtime.cpp index 4ba7e6052..218eb1ce5 100644 --- a/src/video_core/renderer_vulkan/vk_texture_runtime.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_runtime.cpp @@ -206,9 +206,9 @@ Handle MakeHandle(const Instance* instance, u32 width, u32 height, u32 levels, T vk::UniqueImageView image_view = instance->GetDevice().createImageViewUnique(view_info); if (!debug_name.empty() && instance->HasDebuggingToolAttached()) { - Vulkan::SetObjectName(instance->GetDevice(), image, debug_name); - Vulkan::SetObjectName(instance->GetDevice(), image_view.get(), "{} View({})", debug_name, - vk::to_string(aspect)); + SetObjectName(instance->GetDevice(), image, debug_name); + SetObjectName(instance->GetDevice(), image_view.get(), "{} View({})", debug_name, + vk::to_string(aspect)); } return Handle{ @@ -1090,7 +1090,7 @@ void Surface::ScaleUp(u32 new_scale) { vk::PipelineStageFlagBits::eTopOfPipe, vk::DependencyFlagBits::eByRegion, {}, {}, barriers); }); - LOG_INFO(HW_GPU, "Surface scale up!"); + for (u32 level = 0; level < levels; level++) { const VideoCore::TextureBlit blit = { .src_level = level,