mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-11 05:38:31 +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) {
|
void FrameContext::SetCurrentCommandBuffer(VkCommandBuffer value) {
|
||||||
SetCurrentHasCommandBufferRecorded(false);
|
SetCurrentCommandBufferRecorded(false);
|
||||||
GetCommandBuffer(GetCurrentFrameIndex()) = value;
|
GetCommandBuffer(GetCurrentFrameIndex()) = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,7 +114,7 @@ namespace MobileGL::MG_Backend::DirectVulkan {
|
|||||||
GetImageInFlightFence(GetCurrentFrameIndex()) = value;
|
GetImageInFlightFence(GetCurrentFrameIndex()) = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FrameContext::SetCurrentHasCommandBufferRecorded(Bool value) {
|
void FrameContext::SetCurrentCommandBufferRecorded(Bool value) {
|
||||||
SetHasCommandBufferRecorded(GetCurrentFrameIndex(), value);
|
SetHasCommandBufferRecorded(GetCurrentFrameIndex(), value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,8 +134,8 @@ namespace MobileGL::MG_Backend::DirectVulkan {
|
|||||||
return GetImageInFlightFence(GetCurrentFrameIndex());
|
return GetImageInFlightFence(GetCurrentFrameIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
Bool FrameContext::GetCurrentHasCommandBufferRecorded() const {
|
Bool FrameContext::HasCurrentCommandBufferRecorded() const {
|
||||||
return GetHasCommandBufferRecorded(GetCurrentFrameIndex());
|
return HasCommandBufferRecorded(GetCurrentFrameIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
const VkCommandBuffer& FrameContext::GetCommandBuffer(Uint32 frameIndex) const {
|
const VkCommandBuffer& FrameContext::GetCommandBuffer(Uint32 frameIndex) const {
|
||||||
@@ -158,7 +158,7 @@ namespace MobileGL::MG_Backend::DirectVulkan {
|
|||||||
return imageInFlightFences[frameIndex];
|
return imageInFlightFences[frameIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
Bool FrameContext::GetHasCommandBufferRecorded(Uint32 frameIndex) const {
|
Bool FrameContext::HasCommandBufferRecorded(Uint32 frameIndex) const {
|
||||||
AssertValidFrameIndex(frameIndex);
|
AssertValidFrameIndex(frameIndex);
|
||||||
return hasCommandBufferRecorded[frameIndex];
|
return hasCommandBufferRecorded[frameIndex];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,19 +31,19 @@ namespace MobileGL::MG_Backend::DirectVulkan {
|
|||||||
void SetCurrentImageAvailableSemaphore(VkSemaphore value);
|
void SetCurrentImageAvailableSemaphore(VkSemaphore value);
|
||||||
void SetCurrentRenderFinishedSemaphore(VkSemaphore value);
|
void SetCurrentRenderFinishedSemaphore(VkSemaphore value);
|
||||||
void SetCurrentImageInFlightFence(VkFence value);
|
void SetCurrentImageInFlightFence(VkFence value);
|
||||||
void SetCurrentHasCommandBufferRecorded(Bool value);
|
void SetCurrentCommandBufferRecorded(Bool value);
|
||||||
|
|
||||||
VkCommandBuffer& GetCurrentCommandBuffer();
|
VkCommandBuffer& GetCurrentCommandBuffer();
|
||||||
VkSemaphore& GetCurrentImageAvailableSemaphore();
|
VkSemaphore& GetCurrentImageAvailableSemaphore();
|
||||||
VkSemaphore& GetCurrentRenderFinishedSemaphore();
|
VkSemaphore& GetCurrentRenderFinishedSemaphore();
|
||||||
VkFence& GetCurrentImageInFlightFence();
|
VkFence& GetCurrentImageInFlightFence();
|
||||||
Bool GetCurrentHasCommandBufferRecorded() const;
|
Bool HasCurrentCommandBufferRecorded() const;
|
||||||
|
|
||||||
const VkCommandBuffer& GetCommandBuffer(Uint32 frameIndex) const;
|
const VkCommandBuffer& GetCommandBuffer(Uint32 frameIndex) const;
|
||||||
const VkSemaphore& GetImageAvailableSemaphore(Uint32 frameIndex) const;
|
const VkSemaphore& GetImageAvailableSemaphore(Uint32 frameIndex) const;
|
||||||
const VkSemaphore& GetRenderFinishedSemaphore(Uint32 frameIndex) const;
|
const VkSemaphore& GetRenderFinishedSemaphore(Uint32 frameIndex) const;
|
||||||
const VkFence& GetImageInFlightFence(Uint32 frameIndex) const;
|
const VkFence& GetImageInFlightFence(Uint32 frameIndex) const;
|
||||||
Bool GetHasCommandBufferRecorded(Uint32 frameIndex) const;
|
Bool HasCommandBufferRecorded(Uint32 frameIndex) const;
|
||||||
const VkCommandBuffer& GetCurrentCommandBuffer() const;
|
const VkCommandBuffer& GetCurrentCommandBuffer() const;
|
||||||
const VkSemaphore& GetCurrentImageAvailableSemaphore() const;
|
const VkSemaphore& GetCurrentImageAvailableSemaphore() const;
|
||||||
const VkSemaphore& GetCurrentRenderFinishedSemaphore() const;
|
const VkSemaphore& GetCurrentRenderFinishedSemaphore() const;
|
||||||
|
|||||||
@@ -328,14 +328,14 @@ namespace MobileGL::MG_Backend::DirectVulkan {
|
|||||||
|
|
||||||
// End command buffer
|
// End command buffer
|
||||||
VK_VERIFY(vkEndCommandBuffer(commandBuffer));
|
VK_VERIFY(vkEndCommandBuffer(commandBuffer));
|
||||||
m_frameContext.SetCurrentHasCommandBufferRecorded(true);
|
m_frameContext.SetCurrentCommandBufferRecorded(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VulkanRenderer::Present() {
|
void VulkanRenderer::Present() {
|
||||||
MOBILEGL_ASSERT(m_imageIndexAcquired < m_swapchainObject.GetImageCount(),
|
MOBILEGL_ASSERT(m_imageIndexAcquired < m_swapchainObject.GetImageCount(),
|
||||||
"Present, acquired image index out of range");
|
"Present, acquired image index out of range");
|
||||||
VkCommandBuffer& commandBuffer = m_frameContext.GetCurrentCommandBuffer();
|
VkCommandBuffer& commandBuffer = m_frameContext.GetCurrentCommandBuffer();
|
||||||
const Bool hasRecordedWork = m_frameContext.GetCurrentHasCommandBufferRecorded();
|
const Bool hasRecordedWork = m_frameContext.HasCurrentCommandBufferRecorded();
|
||||||
Bool needsLayoutTransitionForPresent = false;
|
Bool needsLayoutTransitionForPresent = false;
|
||||||
|
|
||||||
if (!hasRecordedWork) {
|
if (!hasRecordedWork) {
|
||||||
@@ -391,7 +391,7 @@ namespace MobileGL::MG_Backend::DirectVulkan {
|
|||||||
submitInfo.signalSemaphoreCount = 1;
|
submitInfo.signalSemaphoreCount = 1;
|
||||||
submitInfo.pSignalSemaphores = signalSemaphores;
|
submitInfo.pSignalSemaphores = signalSemaphores;
|
||||||
VK_VERIFY(vkQueueSubmit(m_graphicsQueue, 1, &submitInfo, m_frameContext.GetCurrentImageInFlightFence()));
|
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);
|
m_swapchainObject.SetImageLayout(m_imageIndexAcquired, VK_IMAGE_LAYOUT_PRESENT_SRC_KHR);
|
||||||
|
|
||||||
// 2) Present current frame.
|
// 2) Present current frame.
|
||||||
|
|||||||
Reference in New Issue
Block a user