Skip to content

Commit

Permalink
[D3D11] Revised fix in D3D11RenderPass.
Browse files Browse the repository at this point in the history
Check depth/stencil format instead of load operation.
This allows to specify valid read-only flags that depend
on the depth-stencil attachment's format without requiring a load operation.
  • Loading branch information
LukasBanana committed Nov 6, 2024
1 parent cf877ae commit c6abc10
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sources/Renderer/Direct3D11/RenderState/D3D11RenderPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ D3D11RenderPass::D3D11RenderPass(const RenderPassDescriptor& desc)
clearFlagsDSV_ |= D3D11_CLEAR_STENCIL;

/* If we don't care about storing depth/stencil values, append flag to only read those values */
if (desc.depthAttachment.storeOp == AttachmentStoreOp::Undefined && desc.depthAttachment.loadOp == AttachmentLoadOp::Load)
if (desc.depthAttachment.storeOp == AttachmentStoreOp::Undefined && IsDepthFormat(desc.depthAttachment.format))
attachmentFlagsDSV_ |= D3D11_DSV_READ_ONLY_DEPTH;
if (desc.stencilAttachment.storeOp == AttachmentStoreOp::Undefined && desc.stencilAttachment.loadOp == AttachmentLoadOp::Load)
if (desc.stencilAttachment.storeOp == AttachmentStoreOp::Undefined && IsStencilFormat(desc.stencilAttachment.format))
attachmentFlagsDSV_ |= D3D11_DSV_READ_ONLY_STENCIL;
}

Expand Down

0 comments on commit c6abc10

Please sign in to comment.