Add occlusionQuerySet for compatibility with upstream webgpu.h
Adds RenderPassDescriptor.occlusionQuerySet for struct compatibility
with upstream webgpu.h, and validation errors that it's not used (since
it's not implemented).
Bug: dawn:22
Change-Id: I05ac75105038a0d7569cc720170e55f35b0f80d7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24620
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
diff --git a/dawn.json b/dawn.json
index 3886240..c6d231d 100644
--- a/dawn.json
+++ b/dawn.json
@@ -1162,7 +1162,8 @@
{"name": "label", "type": "char", "annotation": "const*", "length": "strlen", "optional": true},
{"name": "color attachment count", "type": "uint32_t"},
{"name": "color attachments", "type": "render pass color attachment descriptor", "annotation": "const*", "length": "color attachment count"},
- {"name": "depth stencil attachment", "type": "render pass depth stencil attachment descriptor", "annotation": "const*", "optional": true}
+ {"name": "depth stencil attachment", "type": "render pass depth stencil attachment descriptor", "annotation": "const*", "optional": true},
+ {"name": "occlusion query set", "type": "query set", "optional": true}
]
},
"render pass encoder": {
diff --git a/src/dawn_native/CommandEncoder.cpp b/src/dawn_native/CommandEncoder.cpp
index e8a6b46..01a5b62 100644
--- a/src/dawn_native/CommandEncoder.cpp
+++ b/src/dawn_native/CommandEncoder.cpp
@@ -370,6 +370,10 @@
device, descriptor->depthStencilAttachment, width, height, sampleCount));
}
+ if (descriptor->occlusionQuerySet != nullptr) {
+ return DAWN_VALIDATION_ERROR("occlusionQuerySet not implemented");
+ }
+
if (descriptor->colorAttachmentCount == 0 &&
descriptor->depthStencilAttachment == nullptr) {
return DAWN_VALIDATION_ERROR("Cannot use render pass with no attachments.");
diff --git a/src/utils/WGPUHelpers.h b/src/utils/WGPUHelpers.h
index a01cee6..5c5f9f2 100644
--- a/src/utils/WGPUHelpers.h
+++ b/src/utils/WGPUHelpers.h
@@ -67,7 +67,7 @@
std::array<wgpu::RenderPassColorAttachmentDescriptor, kMaxColorAttachments>
cColorAttachments;
- wgpu::RenderPassDepthStencilAttachmentDescriptor cDepthStencilAttachmentInfo;
+ wgpu::RenderPassDepthStencilAttachmentDescriptor cDepthStencilAttachmentInfo = {};
};
struct BasicRenderPass {