Add StoreOp::Clear
When storeOp is clear, texture subresource is set as not initialized
Bug: dawn:145
Change-Id: I364d7239a7ebdb9d5a28a4af559f3212be7ef15a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11560
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
diff --git a/src/dawn_native/CommandEncoder.cpp b/src/dawn_native/CommandEncoder.cpp
index 0c5208e..e0a9cd2 100644
--- a/src/dawn_native/CommandEncoder.cpp
+++ b/src/dawn_native/CommandEncoder.cpp
@@ -404,6 +404,12 @@
"depth stencil format");
}
+ // This validates that the depth storeOp and stencil storeOps are the same
+ if (depthStencilAttachment->depthStoreOp != depthStencilAttachment->stencilStoreOp) {
+ return DAWN_VALIDATION_ERROR(
+ "The depth storeOp and stencil storeOp are not the same");
+ }
+
// *sampleCount == 0 must only happen when there is no color attachment. In that case we
// do not need to validate the sample count of the depth stencil attachment.
const uint32_t depthStencilSampleCount = attachment->GetTexture()->GetSampleCount();