From 37e6c044d7af7367ed18a126aa912f09f84cbd14 Mon Sep 17 00:00:00 2001 From: assiduous Date: Tue, 5 May 2020 14:29:22 -0700 Subject: VK backend: improved debug string for render pass objects --- Graphics/GraphicsEngineVulkan/src/RenderPassCache.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'Graphics/GraphicsEngineVulkan') diff --git a/Graphics/GraphicsEngineVulkan/src/RenderPassCache.cpp b/Graphics/GraphicsEngineVulkan/src/RenderPassCache.cpp index 7c7c404d..c352c2a9 100644 --- a/Graphics/GraphicsEngineVulkan/src/RenderPassCache.cpp +++ b/Graphics/GraphicsEngineVulkan/src/RenderPassCache.cpp @@ -59,10 +59,16 @@ VkRenderPass RenderPassCache::GetRenderPass(const RenderPassCacheKey& Key) PipelineStateVkImpl::GetRenderPassCreateInfo(Key.NumRenderTargets, Key.RTVFormats, Key.DSVFormat, Key.SampleCount, Attachments, AttachmentReferences, Subpass); std::stringstream PassNameSS; - PassNameSS << "Render pass: rt count: " << Key.NumRenderTargets << "; sample count: " << Key.SampleCount - << "; DSV Format: " << GetTextureFormatAttribs(Key.DSVFormat).Name << "; RTV Formats: "; - for (Uint32 rt = 0; rt < Key.NumRenderTargets; ++rt) - PassNameSS << (rt > 0 ? ", " : "") << GetTextureFormatAttribs(Key.RTVFormats[rt]).Name; + PassNameSS << "Render pass: RT count: " << Uint32{Key.NumRenderTargets} << "; sample count: " << Uint32{Key.SampleCount} + << "; DSV Format: " << GetTextureFormatAttribs(Key.DSVFormat).Name; + if (Key.NumRenderTargets > 0) + { + PassNameSS << (Key.NumRenderTargets > 1 ? "; RTV Formats: " : "; RTV Format: "); + for (Uint32 rt = 0; rt < Key.NumRenderTargets; ++rt) + { + PassNameSS << (rt > 0 ? ", " : "") << GetTextureFormatAttribs(Key.RTVFormats[rt]).Name; + } + } auto RenderPass = m_DeviceVkImpl.GetLogicalDevice().CreateRenderPass(RenderPassCI, PassNameSS.str().c_str()); VERIFY_EXPR(RenderPass != VK_NULL_HANDLE); it = m_Cache.emplace(Key, std::move(RenderPass)).first; -- cgit v1.2.3