Add RenderEncoderBase to match WebGPU class hierarchy.

This is needed so that RenderBundleEncoder and RenderPassEncoder can
share code. This patch also moves EndPass out of ProgrammablePassEncoder
and into both RenderPassEncoder and ComputePassEncoder. Render bundles
do not have EndPass.

Bug: dawn:154
Change-Id: Ib7126b2ba718b0b93e3d6f15c429ac910c0d5d31
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/9180
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
Austin Eng
2019-07-20 01:34:56 +00:00
committed by Commit Bot service account
parent c0b8132f55
commit 69f1db7248
9 changed files with 247 additions and 155 deletions

View File

@@ -39,6 +39,15 @@ namespace dawn_native {
return new ComputePassEncoderBase(device, topLevelEncoder, ObjectBase::kError);
}
void ComputePassEncoderBase::EndPass() {
if (mTopLevelEncoder->ConsumedError(ValidateCanRecordCommands())) {
return;
}
mTopLevelEncoder->PassEnded();
mAllocator = nullptr;
}
void ComputePassEncoderBase::Dispatch(uint32_t x, uint32_t y, uint32_t z) {
if (mTopLevelEncoder->ConsumedError(ValidateCanRecordCommands())) {
return;