Suppressing debug text rendering until debug font texture has been streamed to the GPU. Fixes Vulkan validation errors on MacOS.

Fix Vulkan validation error on macOS when clearing with the black frame pass render pass during initialization.
This commit is contained in:
2024-01-14 15:53:50 -08:00
parent e6706a4e1f
commit 8795e1e402
2 changed files with 20 additions and 18 deletions

View File

@@ -781,6 +781,7 @@ void KRCamera::renderDebug(VkCommandBuffer& commandBuffer, KRSurface& surface)
KRTexture* fontTexture = m_pContext->getTextureManager()->getTexture("font");
fontTexture->resetPoolExpiry(0.0f, KRTexture::TEXTURE_USAGE_UI);
if (fontTexture->getStreamLevel(KRTexture::TEXTURE_USAGE_UI) != kraken_stream_level::STREAM_LEVEL_OUT) {
PipelineInfo info{};
std::string shader_name("debug_font");
@@ -798,6 +799,7 @@ void KRCamera::renderDebug(VkCommandBuffer& commandBuffer, KRSurface& surface)
m_debug_text_vbo_data.bind(commandBuffer);
vkCmdDraw(commandBuffer, vertex_count, 1, 0, 0);
}
debugPass.end(commandBuffer);

View File

@@ -236,7 +236,7 @@ KrResult KRSurface::createSwapChain()
info.clearColor = true;
info.keepColor = true;
info.clearDepth = false;
info.clearDepth = true;
info.keepDepth = false;
info.finalPass = true;
m_blackFramePass->create(*device, selectedSurfaceFormat.format, depthImageFormat, info);