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>
This commit is contained in:
Kai Ninomiya 2020-07-11 03:15:16 +00:00 committed by Commit Bot service account
parent 0b43a803bf
commit 53405b54d5
3 changed files with 7 additions and 2 deletions

View File

@ -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": {

View File

@ -370,6 +370,10 @@ namespace dawn_native {
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.");

View File

@ -67,7 +67,7 @@ namespace utils {
std::array<wgpu::RenderPassColorAttachmentDescriptor, kMaxColorAttachments>
cColorAttachments;
wgpu::RenderPassDepthStencilAttachmentDescriptor cDepthStencilAttachmentInfo;
wgpu::RenderPassDepthStencilAttachmentDescriptor cDepthStencilAttachmentInfo = {};
};
struct BasicRenderPass {