Revise readonly depth/stencil compability between pass and bundle

Bug: dawn:485
Change-Id: I4082d2c255ce24440f0d6a34b5cb6fe6cb2e9c63
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/68462
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
This commit is contained in:
Yunchao He 2021-11-10 02:06:05 +00:00 committed by Dawn LUCI CQ
parent 4d51b47721
commit 0994bbeee6
2 changed files with 5 additions and 5 deletions

View File

@ -248,13 +248,13 @@ namespace dawn_native {
bool depthReadOnlyInBundle = renderBundles[i]->IsDepthReadOnly();
DAWN_INVALID_IF(
depthReadOnlyInPass != depthReadOnlyInBundle,
depthReadOnlyInPass && !depthReadOnlyInBundle,
"DepthReadOnly (%u) of renderBundle[%i] (%s) is not compatible "
"with DepthReadOnly (%u) of %s.",
depthReadOnlyInBundle, i, renderBundles[i], depthReadOnlyInPass, this);
bool stencilReadOnlyInBundle = renderBundles[i]->IsStencilReadOnly();
DAWN_INVALID_IF(stencilReadOnlyInPass != stencilReadOnlyInBundle,
DAWN_INVALID_IF(stencilReadOnlyInPass && !stencilReadOnlyInBundle,
"StencilReadOnly (%u) of renderBundle[%i] (%s) is not "
"compatible with StencilReadOnly (%u) of %s.",
stencilReadOnlyInBundle, i, renderBundles[i],

View File

@ -163,10 +163,10 @@ namespace {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&passDescriptor);
pass.ExecuteBundles(1, &bundle);
pass.EndPass();
if (depthStencilReadOnlyInPass != depthStencilReadOnlyInBundle) {
ASSERT_DEVICE_ERROR(encoder.Finish());
} else {
if (!depthStencilReadOnlyInPass || depthStencilReadOnlyInBundle) {
encoder.Finish();
} else {
ASSERT_DEVICE_ERROR(encoder.Finish());
}
}
}