From e1b59bcb4614f1ece77bebbd6098d6d4f765820c Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Mon, 16 Feb 2026 12:08:12 +0800 Subject: [PATCH] [Chore] (MG_Backend/DirectVulkan): improve some wording --- .../MG_Backend/DirectVulkan/Renderer/FrameContext.cpp | 10 +++++----- .../MG_Backend/DirectVulkan/Renderer/FrameContext.h | 6 +++--- .../DirectVulkan/Renderer/VulkanRenderer.cpp | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/MobileGL/MG_Backend/DirectVulkan/Renderer/FrameContext.cpp b/MobileGL/MG_Backend/DirectVulkan/Renderer/FrameContext.cpp index 212f5f1f..13e8e9b1 100644 --- a/MobileGL/MG_Backend/DirectVulkan/Renderer/FrameContext.cpp +++ b/MobileGL/MG_Backend/DirectVulkan/Renderer/FrameContext.cpp @@ -98,7 +98,7 @@ namespace MobileGL::MG_Backend::DirectVulkan { } void FrameContext::SetCurrentCommandBuffer(VkCommandBuffer value) { - SetCurrentHasCommandBufferRecorded(false); + SetCurrentCommandBufferRecorded(false); GetCommandBuffer(GetCurrentFrameIndex()) = value; } @@ -114,7 +114,7 @@ namespace MobileGL::MG_Backend::DirectVulkan { GetImageInFlightFence(GetCurrentFrameIndex()) = value; } - void FrameContext::SetCurrentHasCommandBufferRecorded(Bool value) { + void FrameContext::SetCurrentCommandBufferRecorded(Bool value) { SetHasCommandBufferRecorded(GetCurrentFrameIndex(), value); } @@ -134,8 +134,8 @@ namespace MobileGL::MG_Backend::DirectVulkan { return GetImageInFlightFence(GetCurrentFrameIndex()); } - Bool FrameContext::GetCurrentHasCommandBufferRecorded() const { - return GetHasCommandBufferRecorded(GetCurrentFrameIndex()); + Bool FrameContext::HasCurrentCommandBufferRecorded() const { + return HasCommandBufferRecorded(GetCurrentFrameIndex()); } const VkCommandBuffer& FrameContext::GetCommandBuffer(Uint32 frameIndex) const { @@ -158,7 +158,7 @@ namespace MobileGL::MG_Backend::DirectVulkan { return imageInFlightFences[frameIndex]; } - Bool FrameContext::GetHasCommandBufferRecorded(Uint32 frameIndex) const { + Bool FrameContext::HasCommandBufferRecorded(Uint32 frameIndex) const { AssertValidFrameIndex(frameIndex); return hasCommandBufferRecorded[frameIndex]; } diff --git a/MobileGL/MG_Backend/DirectVulkan/Renderer/FrameContext.h b/MobileGL/MG_Backend/DirectVulkan/Renderer/FrameContext.h index 51567e36..feba93b7 100644 --- a/MobileGL/MG_Backend/DirectVulkan/Renderer/FrameContext.h +++ b/MobileGL/MG_Backend/DirectVulkan/Renderer/FrameContext.h @@ -31,19 +31,19 @@ namespace MobileGL::MG_Backend::DirectVulkan { void SetCurrentImageAvailableSemaphore(VkSemaphore value); void SetCurrentRenderFinishedSemaphore(VkSemaphore value); void SetCurrentImageInFlightFence(VkFence value); - void SetCurrentHasCommandBufferRecorded(Bool value); + void SetCurrentCommandBufferRecorded(Bool value); VkCommandBuffer& GetCurrentCommandBuffer(); VkSemaphore& GetCurrentImageAvailableSemaphore(); VkSemaphore& GetCurrentRenderFinishedSemaphore(); VkFence& GetCurrentImageInFlightFence(); - Bool GetCurrentHasCommandBufferRecorded() const; + Bool HasCurrentCommandBufferRecorded() const; const VkCommandBuffer& GetCommandBuffer(Uint32 frameIndex) const; const VkSemaphore& GetImageAvailableSemaphore(Uint32 frameIndex) const; const VkSemaphore& GetRenderFinishedSemaphore(Uint32 frameIndex) const; const VkFence& GetImageInFlightFence(Uint32 frameIndex) const; - Bool GetHasCommandBufferRecorded(Uint32 frameIndex) const; + Bool HasCommandBufferRecorded(Uint32 frameIndex) const; const VkCommandBuffer& GetCurrentCommandBuffer() const; const VkSemaphore& GetCurrentImageAvailableSemaphore() const; const VkSemaphore& GetCurrentRenderFinishedSemaphore() const; diff --git a/MobileGL/MG_Backend/DirectVulkan/Renderer/VulkanRenderer.cpp b/MobileGL/MG_Backend/DirectVulkan/Renderer/VulkanRenderer.cpp index 8ee02fb7..d3060fae 100644 --- a/MobileGL/MG_Backend/DirectVulkan/Renderer/VulkanRenderer.cpp +++ b/MobileGL/MG_Backend/DirectVulkan/Renderer/VulkanRenderer.cpp @@ -328,14 +328,14 @@ namespace MobileGL::MG_Backend::DirectVulkan { // End command buffer VK_VERIFY(vkEndCommandBuffer(commandBuffer)); - m_frameContext.SetCurrentHasCommandBufferRecorded(true); + m_frameContext.SetCurrentCommandBufferRecorded(true); } void VulkanRenderer::Present() { MOBILEGL_ASSERT(m_imageIndexAcquired < m_swapchainObject.GetImageCount(), "Present, acquired image index out of range"); VkCommandBuffer& commandBuffer = m_frameContext.GetCurrentCommandBuffer(); - const Bool hasRecordedWork = m_frameContext.GetCurrentHasCommandBufferRecorded(); + const Bool hasRecordedWork = m_frameContext.HasCurrentCommandBufferRecorded(); Bool needsLayoutTransitionForPresent = false; if (!hasRecordedWork) { @@ -391,7 +391,7 @@ namespace MobileGL::MG_Backend::DirectVulkan { submitInfo.signalSemaphoreCount = 1; submitInfo.pSignalSemaphores = signalSemaphores; VK_VERIFY(vkQueueSubmit(m_graphicsQueue, 1, &submitInfo, m_frameContext.GetCurrentImageInFlightFence())); - m_frameContext.SetCurrentHasCommandBufferRecorded(false); + m_frameContext.SetCurrentCommandBufferRecorded(false); m_swapchainObject.SetImageLayout(m_imageIndexAcquired, VK_IMAGE_LAYOUT_PRESENT_SRC_KHR); // 2) Present current frame.