Add more validation tests for readonly depth/stencil attachment
If the texture attachment doesn't have a stencil aspect, we can set stencilReadOnly flag in RenderPassDepthStencilAttachment as we want. And it is totally ignored and it doesn't impact whether the depth/stencil attachment is readonly or not. That's true for depthReadOnly flag upon a stecil-only format like stencil8, but we haven't support stencil8 yet. Bug: dawn:485 Change-Id: If0a21250ce7cc7a1ad9cc17a05ecf64d05342cd0 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67962 Commit-Queue: Kai Ninomiya <kainino@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
parent
ff9a1f7b20
commit
05946d01e3
|
@ -831,6 +831,34 @@ namespace {
|
|||
AssertBeginRenderPassSuccess(&renderPass);
|
||||
}
|
||||
|
||||
// Tests that a pass with depthReadOnly=true and stencilReadOnly=true can pass
|
||||
// when there is only depth component in the format. We actually enable readonly
|
||||
// depth/stencil attachment in this case.
|
||||
{
|
||||
utils::ComboRenderPassDescriptor renderPass({colorView}, depthStencilViewNoStencil);
|
||||
renderPass.cDepthStencilAttachmentInfo.depthLoadOp = wgpu::LoadOp::Load;
|
||||
renderPass.cDepthStencilAttachmentInfo.depthStoreOp = wgpu::StoreOp::Store;
|
||||
renderPass.cDepthStencilAttachmentInfo.depthReadOnly = true;
|
||||
renderPass.cDepthStencilAttachmentInfo.stencilLoadOp = wgpu::LoadOp::Load;
|
||||
renderPass.cDepthStencilAttachmentInfo.stencilStoreOp = wgpu::StoreOp::Store;
|
||||
renderPass.cDepthStencilAttachmentInfo.stencilReadOnly = true;
|
||||
AssertBeginRenderPassSuccess(&renderPass);
|
||||
}
|
||||
|
||||
// Tests that a pass with depthReadOnly=false and stencilReadOnly=true can pass
|
||||
// when there is only depth component in the format. We actually don't enable readonly
|
||||
// depth/stencil attachment in this case.
|
||||
{
|
||||
utils::ComboRenderPassDescriptor renderPass({colorView}, depthStencilViewNoStencil);
|
||||
renderPass.cDepthStencilAttachmentInfo.depthLoadOp = wgpu::LoadOp::Load;
|
||||
renderPass.cDepthStencilAttachmentInfo.depthStoreOp = wgpu::StoreOp::Store;
|
||||
renderPass.cDepthStencilAttachmentInfo.depthReadOnly = false;
|
||||
renderPass.cDepthStencilAttachmentInfo.stencilLoadOp = wgpu::LoadOp::Load;
|
||||
renderPass.cDepthStencilAttachmentInfo.stencilStoreOp = wgpu::StoreOp::Store;
|
||||
renderPass.cDepthStencilAttachmentInfo.stencilReadOnly = true;
|
||||
AssertBeginRenderPassSuccess(&renderPass);
|
||||
}
|
||||
|
||||
// TODO(https://crbug.com/dawn/666): Add a test case for stencil-only once stencil8 is
|
||||
// supported (depthReadOnly and stencilReadOnly mismatch but no depth component).
|
||||
|
||||
|
|
Loading…
Reference in New Issue