From fa10201d69a8df3f5c385991439474ddeeb52c69 Mon Sep 17 00:00:00 2001 From: Lynix Date: Tue, 28 Nov 2023 15:21:56 +0100 Subject: [PATCH 1/2] Fix clear values --- src/NazaraImgui/NazaraImgui.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/NazaraImgui/NazaraImgui.cpp b/src/NazaraImgui/NazaraImgui.cpp index 6280fa7..e859912 100644 --- a/src/NazaraImgui/NazaraImgui.cpp +++ b/src/NazaraImgui/NazaraImgui.cpp @@ -289,8 +289,13 @@ namespace Nz int fb_height = static_cast(io.DisplaySize.y * io.DisplayFramebufferScale.y); Nz::Recti renderRect(0, 0, fb_width, fb_height); + Nz::CommandBufferBuilder::ClearValues clearValues[2] = { + { .color = Nz::Color::Black() }, + { .depth = 1.f } + }; + builder.BeginDebugRegion("ImGui", Nz::Color::Green()); - builder.BeginRenderPass(renderTarget->GetFramebuffer(frame.GetImageIndex()), renderTarget->GetRenderPass(), renderRect); + builder.BeginRenderPass(renderTarget->GetFramebuffer(frame.GetImageIndex()), renderTarget->GetRenderPass(), renderRect, clearValues, 2); m_imguiDrawer.Draw(builder); builder.EndRenderPass(); builder.EndDebugRegion(); From 120ba7dcd7781642882d87190dc88e1891788d9d Mon Sep 17 00:00:00 2001 From: Lynix Date: Tue, 28 Nov 2023 15:22:10 +0100 Subject: [PATCH 2/2] Fix font texture mipmaps and setup a debug name --- src/NazaraImgui/NazaraImgui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/NazaraImgui/NazaraImgui.cpp b/src/NazaraImgui/NazaraImgui.cpp index e859912..c3c5201 100644 --- a/src/NazaraImgui/NazaraImgui.cpp +++ b/src/NazaraImgui/NazaraImgui.cpp @@ -360,8 +360,8 @@ namespace Nz texParams.height = height; texParams.pixelFormat = Nz::PixelFormat::RGBA8; texParams.type = Nz::ImageType::E2D; - m_fontTexture = renderDevice->InstantiateTexture(texParams); - m_fontTexture->Update(pixels, width, height); + m_fontTexture = renderDevice->InstantiateTexture(texParams, pixels, true); + m_fontTexture->UpdateDebugName("FontTexture"); ImTextureID textureID = m_fontTexture.get(); io.Fonts->TexID = textureID;