From a5f7f7836865e02c265704b6b4abf7ab1916962d Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Thu, 5 Jul 2018 12:18:53 -0700 Subject: Added shader compiler error reporting in Vulkan --- Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp | 2 +- Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp | 13 ++----------- .../src/VulkanUtilities/VulkanDebug.cpp | 7 ++++--- 3 files changed, 7 insertions(+), 15 deletions(-) (limited to 'Graphics/GraphicsEngineVulkan') diff --git a/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp index 264f695c..83d1f7d2 100644 --- a/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp @@ -44,7 +44,7 @@ ShaderVkImpl::ShaderVkImpl(IReferenceCounters* pRefCounters, RenderDeviceVkImpl* m_StaticVarsMgr(*this) { auto GLSLSource = BuildGLSLSourceString(CreationAttribs, TargetGLSLCompiler::glslang, "#define TARGET_API_VULKAN 1\n"); - m_SPIRV = GLSLtoSPIRV(m_Desc.ShaderType, GLSLSource.c_str()); + m_SPIRV = GLSLtoSPIRV(m_Desc.ShaderType, GLSLSource.c_str(), CreationAttribs.ppCompilerOutput); if(m_SPIRV.empty()) { LOG_ERROR_AND_THROW("Failed to compile shader"); diff --git a/Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp index 23da8e2d..0187c5a2 100644 --- a/Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp @@ -447,23 +447,14 @@ void SwapChainVkImpl::Present(Uint32 SyncInterval) PresentInfo.pImageIndices = &m_BackBufferIndex; VkResult Result = VK_SUCCESS; PresentInfo.pResults = &Result; - VERIFY(Result == VK_SUCCESS, "Present failed"); - + auto *pDeviceVk = m_pRenderDevice.RawPtr(); auto vkCmdQueue = pDeviceVk->GetCmdQueue()->GetVkQueue(); vkQueuePresentKHR(vkCmdQueue, &PresentInfo); + VERIFY(Result == VK_SUCCESS, "Present failed"); pDeviceVk->FinishFrame(); -#if 0 -#if PLATFORM_UNIVERSAL_WINDOWS - // A successful Present call for DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL SwapChains unbinds - // backbuffer 0 from all GPU writeable bind points. - // We need to rebind all render targets to make sure that - // the back buffer is not unbound - pImmediateCtxVk->CommitRenderTargets(); -#endif -#endif ++m_SemaphoreIndex; if (m_SemaphoreIndex >= m_SwapChainDesc.BufferCount) m_SemaphoreIndex = 0; diff --git a/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanDebug.cpp b/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanDebug.cpp index 3c9fe3b3..8090a410 100644 --- a/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanDebug.cpp +++ b/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanDebug.cpp @@ -31,9 +31,10 @@ namespace VulkanUtilities { std::stringstream debugMessage; - // Ignore warning about using RenderPass LOAD_OP_CLEAR: - // vkCmdClearAttachments() issued on command buffer object 0x... prior to any Draw Cmds. It is recommended you use RenderPass LOAD_OP_CLEAR on Attachments prior to any Draw. - if ( (flags & VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT) && msgCode == 64) + // Ignore the following warnings: + // 26: Vertex buffers are bound to command buffer (0x...) but no vertex buffers are attached to this Pipeline State Object + // 64: vkCmdClearAttachments() issued on command buffer object 0x... prior to any Draw Cmds. It is recommended you use RenderPass LOAD_OP_CLEAR on Attachments prior to any Draw. + if ( (flags & VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT) && (msgCode == 64 || msgCode == 26) ) return VK_FALSE; debugMessage << "Vulkan debug message"; -- cgit v1.2.3