From 996bfb53528aeaaba532413bf1848a0ebc3b03f0 Mon Sep 17 00:00:00 2001 From: assiduous Date: Fri, 13 Dec 2019 10:03:15 -0800 Subject: Unit tests: capturing debug output; fixed minor issue with viewport in Vk backend. --- Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp | 3 +++ Graphics/GraphicsEngineVulkan/src/EngineFactoryVk.cpp | 6 ++++++ 2 files changed, 9 insertions(+) (limited to 'Graphics/GraphicsEngineVulkan') diff --git a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp index 86a4bce1..135b5844 100644 --- a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp @@ -994,6 +994,9 @@ void DeviceContextVkImpl::SetIndexBuffer(IBuffer* pIndexBuffer, Uint32 ByteOffse void DeviceContextVkImpl::CommitViewports() { + if (m_NumViewports == 0) + return; + VkViewport VkViewports[MaxViewports]; // Do not waste time initializing array to zero for (Uint32 vp = 0; vp < m_NumViewports; ++vp) { diff --git a/Graphics/GraphicsEngineVulkan/src/EngineFactoryVk.cpp b/Graphics/GraphicsEngineVulkan/src/EngineFactoryVk.cpp index 0debf7eb..18be491e 100644 --- a/Graphics/GraphicsEngineVulkan/src/EngineFactoryVk.cpp +++ b/Graphics/GraphicsEngineVulkan/src/EngineFactoryVk.cpp @@ -87,6 +87,9 @@ void EngineFactoryVkImpl::CreateDeviceAndContextsVk(const EngineVkCreateInfo& _E IRenderDevice** ppDevice, IDeviceContext** ppContexts) { + if (_EngineCI.DebugMessageCallback != nullptr) + SetDebugMessageCallback(_EngineCI.DebugMessageCallback); + if (_EngineCI.APIVersion != DILIGENT_API_VERSION) LOG_ERROR_AND_THROW("Diligent Engine runtime (", _EngineCI.APIVersion, ") is not compatible with the client API version (", DILIGENT_API_VERSION, ")"); @@ -245,6 +248,9 @@ void EngineFactoryVkImpl::AttachToVulkanDevice(std::shared_ptr