mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-08 04:08:32 +09:00
[Chore] (MG_Backend/DirectVulkan): improve some wording
This commit is contained in:
@@ -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];
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user