Skip to content
Permalink
Browse files

- fix model chasecam crash

  • Loading branch information...
dpjudas authored and madame-rachelle committed May 12, 2019
1 parent 0cb5ea1 commit 2c804499d984270ba58060e59a7a2dc051e65cde
Showing with 6 additions and 3 deletions.
  1. +5 −0 src/rendering/vulkan/renderer/vk_renderstate.cpp
  2. +1 −3 src/rendering/vulkan/system/vk_builders.h
@@ -248,6 +248,11 @@ void VkRenderState::ApplyRenderPass(int dt)
if (changingRenderPass)
{
passKey.ClearTargets = mClearTargets;

// Only clear depth+stencil if the render target actually has that
if (!mRenderTarget.DepthStencil)
passKey.ClearTargets &= ~(CT_Depth | CT_Stencil);

BeginRenderPass(passKey, mCommandBuffer);
mRenderPassKey = passKey;
mClearTargets = 0;
@@ -766,7 +766,7 @@ inline GraphicsPipelineBuilder::GraphicsPipelineBuilder()
pipelineInfo.pViewportState = &viewportState;
pipelineInfo.pRasterizationState = &rasterizer;
pipelineInfo.pMultisampleState = &multisampling;
pipelineInfo.pDepthStencilState = nullptr;
pipelineInfo.pDepthStencilState = &depthStencil;
pipelineInfo.pColorBlendState = &colorBlending;
pipelineInfo.pDynamicState = &dynamicState;
pipelineInfo.subpass = 0;
@@ -896,8 +896,6 @@ inline void GraphicsPipelineBuilder::setDepthStencilEnable(bool test, bool write
depthStencil.depthTestEnable = test ? VK_TRUE : VK_FALSE;
depthStencil.depthWriteEnable = write ? VK_TRUE : VK_FALSE;
depthStencil.stencilTestEnable = stencil ? VK_TRUE : VK_FALSE;

pipelineInfo.pDepthStencilState = (test || write || stencil) ? &depthStencil : nullptr;
}

inline void GraphicsPipelineBuilder::setStencil(VkStencilOp failOp, VkStencilOp passOp, VkStencilOp depthFailOp, VkCompareOp compareOp, uint32_t compareMask, uint32_t writeMask, uint32_t reference)

0 comments on commit 2c80449

Please sign in to comment.
You can’t perform that action at this time.