diff --git a/src/backend/Pipeline.cpp b/src/backend/Pipeline.cpp index 67c1c19a1f..177a2ba50f 100644 --- a/src/backend/Pipeline.cpp +++ b/src/backend/Pipeline.cpp @@ -32,6 +32,8 @@ namespace backend { ->GetDevice() ->CreatePipelineLayoutBuilder() ->GetResult(); + // Remove the external ref objects are created with + mLayout->Release(); } auto FillPushConstants = [](const ShaderModuleBase* module, PushConstantInfo* info) { diff --git a/src/backend/RenderPipeline.cpp b/src/backend/RenderPipeline.cpp index a0aecca4ee..dd7d06ca3d 100644 --- a/src/backend/RenderPipeline.cpp +++ b/src/backend/RenderPipeline.cpp @@ -89,9 +89,13 @@ namespace backend { // the device if (!mInputState) { mInputState = mDevice->CreateInputStateBuilder()->GetResult(); + // Remove the external ref objects are created with + mInputState->Release(); } if (!mDepthStencilState) { mDepthStencilState = mDevice->CreateDepthStencilStateBuilder()->GetResult(); + // Remove the external ref objects are created with + mDepthStencilState->Release(); } if (!mRenderPass) { HandleError("Pipeline render pass not set"); @@ -109,6 +113,8 @@ namespace backend { for (uint32_t attachmentSlot : IterateBitSet(subpassInfo.colorAttachmentsSet & ~mBlendStatesSet)) { mBlendStates[attachmentSlot] = mDevice->CreateBlendStateBuilder()->GetResult(); + // Remove the external ref objects are created with + mBlendStates[attachmentSlot]->Release(); } return mDevice->CreateRenderPipeline(this);