diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2020-08-04 02:14:25 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2020-08-04 02:14:25 +0000 |
| commit | 5dba447dab6f8021631ad6628b2754727c52d284 (patch) | |
| tree | 8a6008f358dddecf505e4ec7e424122bca76de1a /Graphics/GraphicsEngineVulkan | |
| parent | Reworked DrawCommandReferenceVk to prepare for render pass tests (diff) | |
| download | DiligentCore-5dba447dab6f8021631ad6628b2754727c52d284.tar.gz DiligentCore-5dba447dab6f8021631ad6628b2754727c52d284.zip | |
Added render pass test, fixed default viewport setting issue when beginning the render pass
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
| -rw-r--r-- | Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp | 3 | ||||
| -rw-r--r-- | Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp | 8 |
2 files changed, 8 insertions, 3 deletions
diff --git a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp index 3214c30f..6a5d5ced 100644 --- a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp @@ -1300,6 +1300,9 @@ void DeviceContextVkImpl::BeginRenderPass(const BeginRenderPassAttribs& Attribs) EnsureVkCmdBuffer(); m_CommandBuffer.BeginRenderPass(m_vkRenderPass, m_vkFramebuffer, m_FramebufferWidth, m_FramebufferHeight, Attribs.ClearValueCount, pVkClearValues); + + // Set the viewport to match the framebuffer size + SetViewports(1, nullptr, 0, 0); } void DeviceContextVkImpl::NextSubpass() diff --git a/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp index 73485070..a4f61fd1 100644 --- a/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/PipelineStateVkImpl.cpp @@ -394,13 +394,15 @@ PipelineStateVkImpl::PipelineStateVkImpl(IReferenceCounters* pRefCoun DepthStencilStateDesc_To_VkDepthStencilStateCI(GraphicsPipeline.DepthStencilDesc); PipelineCI.pDepthStencilState = &DepthStencilStateCI; - std::vector<VkPipelineColorBlendAttachmentState> ColorBlendAttachmentStates(m_Desc.GraphicsPipeline.NumRenderTargets); + const auto& RPDesc = m_pRenderPass->GetDesc(); + VERIFY_EXPR(GraphicsPipeline.pRenderPass != nullptr || GraphicsPipeline.NumRenderTargets == RPDesc.AttachmentCount); + std::vector<VkPipelineColorBlendAttachmentState> ColorBlendAttachmentStates(RPDesc.AttachmentCount); VkPipelineColorBlendStateCreateInfo BlendStateCI = {}; BlendStateCI.pAttachments = !ColorBlendAttachmentStates.empty() ? ColorBlendAttachmentStates.data() : nullptr; - BlendStateCI.attachmentCount = m_Desc.GraphicsPipeline.NumRenderTargets; // must equal the colorAttachmentCount for the subpass - // in which this pipeline is used. + BlendStateCI.attachmentCount = RPDesc.AttachmentCount; // must equal the colorAttachmentCount for the subpass + // in which this pipeline is used. BlendStateDesc_To_VkBlendStateCI(GraphicsPipeline.BlendDesc, BlendStateCI, ColorBlendAttachmentStates); PipelineCI.pColorBlendState = &BlendStateCI; |
