Deprecate endPass(), replace with end()

Method was renamed in https://github.com/gpuweb/gpuweb/pull/2560

Bug: dawn:1286
Change-Id: I02a5da3f6ff56868c4d8f45a17433b6c5adf5c22
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79480
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
This commit is contained in:
Brandon Jones 2022-02-07 19:48:39 +00:00 committed by Dawn LUCI CQ
parent a064f7c95c
commit 0fee4c180a
111 changed files with 595 additions and 549 deletions

View File

@ -812,7 +812,11 @@
] ]
}, },
{ {
"name": "end pass" "name": "end"
},
{
"name": "end pass",
"tags": ["deprecated"]
}, },
{ {
"name": "end pipeline statistics query", "name": "end pipeline statistics query",
@ -1978,7 +1982,11 @@
] ]
}, },
{ {
"name": "end pass" "name": "end"
},
{
"name": "end pass",
"tags": ["deprecated"]
}, },
{ {
"name": "end pipeline statistics query", "name": "end pipeline statistics query",

View File

@ -142,7 +142,7 @@ namespace dawn::native {
return ObjectType::ComputePassEncoder; return ObjectType::ComputePassEncoder;
} }
void ComputePassEncoder::APIEndPass() { void ComputePassEncoder::APIEnd() {
if (mEncodingContext->TryEncode( if (mEncodingContext->TryEncode(
this, this,
[&](CommandAllocator* allocator) -> MaybeError { [&](CommandAllocator* allocator) -> MaybeError {
@ -154,11 +154,16 @@ namespace dawn::native {
return {}; return {};
}, },
"encoding %s.EndPass().", this)) { "encoding %s.End().", this)) {
mEncodingContext->ExitComputePass(this, mUsageTracker.AcquireResourceUsage()); mEncodingContext->ExitComputePass(this, mUsageTracker.AcquireResourceUsage());
} }
} }
void ComputePassEncoder::APIEndPass() {
GetDevice()->EmitDeprecationWarning("endPass() has been deprecated. Use end() instead.");
APIEnd();
}
void ComputePassEncoder::APIDispatch(uint32_t workgroupCountX, void ComputePassEncoder::APIDispatch(uint32_t workgroupCountX,
uint32_t workgroupCountY, uint32_t workgroupCountY,
uint32_t workgroupCountZ) { uint32_t workgroupCountZ) {

View File

@ -38,7 +38,8 @@ namespace dawn::native {
ObjectType GetType() const override; ObjectType GetType() const override;
void APIEndPass(); void APIEnd();
void APIEndPass(); // TODO(dawn:1286): Remove after deprecation period.
void APIDispatch(uint32_t workgroupCountX, void APIDispatch(uint32_t workgroupCountX,
uint32_t workgroupCountY = 1, uint32_t workgroupCountY = 1,

View File

@ -586,7 +586,7 @@ namespace dawn::native {
passEncoder->APISetViewport(destination->origin.x, destination->origin.y, copySize->width, passEncoder->APISetViewport(destination->origin.x, destination->origin.y, copySize->width,
copySize->height, 0.0, 1.0); copySize->height, 0.0, 1.0);
passEncoder->APIDraw(3); passEncoder->APIDraw(3);
passEncoder->APIEndPass(); passEncoder->APIEnd();
// Finsh encoding. // Finsh encoding.
// TODO(dawn:723): change to not use AcquireRef for reentrant object creation. // TODO(dawn:723): change to not use AcquireRef for reentrant object creation.

View File

@ -376,7 +376,7 @@ namespace dawn::native {
passEncoder->APIDispatch(numDrawsRoundedUp); passEncoder->APIDispatch(numDrawsRoundedUp);
} }
passEncoder->APIEndPass(); passEncoder->APIEnd();
} }
return {}; return {};

View File

@ -211,7 +211,7 @@ namespace dawn::native {
pass->APISetBindGroup(0, bindGroup.Get()); pass->APISetBindGroup(0, bindGroup.Get());
pass->APIDispatch( pass->APIDispatch(
static_cast<uint32_t>((timestamps->GetSize() / sizeof(uint64_t) + 7) / 8)); static_cast<uint32_t>((timestamps->GetSize() / sizeof(uint64_t) + 7) / 8));
pass->APIEndPass(); pass->APIEnd();
return {}; return {};
} }

View File

@ -108,7 +108,7 @@ namespace dawn::native {
mCommandEncoder->TrackQueryAvailability(querySet, queryIndex); mCommandEncoder->TrackQueryAvailability(querySet, queryIndex);
} }
void RenderPassEncoder::APIEndPass() { void RenderPassEncoder::APIEnd() {
if (mEncodingContext->TryEncode( if (mEncodingContext->TryEncode(
this, this,
[&](CommandAllocator* allocator) -> MaybeError { [&](CommandAllocator* allocator) -> MaybeError {
@ -127,10 +127,15 @@ namespace dawn::native {
std::move(mIndirectDrawMetadata))); std::move(mIndirectDrawMetadata)));
return {}; return {};
}, },
"encoding %s.EndPass().", this)) { "encoding %s.End().", this)) {
} }
} }
void RenderPassEncoder::APIEndPass() {
GetDevice()->EmitDeprecationWarning("endPass() has been deprecated. Use end() instead.");
APIEnd();
}
void RenderPassEncoder::APISetStencilReference(uint32_t reference) { void RenderPassEncoder::APISetStencilReference(uint32_t reference) {
mEncodingContext->TryEncode( mEncodingContext->TryEncode(
this, this,

View File

@ -43,7 +43,8 @@ namespace dawn::native {
ObjectType GetType() const override; ObjectType GetType() const override;
void APIEndPass(); void APIEnd();
void APIEndPass(); // TODO(dawn:1286): Remove after deprecation period.
void APISetStencilReference(uint32_t reference); void APISetStencilReference(uint32_t reference);
void APISetBlendConstant(const Color* color); void APISetBlendConstant(const Color* color);

View File

@ -50,6 +50,10 @@ namespace wgpu::binding {
enc_.DispatchIndirect(*indirectBuffer.As<GPUBuffer>(), indirectOffset); enc_.DispatchIndirect(*indirectBuffer.As<GPUBuffer>(), indirectOffset);
} }
void GPUComputePassEncoder::end(Napi::Env) {
enc_.End();
}
void GPUComputePassEncoder::endPass(Napi::Env) { void GPUComputePassEncoder::endPass(Napi::Env) {
enc_.EndPass(); enc_.EndPass();
} }

View File

@ -43,7 +43,8 @@ namespace wgpu::binding {
void dispatchIndirect(Napi::Env, void dispatchIndirect(Napi::Env,
interop::Interface<interop::GPUBuffer> indirectBuffer, interop::Interface<interop::GPUBuffer> indirectBuffer,
interop::GPUSize64 indirectOffset) override; interop::GPUSize64 indirectOffset) override;
void endPass(Napi::Env) override; void end(Napi::Env) override;
void endPass(Napi::Env) override; // TODO(dawn:1286): Remove after deprecation period.
void setBindGroup(Napi::Env, void setBindGroup(Napi::Env,
interop::GPUIndex32 index, interop::GPUIndex32 index,
interop::Interface<interop::GPUBindGroup> bindGroup, interop::Interface<interop::GPUBindGroup> bindGroup,

View File

@ -85,6 +85,10 @@ namespace wgpu::binding {
enc_.ExecuteBundles(bundleCount, bundles); enc_.ExecuteBundles(bundleCount, bundles);
} }
void GPURenderPassEncoder::end(Napi::Env) {
enc_.End();
}
void GPURenderPassEncoder::endPass(Napi::Env) { void GPURenderPassEncoder::endPass(Napi::Env) {
enc_.EndPass(); enc_.EndPass();
} }

View File

@ -53,7 +53,8 @@ namespace wgpu::binding {
void executeBundles( void executeBundles(
Napi::Env, Napi::Env,
std::vector<interop::Interface<interop::GPURenderBundle>> bundles) override; std::vector<interop::Interface<interop::GPURenderBundle>> bundles) override;
void endPass(Napi::Env) override; void end(Napi::Env) override;
void endPass(Napi::Env) override; // TODO(dawn:1286): Remove after deprecation period.
void setBindGroup(Napi::Env, void setBindGroup(Napi::Env,
interop::GPUIndex32 index, interop::GPUIndex32 index,
interop::Interface<interop::GPUBindGroup> bindGroup, interop::Interface<interop::GPUBindGroup> bindGroup,

View File

@ -1231,7 +1231,7 @@ std::ostringstream& DawnTestBase::ExpectSampledFloatDataImpl(wgpu::TextureView t
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Dispatch(width, height); pass.Dispatch(width, height);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = commandEncoder.Finish(); wgpu::CommandBuffer commands = commandEncoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -1413,7 +1413,7 @@ std::ostringstream& DawnTestBase::ExpectAttachmentDepthStencilTestData(
{{0, depthDataTexture.CreateView()}})); {{0, depthDataTexture.CreateView()}}));
} }
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = commandEncoder.Finish(); wgpu::CommandBuffer commands = commandEncoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);

View File

@ -35,7 +35,7 @@ class BindGroupTests : public DawnTest {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Dispatch(1); pass.Dispatch(1);
pass.EndPass(); pass.End();
return encoder.Finish(); return encoder.Finish();
} }
@ -220,7 +220,7 @@ TEST_P(BindGroupTests, ReusedUBO) {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -326,7 +326,7 @@ TEST_P(BindGroupTests, UBOSamplerAndTexture) {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -414,7 +414,7 @@ TEST_P(BindGroupTests, MultipleBindLayouts) {
pass.SetBindGroup(0, bindGroups[0]); pass.SetBindGroup(0, bindGroups[0]);
pass.SetBindGroup(1, bindGroups[1]); pass.SetBindGroup(1, bindGroups[1]);
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -477,7 +477,7 @@ TEST_P(BindGroupTests, MultipleEntryPointsWithMultipleNonZeroGroups) {
pass.SetPipeline(cp); pass.SetPipeline(cp);
pass.SetBindGroup(0, bindGroup0); pass.SetBindGroup(0, bindGroup0);
pass.Dispatch(1); pass.Dispatch(1);
pass.EndPass(); pass.End();
cb = encoder.Finish(); cb = encoder.Finish();
queue.Submit(1, &cb); queue.Submit(1, &cb);
} }
@ -508,7 +508,7 @@ TEST_P(BindGroupTests, MultipleEntryPointsWithMultipleNonZeroGroups) {
pass.SetBindGroup(1, bindGroup1); pass.SetBindGroup(1, bindGroup1);
pass.SetBindGroup(2, bindGroup2); pass.SetBindGroup(2, bindGroup2);
pass.Dispatch(1); pass.Dispatch(1);
pass.EndPass(); pass.End();
cb = encoder.Finish(); cb = encoder.Finish();
queue.Submit(1, &cb); queue.Submit(1, &cb);
} }
@ -541,7 +541,7 @@ TEST_P(BindGroupTests, MultipleEntryPointsWithMultipleNonZeroGroups) {
pass.SetBindGroup(1, bindGroup1); pass.SetBindGroup(1, bindGroup1);
pass.SetBindGroup(2, bindGroup2); pass.SetBindGroup(2, bindGroup2);
pass.Dispatch(1); pass.Dispatch(1);
pass.EndPass(); pass.End();
cb = encoder.Finish(); cb = encoder.Finish();
queue.Submit(1, &cb); queue.Submit(1, &cb);
} }
@ -582,7 +582,7 @@ TEST_P(BindGroupTests, DrawTwiceInSamePipelineWithFourBindGroupSets) {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -623,7 +623,7 @@ TEST_P(BindGroupTests, SetBindGroupBeforePipeline) {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -684,7 +684,7 @@ TEST_P(BindGroupTests, SetDynamicBindGroupBeforePipeline) {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -761,7 +761,7 @@ TEST_P(BindGroupTests, BindGroupsPersistAfterPipelineChange) {
pass.SetPipeline(pipeline1); pass.SetPipeline(pipeline1);
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -867,7 +867,7 @@ TEST_P(BindGroupTests, DrawThenChangePipelineAndBindGroup) {
pass.SetBindGroup(1, storageBindGroup, 1, &dynamicOffset); pass.SetBindGroup(1, storageBindGroup, 1, &dynamicOffset);
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -969,7 +969,7 @@ TEST_P(BindGroupTests, DrawThenChangePipelineTwiceAndBindGroup) {
// bind groups 0 and 1 should still be valid. // bind groups 0 and 1 should still be valid.
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -1060,7 +1060,7 @@ TEST_P(BindGroupTests, DynamicOffsetOrder) {
computePassEncoder.SetPipeline(pipeline); computePassEncoder.SetPipeline(pipeline);
computePassEncoder.SetBindGroup(0, bindGroup, offsets.size(), offsets.data()); computePassEncoder.SetBindGroup(0, bindGroup, offsets.size(), offsets.data());
computePassEncoder.Dispatch(1); computePassEncoder.Dispatch(1);
computePassEncoder.EndPass(); computePassEncoder.End();
wgpu::CommandBuffer commands = commandEncoder.Finish(); wgpu::CommandBuffer commands = commandEncoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -1142,7 +1142,7 @@ TEST_P(BindGroupTests, DynamicAndNonDynamicBindingsDoNotConflictAfterRemapping)
computePassEncoder.SetPipeline(pipeline); computePassEncoder.SetPipeline(pipeline);
computePassEncoder.SetBindGroup(0, bindGroup, offsets.size(), offsets.data()); computePassEncoder.SetBindGroup(0, bindGroup, offsets.size(), offsets.data());
computePassEncoder.Dispatch(1); computePassEncoder.Dispatch(1);
computePassEncoder.EndPass(); computePassEncoder.End();
wgpu::CommandBuffer commands = commandEncoder.Finish(); wgpu::CommandBuffer commands = commandEncoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -1184,7 +1184,7 @@ TEST_P(BindGroupTests, BindGroupLayoutVisibilityCanBeNone) {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -1219,7 +1219,7 @@ TEST_P(BindGroupTests, DynamicBindingNoneVisibility) {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup, 1, &dynamicOffset); pass.SetBindGroup(0, bindGroup, 1, &dynamicOffset);
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -1279,7 +1279,7 @@ TEST_P(BindGroupTests, ArbitraryBindingNumbers) {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -1362,7 +1362,7 @@ TEST_P(BindGroupTests, EmptyLayout) {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bg); pass.SetBindGroup(0, bg);
pass.Dispatch(1); pass.Dispatch(1);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -1416,7 +1416,7 @@ TEST_P(BindGroupTests, ReadonlyStorage) {
pass.SetPipeline(renderPipeline); pass.SetPipeline(renderPipeline);
pass.SetBindGroup(0, utils::MakeBindGroup(device, bgl, {{0, storageBuffer}})); pass.SetBindGroup(0, utils::MakeBindGroup(device, bgl, {{0, storageBuffer}}));
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -1561,7 +1561,7 @@ TEST_P(BindGroupTests, ReallyLargeBindGroup) {
pass.SetPipeline(cp); pass.SetPipeline(cp);
pass.SetBindGroup(0, bg); pass.SetBindGroup(0, bg);
pass.Dispatch(1, 1, 1); pass.Dispatch(1, 1, 1);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = commandEncoder.Finish(); wgpu::CommandBuffer commands = commandEncoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);

View File

@ -109,7 +109,7 @@ class BufferZeroInitTest : public DawnTest {
{texture.CreateView(&viewDescriptor)}); {texture.CreateView(&viewDescriptor)});
renderPassDescriptor.cColorAttachments[0].clearColor = color; renderPassDescriptor.cColorAttachments[0].clearColor = color;
wgpu::RenderPassEncoder renderPass = encoder.BeginRenderPass(&renderPassDescriptor); wgpu::RenderPassEncoder renderPass = encoder.BeginRenderPass(&renderPassDescriptor);
renderPass.EndPass(); renderPass.End();
} }
wgpu::CommandBuffer commandBuffer = encoder.Finish(); wgpu::CommandBuffer commandBuffer = encoder.Finish();
@ -190,7 +190,7 @@ class BufferZeroInitTest : public DawnTest {
computePass.SetBindGroup(0, bindGroup); computePass.SetBindGroup(0, bindGroup);
computePass.SetPipeline(pipeline); computePass.SetPipeline(pipeline);
computePass.Dispatch(1u); computePass.Dispatch(1u);
computePass.EndPass(); computePass.End();
wgpu::CommandBuffer commandBuffer = encoder.Finish(); wgpu::CommandBuffer commandBuffer = encoder.Finish();
EXPECT_LAZY_CLEAR(1u, queue.Submit(1, &commandBuffer)); EXPECT_LAZY_CLEAR(1u, queue.Submit(1, &commandBuffer));
@ -283,7 +283,7 @@ class BufferZeroInitTest : public DawnTest {
renderPass.SetVertexBuffer(0, vertexBuffer, vertexBufferOffset, kVertexAttributeSize); renderPass.SetVertexBuffer(0, vertexBuffer, vertexBufferOffset, kVertexAttributeSize);
renderPass.SetPipeline(renderPipeline); renderPass.SetPipeline(renderPipeline);
renderPass.Draw(1); renderPass.Draw(1);
renderPass.EndPass(); renderPass.End();
ExpectLazyClearSubmitAndCheckOutputs(encoder, vertexBuffer, vertexBufferSize, ExpectLazyClearSubmitAndCheckOutputs(encoder, vertexBuffer, vertexBufferSize,
colorAttachment); colorAttachment);
@ -331,7 +331,7 @@ class BufferZeroInitTest : public DawnTest {
renderPass.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint16, indexBufferOffset, renderPass.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint16, indexBufferOffset,
sizeof(uint32_t)); sizeof(uint32_t));
renderPass.DrawIndexed(1); renderPass.DrawIndexed(1);
renderPass.EndPass(); renderPass.End();
ExpectLazyClearSubmitAndCheckOutputs(encoder, indexBuffer, indexBufferSize, ExpectLazyClearSubmitAndCheckOutputs(encoder, indexBuffer, indexBufferSize,
colorAttachment); colorAttachment);
@ -373,7 +373,7 @@ class BufferZeroInitTest : public DawnTest {
wgpu::RenderPassEncoder renderPass = encoder.BeginRenderPass(&renderPassDescriptor); wgpu::RenderPassEncoder renderPass = encoder.BeginRenderPass(&renderPassDescriptor);
renderPass.SetPipeline(renderPipeline); renderPass.SetPipeline(renderPipeline);
renderPass.DrawIndirect(indirectBuffer, indirectBufferOffset); renderPass.DrawIndirect(indirectBuffer, indirectBufferOffset);
renderPass.EndPass(); renderPass.End();
ExpectLazyClearSubmitAndCheckOutputs(encoder, indirectBuffer, bufferSize, colorAttachment); ExpectLazyClearSubmitAndCheckOutputs(encoder, indirectBuffer, bufferSize, colorAttachment);
} }
@ -417,7 +417,7 @@ class BufferZeroInitTest : public DawnTest {
renderPass.SetPipeline(renderPipeline); renderPass.SetPipeline(renderPipeline);
renderPass.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint16); renderPass.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint16);
renderPass.DrawIndexedIndirect(indirectBuffer, indirectBufferOffset); renderPass.DrawIndexedIndirect(indirectBuffer, indirectBufferOffset);
renderPass.EndPass(); renderPass.End();
ExpectLazyClearSubmitAndCheckOutputs(encoder, indirectBuffer, bufferSize, colorAttachment); ExpectLazyClearSubmitAndCheckOutputs(encoder, indirectBuffer, bufferSize, colorAttachment);
} }
@ -458,7 +458,7 @@ class BufferZeroInitTest : public DawnTest {
computePass.SetBindGroup(0, bindGroup); computePass.SetBindGroup(0, bindGroup);
computePass.SetPipeline(pipeline); computePass.SetPipeline(pipeline);
computePass.DispatchIndirect(indirectBuffer, indirectBufferOffset); computePass.DispatchIndirect(indirectBuffer, indirectBufferOffset);
computePass.EndPass(); computePass.End();
ExpectLazyClearSubmitAndCheckOutputs(encoder, indirectBuffer, bufferSize, outputTexture); ExpectLazyClearSubmitAndCheckOutputs(encoder, indirectBuffer, bufferSize, outputTexture);
} }
@ -1227,7 +1227,7 @@ TEST_P(BufferZeroInitTest, PaddingInitialized) {
renderPass.SetPipeline(renderPipeline); renderPass.SetPipeline(renderPipeline);
renderPass.DrawIndexed(1); renderPass.DrawIndexed(1);
renderPass.EndPass(); renderPass.End();
wgpu::CommandBuffer commandBuffer = encoder.Finish(); wgpu::CommandBuffer commandBuffer = encoder.Finish();

View File

@ -84,7 +84,7 @@ TEST_P(ClipSpaceTest, ClipSpace) {
wgpu::RenderPassEncoder renderPass = commandEncoder.BeginRenderPass(&renderPassDescriptor); wgpu::RenderPassEncoder renderPass = commandEncoder.BeginRenderPass(&renderPassDescriptor);
renderPass.SetPipeline(CreatePipelineForTest()); renderPass.SetPipeline(CreatePipelineForTest());
renderPass.Draw(6); renderPass.Draw(6);
renderPass.EndPass(); renderPass.End();
wgpu::CommandBuffer commandBuffer = commandEncoder.Finish(); wgpu::CommandBuffer commandBuffer = commandEncoder.Finish();
queue.Submit(1, &commandBuffer); queue.Submit(1, &commandBuffer);

View File

@ -128,7 +128,7 @@ class ColorStateTest : public DawnTest {
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({{triangle.color}}))); pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({{triangle.color}})));
pass.SetBlendConstant(&blendConstant); pass.SetBlendConstant(&blendConstant);
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -756,7 +756,7 @@ TEST_P(ColorStateTest, ColorWriteMaskBlendingDisabled) {
pass.SetPipeline(testPipeline); pass.SetPipeline(testPipeline);
pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({{base}}))); pass.SetBindGroup(0, MakeBindGroupForColors(std::array<RGBA8, 1>({{base}})));
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -891,7 +891,7 @@ TEST_P(ColorStateTest, IndependentColorState) {
pass.SetBindGroup(0, MakeBindGroupForColors( pass.SetBindGroup(0, MakeBindGroupForColors(
std::array<RGBA8, 4>({{color0, color1, color2, color3}}))); std::array<RGBA8, 4>({{color0, color1, color2, color3}})));
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -967,7 +967,7 @@ TEST_P(ColorStateTest, DefaultBlendColor) {
pass.SetBindGroup( pass.SetBindGroup(
0, MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(255, 255, 255, 255)}}))); 0, MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(255, 255, 255, 255)}})));
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -990,7 +990,7 @@ TEST_P(ColorStateTest, DefaultBlendColor) {
pass.SetBindGroup( pass.SetBindGroup(
0, MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(255, 255, 255, 255)}}))); 0, MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(255, 255, 255, 255)}})));
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -1014,7 +1014,7 @@ TEST_P(ColorStateTest, DefaultBlendColor) {
pass.SetBindGroup( pass.SetBindGroup(
0, MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(255, 255, 255, 255)}}))); 0, MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(255, 255, 255, 255)}})));
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
} }
{ {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
@ -1026,7 +1026,7 @@ TEST_P(ColorStateTest, DefaultBlendColor) {
pass.SetBindGroup( pass.SetBindGroup(
0, MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(255, 255, 255, 255)}}))); 0, MakeBindGroupForColors(std::array<RGBA8, 1>({{RGBA8(255, 255, 255, 255)}})));
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -1082,12 +1082,12 @@ TEST_P(ColorStateTest, ColorWriteMaskDoesNotAffectRenderPassLoadOpClear) {
// Set a pipeline that will dirty the color write mask // Set a pipeline that will dirty the color write mask
pass.SetPipeline(testPipeline); pass.SetPipeline(testPipeline);
pass.EndPass(); pass.End();
} }
{ {
// This renderpass' loadOp should clear all channels of the render attachment // This renderpass' loadOp should clear all channels of the render attachment
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);

View File

@ -214,7 +214,7 @@ class CompressedTextureFormatTest : public DawnTestWithParams<CompressedTextureF
pass.SetPipeline(renderPipeline); pass.SetPipeline(renderPipeline);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();

View File

@ -75,7 +75,7 @@ void ComputeCopyStorageBufferTests::BasicTest(const char* shader) {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Dispatch(kInstances); pass.Dispatch(kInstances);
pass.EndPass(); pass.End();
commands = encoder.Finish(); commands = encoder.Finish();
} }

View File

@ -101,7 +101,7 @@ class ComputeDispatchTests : public DawnTest {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Dispatch(x, y, z); pass.Dispatch(x, y, z);
pass.EndPass(); pass.End();
commands = encoder.Finish(); commands = encoder.Finish();
} }
@ -160,7 +160,7 @@ class ComputeDispatchTests : public DawnTest {
pass.SetPipeline(computePipelineForTest); pass.SetPipeline(computePipelineForTest);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.DispatchIndirect(indirectBuffer, indirectOffset); pass.DispatchIndirect(indirectBuffer, indirectOffset);
pass.EndPass(); pass.End();
commands = encoder.Finish(); commands = encoder.Finish();
} }

View File

@ -323,7 +323,7 @@ fn main() {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Dispatch(1); pass.Dispatch(1);
pass.EndPass(); pass.End();
commands = encoder.Finish(); commands = encoder.Finish();
} }

View File

@ -57,7 +57,7 @@ void ComputeSharedMemoryTests::BasicTest(const char* shader) {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Dispatch(1); pass.Dispatch(1);
pass.EndPass(); pass.End();
commands = encoder.Finish(); commands = encoder.Finish();
} }
@ -179,7 +179,7 @@ TEST_P(ComputeSharedMemoryTests, AssortedTypes) {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Dispatch(1); pass.Dispatch(1);
pass.EndPass(); pass.End();
commands = encoder.Finish(); commands = encoder.Finish();
} }

View File

@ -59,7 +59,7 @@ TEST_P(ComputeStorageBufferBarrierTests, AddIncrement) {
for (uint32_t i = 0; i < kIterations; ++i) { for (uint32_t i = 0; i < kIterations; ++i) {
pass.Dispatch(kNumValues); pass.Dispatch(kNumValues);
} }
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -124,7 +124,7 @@ TEST_P(ComputeStorageBufferBarrierTests, AddPingPong) {
pass.SetBindGroup(0, bindGroups[1]); pass.SetBindGroup(0, bindGroups[1]);
pass.Dispatch(kNumValues); pass.Dispatch(kNumValues);
} }
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -190,7 +190,7 @@ TEST_P(ComputeStorageBufferBarrierTests, StorageAndReadonlyStoragePingPongInOneP
pass.SetBindGroup(0, bindGroups[1]); pass.SetBindGroup(0, bindGroups[1]);
pass.Dispatch(kNumValues); pass.Dispatch(kNumValues);
} }
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -256,7 +256,7 @@ TEST_P(ComputeStorageBufferBarrierTests, UniformToStorageAddPingPong) {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroups[b]); pass.SetBindGroup(0, bindGroups[b]);
pass.Dispatch(kNumValues / 4); pass.Dispatch(kNumValues / 4);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -324,7 +324,7 @@ TEST_P(ComputeStorageBufferBarrierTests, UniformToStorageAddPingPongInOnePass) {
pass.SetBindGroup(0, bindGroups[b]); pass.SetBindGroup(0, bindGroups[b]);
pass.Dispatch(kNumValues / 4); pass.Dispatch(kNumValues / 4);
} }
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -400,7 +400,7 @@ TEST_P(ComputeStorageBufferBarrierTests, IndirectBufferCorrectBarrier) {
pass.SetBindGroup(0, step3Group); pass.SetBindGroup(0, step3Group);
pass.DispatchIndirect(buf, 0); pass.DispatchIndirect(buf, 0);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);

View File

@ -1043,7 +1043,7 @@ TEST_P(CopyTests_T2B, CopyOneRowWithDepth32Float) {
renderPass.cDepthStencilAttachmentInfo.depthLoadOp = wgpu::LoadOp::Clear; renderPass.cDepthStencilAttachmentInfo.depthLoadOp = wgpu::LoadOp::Clear;
renderPass.cDepthStencilAttachmentInfo.depthStoreOp = wgpu::StoreOp::Store; renderPass.cDepthStencilAttachmentInfo.depthStoreOp = wgpu::StoreOp::Store;
wgpu::RenderPassEncoder renderPassEncoder = encoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder renderPassEncoder = encoder.BeginRenderPass(&renderPass);
renderPassEncoder.EndPass(); renderPassEncoder.End();
constexpr uint32_t kBufferCopyOffset = kTextureBytesPerRowAlignment; constexpr uint32_t kBufferCopyOffset = kTextureBytesPerRowAlignment;
const uint32_t kBufferSize = const uint32_t kBufferSize =

View File

@ -476,7 +476,7 @@ class CopyTextureForBrowserTests : public Parent {
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Dispatch(dstSpec.textureSize.width, pass.Dispatch(dstSpec.textureSize.width,
dstSpec.textureSize.height); // Verify dst texture content dstSpec.textureSize.height); // Verify dst texture content
pass.EndPass(); pass.End();
testCommands = encoder.Finish(); testCommands = encoder.Finish();
} }

View File

@ -53,7 +53,7 @@ class CreatePipelineAsyncTest : public DawnTest {
pass.SetPipeline(currentTask->computePipeline); pass.SetPipeline(currentTask->computePipeline);
pass.Dispatch(1); pass.Dispatch(1);
pass.EndPass(); pass.End();
commands = encoder.Finish(); commands = encoder.Finish();
} }
@ -96,7 +96,7 @@ class CreatePipelineAsyncTest : public DawnTest {
renderPassEncoder.SetPipeline(currentTask->renderPipeline); renderPassEncoder.SetPipeline(currentTask->renderPipeline);
renderPassEncoder.Draw(1); renderPassEncoder.Draw(1);
renderPassEncoder.EndPass(); renderPassEncoder.End();
commands = encoder.Finish(); commands = encoder.Finish();
} }
@ -308,7 +308,7 @@ TEST_P(CreatePipelineAsyncTest, ReleaseEntryPointsAfterCreateRenderPipelineAsync
renderPassEncoder.SetPipeline(task.renderPipeline); renderPassEncoder.SetPipeline(task.renderPipeline);
renderPassEncoder.Draw(1); renderPassEncoder.Draw(1);
renderPassEncoder.EndPass(); renderPassEncoder.End();
commands = encoder.Finish(); commands = encoder.Finish();
} }
@ -700,7 +700,7 @@ TEST_P(CreatePipelineAsyncTest, CreateRenderPipelineAsyncWithVertexBufferLayouts
pass.SetVertexBuffer(0, vertexBuffer1); pass.SetVertexBuffer(0, vertexBuffer1);
pass.SetVertexBuffer(1, vertexBuffer2); pass.SetVertexBuffer(1, vertexBuffer2);
pass.Draw(1); pass.Draw(1);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -773,7 +773,7 @@ TEST_P(CreatePipelineAsyncTest, CreateRenderPipelineAsyncWithDepthStencilState)
pass.SetStencilReference(1); pass.SetStencilReference(1);
pass.Draw(1); pass.Draw(1);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -840,7 +840,7 @@ TEST_P(CreatePipelineAsyncTest, CreateRenderPipelineWithMultisampleState) {
pass.SetPipeline(task.renderPipeline); pass.SetPipeline(task.renderPipeline);
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -942,7 +942,7 @@ TEST_P(CreatePipelineAsyncTest, CreateRenderPipelineAsyncWithBlendState) {
pass.SetPipeline(task.renderPipeline); pass.SetPipeline(task.renderPipeline);
pass.Draw(1); pass.Draw(1);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();

View File

@ -82,7 +82,7 @@ class CullingTest : public DawnTest {
wgpu::RenderPassEncoder renderPass = commandEncoder.BeginRenderPass(&renderPassDescriptor); wgpu::RenderPassEncoder renderPass = commandEncoder.BeginRenderPass(&renderPassDescriptor);
renderPass.SetPipeline(CreatePipelineForTest(frontFace, cullMode)); renderPass.SetPipeline(CreatePipelineForTest(frontFace, cullMode));
renderPass.Draw(6); renderPass.Draw(6);
renderPass.EndPass(); renderPass.End();
wgpu::CommandBuffer commandBuffer = commandEncoder.Finish(); wgpu::CommandBuffer commandBuffer = commandEncoder.Finish();
queue.Submit(1, &commandBuffer); queue.Submit(1, &commandBuffer);

View File

@ -330,7 +330,7 @@ class D3D12SharedHandleUsageTests : public D3D12ResourceTestBase {
wgpu::CommandEncoder encoder = wgpuDevice.CreateCommandEncoder(); wgpu::CommandEncoder encoder = wgpuDevice.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPassDescriptor); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPassDescriptor);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
wgpu::Queue queue = wgpuDevice.GetQueue(); wgpu::Queue queue = wgpuDevice.GetQueue();

View File

@ -31,14 +31,14 @@ TEST_P(DebugMarkerTests, NoFailureWithoutDebugToolAttached) {
pass.PushDebugGroup("Event Start"); pass.PushDebugGroup("Event Start");
pass.InsertDebugMarker("Marker"); pass.InsertDebugMarker("Marker");
pass.PopDebugGroup(); pass.PopDebugGroup();
pass.EndPass(); pass.End();
} }
{ {
wgpu::ComputePassEncoder pass = encoder.BeginComputePass(); wgpu::ComputePassEncoder pass = encoder.BeginComputePass();
pass.PushDebugGroup("Event Start"); pass.PushDebugGroup("Event Start");
pass.InsertDebugMarker("Marker"); pass.InsertDebugMarker("Marker");
pass.PopDebugGroup(); pass.PopDebugGroup();
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();

View File

@ -70,7 +70,25 @@ TEST_P(DeprecationTests, ReadOnlyDepthStencilStoreLoadOpsAttachment) {
EXPECT_DEPRECATION_WARNING(pass = encoder.BeginRenderPass(&renderPass.renderPassInfo)); EXPECT_DEPRECATION_WARNING(pass = encoder.BeginRenderPass(&renderPass.renderPassInfo));
pass.EndPass(); pass.End();
}
// Test that endPass() is deprecated for both render and compute passes.
TEST_P(DeprecationTests, EndPass) {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
{
utils::BasicRenderPass renderPass = utils::CreateBasicRenderPass(device, 1, 1);
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
EXPECT_DEPRECATION_WARNING(pass.EndPass());
}
{
wgpu::ComputePassEncoder pass = encoder.BeginComputePass();
EXPECT_DEPRECATION_WARNING(pass.EndPass());
}
} }
DAWN_INSTANTIATE_TEST(DeprecationTests, DAWN_INSTANTIATE_TEST(DeprecationTests,

View File

@ -116,7 +116,7 @@ class DepthBiasTests : public DawnTest {
wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPassDesc); wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPassDesc);
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = commandEncoder.Finish(); wgpu::CommandBuffer commands = commandEncoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);

View File

@ -161,7 +161,7 @@ class DepthStencilCopyTests : public DawnTestWithParams<DepthStencilCopyTestPara
wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPassDesc); wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPassDesc);
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = commandEncoder.Finish(); wgpu::CommandBuffer commands = commandEncoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -197,7 +197,7 @@ class DepthStencilCopyTests : public DawnTestWithParams<DepthStencilCopyTestPara
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetStencilReference(regionStencil); pass.SetStencilReference(regionStencil);
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = commandEncoder.Finish(); wgpu::CommandBuffer commands = commandEncoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -594,7 +594,7 @@ TEST_P(StencilCopyTests, ToStencilAspect) {
passDescriptor.cDepthStencilAttachmentInfo.clearDepth = 0.7; passDescriptor.cDepthStencilAttachmentInfo.clearDepth = 0.7;
wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&passDescriptor); wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&passDescriptor);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = commandEncoder.Finish(); wgpu::CommandBuffer commands = commandEncoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -654,7 +654,7 @@ TEST_P(StencilCopyTests, ToStencilAspect) {
wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&passDescriptor); wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&passDescriptor);
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = commandEncoder.Finish(); wgpu::CommandBuffer commands = commandEncoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);

View File

@ -188,7 +188,7 @@ TEST_P(DepthStencilLoadOpTests, ClearMip0) {
GetParam().mFormat == wgpu::TextureFormat::Depth16Unorm); GetParam().mFormat == wgpu::TextureFormat::Depth16Unorm);
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
encoder.BeginRenderPass(&renderPassDescriptors[0]).EndPass(); encoder.BeginRenderPass(&renderPassDescriptors[0]).End();
wgpu::CommandBuffer commandBuffer = encoder.Finish(); wgpu::CommandBuffer commandBuffer = encoder.Finish();
queue.Submit(1, &commandBuffer); queue.Submit(1, &commandBuffer);
@ -206,7 +206,7 @@ TEST_P(DepthStencilLoadOpTests, ClearMip1) {
DAWN_SUPPRESS_TEST_IF(IsMetal() && IsIntel() && GetParam().mCheck == Check::CopyStencil); DAWN_SUPPRESS_TEST_IF(IsMetal() && IsIntel() && GetParam().mCheck == Check::CopyStencil);
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
encoder.BeginRenderPass(&renderPassDescriptors[1]).EndPass(); encoder.BeginRenderPass(&renderPassDescriptors[1]).End();
wgpu::CommandBuffer commandBuffer = encoder.Finish(); wgpu::CommandBuffer commandBuffer = encoder.Finish();
queue.Submit(1, &commandBuffer); queue.Submit(1, &commandBuffer);
@ -224,8 +224,8 @@ TEST_P(DepthStencilLoadOpTests, ClearBothMip0Then1) {
GetParam().mFormat == wgpu::TextureFormat::Depth16Unorm); GetParam().mFormat == wgpu::TextureFormat::Depth16Unorm);
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
encoder.BeginRenderPass(&renderPassDescriptors[0]).EndPass(); encoder.BeginRenderPass(&renderPassDescriptors[0]).End();
encoder.BeginRenderPass(&renderPassDescriptors[1]).EndPass(); encoder.BeginRenderPass(&renderPassDescriptors[1]).End();
wgpu::CommandBuffer commandBuffer = encoder.Finish(); wgpu::CommandBuffer commandBuffer = encoder.Finish();
queue.Submit(1, &commandBuffer); queue.Submit(1, &commandBuffer);
@ -244,8 +244,8 @@ TEST_P(DepthStencilLoadOpTests, ClearBothMip1Then0) {
GetParam().mFormat == wgpu::TextureFormat::Depth16Unorm); GetParam().mFormat == wgpu::TextureFormat::Depth16Unorm);
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
encoder.BeginRenderPass(&renderPassDescriptors[1]).EndPass(); encoder.BeginRenderPass(&renderPassDescriptors[1]).End();
encoder.BeginRenderPass(&renderPassDescriptors[0]).EndPass(); encoder.BeginRenderPass(&renderPassDescriptors[0]).End();
wgpu::CommandBuffer commandBuffer = encoder.Finish(); wgpu::CommandBuffer commandBuffer = encoder.Finish();
queue.Submit(1, &commandBuffer); queue.Submit(1, &commandBuffer);

View File

@ -269,7 +269,7 @@ class DepthStencilSamplingTest : public DawnTestWithParams<DepthStencilSamplingT
passDescriptor.cDepthStencilAttachmentInfo.clearDepth = depthValue; passDescriptor.cDepthStencilAttachmentInfo.clearDepth = depthValue;
wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&passDescriptor); wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&passDescriptor);
pass.EndPass(); pass.End();
} }
void UpdateInputStencil(wgpu::CommandEncoder commandEncoder, void UpdateInputStencil(wgpu::CommandEncoder commandEncoder,
@ -279,7 +279,7 @@ class DepthStencilSamplingTest : public DawnTestWithParams<DepthStencilSamplingT
passDescriptor.cDepthStencilAttachmentInfo.clearStencil = stencilValue; passDescriptor.cDepthStencilAttachmentInfo.clearStencil = stencilValue;
wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&passDescriptor); wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&passDescriptor);
pass.EndPass(); pass.End();
} }
template <typename T, typename CheckBufferFn> template <typename T, typename CheckBufferFn>
@ -327,7 +327,7 @@ class DepthStencilSamplingTest : public DawnTestWithParams<DepthStencilSamplingT
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Draw(1); pass.Draw(1);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = commandEncoder.Finish(); wgpu::CommandBuffer commands = commandEncoder.Finish();
@ -379,7 +379,7 @@ class DepthStencilSamplingTest : public DawnTestWithParams<DepthStencilSamplingT
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Dispatch(1); pass.Dispatch(1);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = commandEncoder.Finish(); wgpu::CommandBuffer commands = commandEncoder.Finish();
@ -531,7 +531,7 @@ class DepthStencilSamplingTest : public DawnTestWithParams<DepthStencilSamplingT
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Draw(1); pass.Draw(1);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = commandEncoder.Finish(); wgpu::CommandBuffer commands = commandEncoder.Finish();
@ -577,7 +577,7 @@ class DepthStencilSamplingTest : public DawnTestWithParams<DepthStencilSamplingT
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Dispatch(1); pass.Dispatch(1);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = commandEncoder.Finish(); wgpu::CommandBuffer commands = commandEncoder.Finish();
@ -661,7 +661,7 @@ TEST_P(DepthStencilSamplingTest, SampleDepthAndStencilRender) {
passDescriptor.cDepthStencilAttachmentInfo.clearStencil = 31; passDescriptor.cDepthStencilAttachmentInfo.clearStencil = 31;
wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&passDescriptor); wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&passDescriptor);
pass.EndPass(); pass.End();
// Render into the output textures // Render into the output textures
{ {
@ -672,7 +672,7 @@ TEST_P(DepthStencilSamplingTest, SampleDepthAndStencilRender) {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Draw(1); pass.Draw(1);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = commandEncoder.Finish(); wgpu::CommandBuffer commands = commandEncoder.Finish();
@ -712,7 +712,7 @@ TEST_P(DepthStencilSamplingTest, SampleDepthAndStencilRender) {
passDescriptor.cDepthStencilAttachmentInfo.clearStencil = 31; passDescriptor.cDepthStencilAttachmentInfo.clearStencil = 31;
wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&passDescriptor); wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&passDescriptor);
pass.EndPass(); pass.End();
// Sample into the output buffers // Sample into the output buffers
{ {
@ -720,7 +720,7 @@ TEST_P(DepthStencilSamplingTest, SampleDepthAndStencilRender) {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Dispatch(1); pass.Dispatch(1);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = commandEncoder.Finish(); wgpu::CommandBuffer commands = commandEncoder.Finish();

View File

@ -289,7 +289,7 @@ class DepthStencilStateTest : public DawnTest {
// Clear the depthStencilView at the beginning // Clear the depthStencilView at the beginning
{ {
pass = encoder.BeginRenderPass(&renderPass); pass = encoder.BeginRenderPass(&renderPass);
pass.EndPass(); pass.End();
} }
} else { } else {
pass = encoder.BeginRenderPass(&renderPass); pass = encoder.BeginRenderPass(&renderPass);
@ -336,12 +336,12 @@ class DepthStencilStateTest : public DawnTest {
pass.Draw(6); pass.Draw(6);
if (isSingleEncoderMultiplePass) { if (isSingleEncoderMultiplePass) {
pass.EndPass(); pass.End();
} }
} }
if (!isSingleEncoderMultiplePass) { if (!isSingleEncoderMultiplePass) {
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();

View File

@ -58,7 +58,7 @@ class DestroyTest : public DawnTest {
-1.0f, 1.0f, 0.0f, 1.0f, 1.0f, -1.0f, 0.0f, 1.0f, -1.0f, -1.0f, 0.0f, 1.0f}); -1.0f, 1.0f, 0.0f, 1.0f, 1.0f, -1.0f, 0.0f, 1.0f, -1.0f, -1.0f, 0.0f, 1.0f});
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
encoder.BeginRenderPass(&renderPass.renderPassInfo).EndPass(); encoder.BeginRenderPass(&renderPass.renderPassInfo).End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
} }
@ -74,7 +74,7 @@ class DestroyTest : public DawnTest {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetVertexBuffer(0, vertexBuffer); pass.SetVertexBuffer(0, vertexBuffer);
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
return commands; return commands;

View File

@ -88,7 +88,7 @@ class DrawIndexedIndirectTest : public DawnTest {
pass.SetVertexBuffer(0, vertexBuffer); pass.SetVertexBuffer(0, vertexBuffer);
pass.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint32, indexOffset); pass.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint32, indexOffset);
pass.DrawIndexedIndirect(indirectBuffer, indirectOffset); pass.DrawIndexedIndirect(indirectBuffer, indirectOffset);
pass.EndPass(); pass.End();
} }
return encoder.Finish(); return encoder.Finish();
@ -288,7 +288,7 @@ TEST_P(DrawIndexedIndirectTest, ValidateMultipleDraws) {
pass.DrawIndexedIndirect(indirectBuffer, 0); pass.DrawIndexedIndirect(indirectBuffer, 0);
pass.DrawIndexedIndirect(indirectBuffer, 20); pass.DrawIndexedIndirect(indirectBuffer, 20);
pass.DrawIndexedIndirect(indirectBuffer, 40); pass.DrawIndexedIndirect(indirectBuffer, 40);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -313,7 +313,7 @@ TEST_P(DrawIndexedIndirectTest, ValidateMultipleDraws) {
pass.SetIndexBuffer(CreateIndexBuffer({0, 1, 2, 0, 3, 1, 0, 2, 1}), pass.SetIndexBuffer(CreateIndexBuffer({0, 1, 2, 0, 3, 1, 0, 2, 1}),
wgpu::IndexFormat::Uint32, 0); wgpu::IndexFormat::Uint32, 0);
pass.DrawIndexedIndirect(indirectBuffer, 40); pass.DrawIndexedIndirect(indirectBuffer, 40);
pass.EndPass(); pass.End();
} }
commands = encoder.Finish(); commands = encoder.Finish();
@ -332,7 +332,7 @@ TEST_P(DrawIndexedIndirectTest, ValidateMultipleDraws) {
pass.DrawIndexedIndirect(CreateIndirectBuffer({3, 1, 3, 0, 0}), 0); pass.DrawIndexedIndirect(CreateIndirectBuffer({3, 1, 3, 0, 0}), 0);
pass.DrawIndexedIndirect(CreateIndirectBuffer({10, 1, 0, 0, 0}), 0); pass.DrawIndexedIndirect(CreateIndirectBuffer({10, 1, 0, 0, 0}), 0);
pass.DrawIndexedIndirect(CreateIndirectBuffer({3, 1, 6, 0, 0}), 0); pass.DrawIndexedIndirect(CreateIndirectBuffer({3, 1, 6, 0, 0}), 0);
pass.EndPass(); pass.End();
} }
commands = encoder.Finish(); commands = encoder.Finish();
@ -352,7 +352,7 @@ TEST_P(DrawIndexedIndirectTest, ValidateMultipleDraws) {
pass.DrawIndexedIndirect(CreateIndirectBuffer({10, 1, 0, 0, 0}), 0); pass.DrawIndexedIndirect(CreateIndirectBuffer({10, 1, 0, 0, 0}), 0);
pass.SetIndexBuffer(CreateIndexBuffer({0, 3, 1}), wgpu::IndexFormat::Uint32, 0); pass.SetIndexBuffer(CreateIndexBuffer({0, 3, 1}), wgpu::IndexFormat::Uint32, 0);
pass.DrawIndexedIndirect(CreateIndirectBuffer({3, 1, 3, 0, 0}), 0); pass.DrawIndexedIndirect(CreateIndirectBuffer({3, 1, 3, 0, 0}), 0);
pass.EndPass(); pass.End();
} }
commands = encoder.Finish(); commands = encoder.Finish();
@ -491,7 +491,7 @@ TEST_P(DrawIndexedIndirectTest, ValidateWithBundlesInSamePass) {
{ {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.ExecuteBundles(bundles.size(), bundles.data()); pass.ExecuteBundles(bundles.size(), bundles.data());
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -531,7 +531,7 @@ TEST_P(DrawIndexedIndirectTest, ValidateWithBundlesInDifferentPasses) {
renderPass.renderPassInfo.cColorAttachments[0].loadOp = wgpu::LoadOp::Load; renderPass.renderPassInfo.cColorAttachments[0].loadOp = wgpu::LoadOp::Load;
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.ExecuteBundles(1, &bundle); pass.ExecuteBundles(1, &bundle);
pass.EndPass(); pass.End();
commands[0] = encoder.Finish(); commands[0] = encoder.Finish();
} }
@ -552,7 +552,7 @@ TEST_P(DrawIndexedIndirectTest, ValidateWithBundlesInDifferentPasses) {
renderPass.renderPassInfo.cColorAttachments[0].loadOp = wgpu::LoadOp::Clear; renderPass.renderPassInfo.cColorAttachments[0].loadOp = wgpu::LoadOp::Clear;
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.ExecuteBundles(1, &bundle); pass.ExecuteBundles(1, &bundle);
pass.EndPass(); pass.End();
commands[1] = encoder.Finish(); commands[1] = encoder.Finish();
} }
@ -627,14 +627,14 @@ TEST_P(DrawIndexedIndirectTest, ValidateReusedBundleWithChangingParams) {
pass.SetPipeline(computePipeline); pass.SetPipeline(computePipeline);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Dispatch(1); pass.Dispatch(1);
pass.EndPass(); pass.End();
}; };
auto encodeRenderPassToExecuteBundle = [&](wgpu::LoadOp colorLoadOp) { auto encodeRenderPassToExecuteBundle = [&](wgpu::LoadOp colorLoadOp) {
renderPass.renderPassInfo.cColorAttachments[0].loadOp = colorLoadOp; renderPass.renderPassInfo.cColorAttachments[0].loadOp = colorLoadOp;
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.ExecuteBundles(1, &bundle); pass.ExecuteBundles(1, &bundle);
pass.EndPass(); pass.End();
}; };
encodeComputePassToUpdateFirstIndex(0); encodeComputePassToUpdateFirstIndex(0);

View File

@ -111,7 +111,7 @@ class DrawIndexedTest : public DawnTest {
pass.SetVertexBuffer(0, vertexBuffer); pass.SetVertexBuffer(0, vertexBuffer);
pass.SetIndexBuffer(curIndexBuffer, wgpu::IndexFormat::Uint32, bufferOffset); pass.SetIndexBuffer(curIndexBuffer, wgpu::IndexFormat::Uint32, bufferOffset);
pass.DrawIndexed(indexCount, instanceCount, firstIndex, baseVertex, firstInstance); pass.DrawIndexed(indexCount, instanceCount, firstIndex, baseVertex, firstInstance);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();

View File

@ -76,7 +76,7 @@ class DrawIndirectTest : public DawnTest {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetVertexBuffer(0, vertexBuffer); pass.SetVertexBuffer(0, vertexBuffer);
pass.DrawIndirect(indirectBuffer, indirectOffset); pass.DrawIndirect(indirectBuffer, indirectOffset);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();

View File

@ -74,7 +74,7 @@ class DrawTest : public DawnTest {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetVertexBuffer(0, vertexBuffer); pass.SetVertexBuffer(0, vertexBuffer);
pass.Draw(vertexCount, instanceCount, firstIndex, firstInstance); pass.Draw(vertexCount, instanceCount, firstIndex, firstInstance);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();

View File

@ -220,7 +220,7 @@ TEST_P(DynamicBufferOffsetTests, BasicRenderPipeline) {
renderPassEncoder.SetPipeline(pipeline); renderPassEncoder.SetPipeline(pipeline);
renderPassEncoder.SetBindGroup(0, mBindGroups[0], offsets.size(), offsets.data()); renderPassEncoder.SetBindGroup(0, mBindGroups[0], offsets.size(), offsets.data());
renderPassEncoder.Draw(3); renderPassEncoder.Draw(3);
renderPassEncoder.EndPass(); renderPassEncoder.End();
wgpu::CommandBuffer commands = commandEncoder.Finish(); wgpu::CommandBuffer commands = commandEncoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -242,7 +242,7 @@ TEST_P(DynamicBufferOffsetTests, SetDynamicOffsetsRenderPipeline) {
renderPassEncoder.SetPipeline(pipeline); renderPassEncoder.SetPipeline(pipeline);
renderPassEncoder.SetBindGroup(0, mBindGroups[0], offsets.size(), offsets.data()); renderPassEncoder.SetBindGroup(0, mBindGroups[0], offsets.size(), offsets.data());
renderPassEncoder.Draw(3); renderPassEncoder.Draw(3);
renderPassEncoder.EndPass(); renderPassEncoder.End();
wgpu::CommandBuffer commands = commandEncoder.Finish(); wgpu::CommandBuffer commands = commandEncoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -263,7 +263,7 @@ TEST_P(DynamicBufferOffsetTests, BasicComputePipeline) {
computePassEncoder.SetPipeline(pipeline); computePassEncoder.SetPipeline(pipeline);
computePassEncoder.SetBindGroup(0, mBindGroups[0], offsets.size(), offsets.data()); computePassEncoder.SetBindGroup(0, mBindGroups[0], offsets.size(), offsets.data());
computePassEncoder.Dispatch(1); computePassEncoder.Dispatch(1);
computePassEncoder.EndPass(); computePassEncoder.End();
wgpu::CommandBuffer commands = commandEncoder.Finish(); wgpu::CommandBuffer commands = commandEncoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -283,7 +283,7 @@ TEST_P(DynamicBufferOffsetTests, SetDynamicOffsetsComputePipeline) {
computePassEncoder.SetPipeline(pipeline); computePassEncoder.SetPipeline(pipeline);
computePassEncoder.SetBindGroup(0, mBindGroups[0], offsets.size(), offsets.data()); computePassEncoder.SetBindGroup(0, mBindGroups[0], offsets.size(), offsets.data());
computePassEncoder.Dispatch(1); computePassEncoder.Dispatch(1);
computePassEncoder.EndPass(); computePassEncoder.End();
wgpu::CommandBuffer commands = commandEncoder.Finish(); wgpu::CommandBuffer commands = commandEncoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -311,7 +311,7 @@ TEST_P(DynamicBufferOffsetTests, InheritDynamicOffsetsRenderPipeline) {
renderPassEncoder.SetPipeline(testPipeline); renderPassEncoder.SetPipeline(testPipeline);
renderPassEncoder.SetBindGroup(1, mBindGroups[1]); renderPassEncoder.SetBindGroup(1, mBindGroups[1]);
renderPassEncoder.Draw(3); renderPassEncoder.Draw(3);
renderPassEncoder.EndPass(); renderPassEncoder.End();
wgpu::CommandBuffer commands = commandEncoder.Finish(); wgpu::CommandBuffer commands = commandEncoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -341,7 +341,7 @@ TEST_P(DynamicBufferOffsetTests, InheritDynamicOffsetsComputePipeline) {
computePassEncoder.SetPipeline(testPipeline); computePassEncoder.SetPipeline(testPipeline);
computePassEncoder.SetBindGroup(1, mBindGroups[1]); computePassEncoder.SetBindGroup(1, mBindGroups[1]);
computePassEncoder.Dispatch(1); computePassEncoder.Dispatch(1);
computePassEncoder.EndPass(); computePassEncoder.End();
wgpu::CommandBuffer commands = commandEncoder.Finish(); wgpu::CommandBuffer commands = commandEncoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -369,7 +369,7 @@ TEST_P(DynamicBufferOffsetTests, UpdateDynamicOffsetsMultipleTimesRenderPipeline
renderPassEncoder.Draw(3); renderPassEncoder.Draw(3);
renderPassEncoder.SetBindGroup(0, mBindGroups[0], testOffsets.size(), testOffsets.data()); renderPassEncoder.SetBindGroup(0, mBindGroups[0], testOffsets.size(), testOffsets.data());
renderPassEncoder.Draw(3); renderPassEncoder.Draw(3);
renderPassEncoder.EndPass(); renderPassEncoder.End();
wgpu::CommandBuffer commands = commandEncoder.Finish(); wgpu::CommandBuffer commands = commandEncoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -393,7 +393,7 @@ TEST_P(DynamicBufferOffsetTests, UpdateDynamicOffsetsMultipleTimesComputePipelin
computePassEncoder.Dispatch(1); computePassEncoder.Dispatch(1);
computePassEncoder.SetBindGroup(0, mBindGroups[0], testOffsets.size(), testOffsets.data()); computePassEncoder.SetBindGroup(0, mBindGroups[0], testOffsets.size(), testOffsets.data());
computePassEncoder.Dispatch(1); computePassEncoder.Dispatch(1);
computePassEncoder.EndPass(); computePassEncoder.End();
wgpu::CommandBuffer commands = commandEncoder.Finish(); wgpu::CommandBuffer commands = commandEncoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -563,7 +563,7 @@ TEST_P(ClampedOOBDynamicBufferOffsetTests, CheckOOBAccess) {
computePassEncoder.SetPipeline(pipeline); computePassEncoder.SetPipeline(pipeline);
computePassEncoder.SetBindGroup(0, bindGroup, dynamicOffsets.size(), dynamicOffsets.data()); computePassEncoder.SetBindGroup(0, bindGroup, dynamicOffsets.size(), dynamicOffsets.data());
computePassEncoder.Dispatch(1); computePassEncoder.Dispatch(1);
computePassEncoder.EndPass(); computePassEncoder.End();
wgpu::CommandBuffer commands = commandEncoder.Finish(); wgpu::CommandBuffer commands = commandEncoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);

View File

@ -50,7 +50,7 @@ TEST_P(EntryPointTests, FragAndVertexSameModule) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.Draw(1); pass.Draw(1);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -120,7 +120,7 @@ TEST_P(EntryPointTests, TwoComputeInModule) {
pass.SetPipeline(write1); pass.SetPipeline(write1);
pass.SetBindGroup(0, group); pass.SetBindGroup(0, group);
pass.Dispatch(1); pass.Dispatch(1);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -134,7 +134,7 @@ TEST_P(EntryPointTests, TwoComputeInModule) {
pass.SetPipeline(write42); pass.SetPipeline(write42);
pass.SetBindGroup(0, group); pass.SetBindGroup(0, group);
pass.Dispatch(42); pass.Dispatch(42);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);

View File

@ -96,7 +96,7 @@ TEST_P(ExternalTextureTests, SampleExternalTexture) {
renderPass.cColorAttachments[0].clearColor = {0.0f, 1.0f, 0.0f, 1.0f}; renderPass.cColorAttachments[0].clearColor = {0.0f, 1.0f, 0.0f, 1.0f};
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -136,7 +136,7 @@ TEST_P(ExternalTextureTests, SampleExternalTexture) {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();

View File

@ -223,7 +223,7 @@ struct FragInputs {
default: default:
FAIL(); FAIL();
} }
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);

View File

@ -104,7 +104,7 @@ TEST_P(GpuMemorySyncTests, ComputePass) {
pass.SetPipeline(compute); pass.SetPipeline(compute);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Dispatch(1); pass.Dispatch(1);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -134,7 +134,7 @@ TEST_P(GpuMemorySyncTests, RenderPass) {
pass.SetPipeline(render); pass.SetPipeline(render);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Draw(1); pass.Draw(1);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -161,14 +161,14 @@ TEST_P(GpuMemorySyncTests, RenderPassToComputePass) {
pass0.SetPipeline(render); pass0.SetPipeline(render);
pass0.SetBindGroup(0, bindGroup0); pass0.SetBindGroup(0, bindGroup0);
pass0.Draw(1); pass0.Draw(1);
pass0.EndPass(); pass0.End();
// Read that data in compute pass. // Read that data in compute pass.
wgpu::ComputePassEncoder pass1 = encoder.BeginComputePass(); wgpu::ComputePassEncoder pass1 = encoder.BeginComputePass();
pass1.SetPipeline(compute); pass1.SetPipeline(compute);
pass1.SetBindGroup(0, bindGroup1); pass1.SetBindGroup(0, bindGroup1);
pass1.Dispatch(1); pass1.Dispatch(1);
pass1.EndPass(); pass1.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -194,14 +194,14 @@ TEST_P(GpuMemorySyncTests, ComputePassToRenderPass) {
pass0.SetPipeline(compute); pass0.SetPipeline(compute);
pass0.SetBindGroup(0, bindGroup1); pass0.SetBindGroup(0, bindGroup1);
pass0.Dispatch(1); pass0.Dispatch(1);
pass0.EndPass(); pass0.End();
// Read that data in render pass. // Read that data in render pass.
wgpu::RenderPassEncoder pass1 = encoder.BeginRenderPass(&renderPass.renderPassInfo); wgpu::RenderPassEncoder pass1 = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass1.SetPipeline(render); pass1.SetPipeline(render);
pass1.SetBindGroup(0, bindGroup0); pass1.SetBindGroup(0, bindGroup0);
pass1.Draw(1); pass1.Draw(1);
pass1.EndPass(); pass1.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -294,14 +294,14 @@ TEST_P(StorageToUniformSyncTests, ReadAfterWriteWithSameCommandBuffer) {
pass0.SetPipeline(compute); pass0.SetPipeline(compute);
pass0.SetBindGroup(0, computeBindGroup); pass0.SetBindGroup(0, computeBindGroup);
pass0.Dispatch(1); pass0.Dispatch(1);
pass0.EndPass(); pass0.End();
// Read that data in render pass. // Read that data in render pass.
wgpu::RenderPassEncoder pass1 = encoder0.BeginRenderPass(&renderPass.renderPassInfo); wgpu::RenderPassEncoder pass1 = encoder0.BeginRenderPass(&renderPass.renderPassInfo);
pass1.SetPipeline(render); pass1.SetPipeline(render);
pass1.SetBindGroup(0, renderBindGroup); pass1.SetBindGroup(0, renderBindGroup);
pass1.Draw(1); pass1.Draw(1);
pass1.EndPass(); pass1.End();
wgpu::CommandBuffer commands = encoder0.Finish(); wgpu::CommandBuffer commands = encoder0.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -327,7 +327,7 @@ TEST_P(StorageToUniformSyncTests, ReadAfterWriteWithDifferentCommandBuffers) {
pass0.SetPipeline(compute); pass0.SetPipeline(compute);
pass0.SetBindGroup(0, computeBindGroup); pass0.SetBindGroup(0, computeBindGroup);
pass0.Dispatch(1); pass0.Dispatch(1);
pass0.EndPass(); pass0.End();
cb[0] = encoder0.Finish(); cb[0] = encoder0.Finish();
// Read that data in render pass. // Read that data in render pass.
@ -336,7 +336,7 @@ TEST_P(StorageToUniformSyncTests, ReadAfterWriteWithDifferentCommandBuffers) {
pass1.SetPipeline(render); pass1.SetPipeline(render);
pass1.SetBindGroup(0, renderBindGroup); pass1.SetBindGroup(0, renderBindGroup);
pass1.Draw(1); pass1.Draw(1);
pass1.EndPass(); pass1.End();
cb[1] = encoder1.Finish(); cb[1] = encoder1.Finish();
queue.Submit(2, cb); queue.Submit(2, cb);
@ -362,7 +362,7 @@ TEST_P(StorageToUniformSyncTests, ReadAfterWriteWithDifferentQueueSubmits) {
pass0.SetPipeline(compute); pass0.SetPipeline(compute);
pass0.SetBindGroup(0, computeBindGroup); pass0.SetBindGroup(0, computeBindGroup);
pass0.Dispatch(1); pass0.Dispatch(1);
pass0.EndPass(); pass0.End();
cb[0] = encoder0.Finish(); cb[0] = encoder0.Finish();
queue.Submit(1, &cb[0]); queue.Submit(1, &cb[0]);
@ -372,7 +372,7 @@ TEST_P(StorageToUniformSyncTests, ReadAfterWriteWithDifferentQueueSubmits) {
pass1.SetPipeline(render); pass1.SetPipeline(render);
pass1.SetBindGroup(0, renderBindGroup); pass1.SetBindGroup(0, renderBindGroup);
pass1.Draw(1); pass1.Draw(1);
pass1.EndPass(); pass1.End();
cb[1] = encoder1.Finish(); cb[1] = encoder1.Finish();
queue.Submit(1, &cb[1]); queue.Submit(1, &cb[1]);
@ -466,7 +466,7 @@ TEST_P(MultipleWriteThenMultipleReadTests, SeparateBuffers) {
pass0.SetPipeline(cp); pass0.SetPipeline(cp);
pass0.SetBindGroup(0, bindGroup0); pass0.SetBindGroup(0, bindGroup0);
pass0.Dispatch(1); pass0.Dispatch(1);
pass0.EndPass(); pass0.End();
// Create pipeline, bind group, and reuse buffers in render pass. // Create pipeline, bind group, and reuse buffers in render pass.
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
@ -511,7 +511,7 @@ TEST_P(MultipleWriteThenMultipleReadTests, SeparateBuffers) {
pass1.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint32, 0); pass1.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint32, 0);
pass1.SetBindGroup(0, bindGroup1); pass1.SetBindGroup(0, bindGroup1);
pass1.DrawIndexed(6); pass1.DrawIndexed(6);
pass1.EndPass(); pass1.End();
wgpu::CommandBuffer commandBuffer = encoder.Finish(); wgpu::CommandBuffer commandBuffer = encoder.Finish();
queue.Submit(1, &commandBuffer); queue.Submit(1, &commandBuffer);
@ -583,7 +583,7 @@ TEST_P(MultipleWriteThenMultipleReadTests, OneBuffer) {
pass0.SetPipeline(cp); pass0.SetPipeline(cp);
pass0.SetBindGroup(0, bindGroup0); pass0.SetBindGroup(0, bindGroup0);
pass0.Dispatch(1); pass0.Dispatch(1);
pass0.EndPass(); pass0.End();
// Create pipeline, bind group, and reuse the buffer in render pass. // Create pipeline, bind group, and reuse the buffer in render pass.
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
@ -629,7 +629,7 @@ TEST_P(MultipleWriteThenMultipleReadTests, OneBuffer) {
pass1.SetIndexBuffer(buffer, wgpu::IndexFormat::Uint32, offsetof(Data, indices)); pass1.SetIndexBuffer(buffer, wgpu::IndexFormat::Uint32, offsetof(Data, indices));
pass1.SetBindGroup(0, bindGroup1); pass1.SetBindGroup(0, bindGroup1);
pass1.DrawIndexed(6); pass1.DrawIndexed(6);
pass1.EndPass(); pass1.End();
wgpu::CommandBuffer commandBuffer = encoder.Finish(); wgpu::CommandBuffer commandBuffer = encoder.Finish();
queue.Submit(1, &commandBuffer); queue.Submit(1, &commandBuffer);

View File

@ -323,7 +323,7 @@ class IOSurfaceUsageTests : public IOSurfaceTestBase {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -356,7 +356,7 @@ class IOSurfaceUsageTests : public IOSurfaceTestBase {
// Execute commands to clear the ioSurface // Execute commands to clear the ioSurface
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPassDescriptor); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPassDescriptor);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);

View File

@ -86,7 +86,7 @@ TEST_P(IndexFormatTest, Uint32) {
pass.SetVertexBuffer(0, vertexBuffer); pass.SetVertexBuffer(0, vertexBuffer);
pass.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint32); pass.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint32);
pass.DrawIndexed(3); pass.DrawIndexed(3);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -113,7 +113,7 @@ TEST_P(IndexFormatTest, Uint16) {
pass.SetVertexBuffer(0, vertexBuffer); pass.SetVertexBuffer(0, vertexBuffer);
pass.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint16); pass.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint16);
pass.DrawIndexed(3); pass.DrawIndexed(3);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -145,7 +145,7 @@ TEST_P(IndexFormatTest, ChangePipelineAfterSetIndexBuffer) {
pass.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint32); pass.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint32);
pass.SetPipeline(pipeline32); pass.SetPipeline(pipeline32);
pass.DrawIndexed(3); pass.DrawIndexed(3);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -173,7 +173,7 @@ TEST_P(IndexFormatTest, SetIndexBufferBeforeSetPipeline) {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetVertexBuffer(0, vertexBuffer); pass.SetVertexBuffer(0, vertexBuffer);
pass.DrawIndexed(3); pass.DrawIndexed(3);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -203,7 +203,7 @@ TEST_P(IndexFormatTest, SetIndexBufferDifferentFormats) {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetVertexBuffer(0, vertexBuffer); pass.SetVertexBuffer(0, vertexBuffer);
pass.DrawIndexed(3); pass.DrawIndexed(3);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -218,7 +218,7 @@ TEST_P(IndexFormatTest, SetIndexBufferDifferentFormats) {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetVertexBuffer(0, vertexBuffer); pass.SetVertexBuffer(0, vertexBuffer);
pass.DrawIndexed(3); pass.DrawIndexed(3);
pass.EndPass(); pass.End();
} }
commands = encoder.Finish(); commands = encoder.Finish();
@ -280,7 +280,7 @@ TEST_P(TriangleStripPrimitiveRestartTests, Uint32PrimitiveRestart) {
pass.SetVertexBuffer(0, mVertexBuffer); pass.SetVertexBuffer(0, mVertexBuffer);
pass.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint32); pass.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint32);
pass.DrawIndexed(7); pass.DrawIndexed(7);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -315,7 +315,7 @@ TEST_P(TriangleStripPrimitiveRestartTests, Uint32WithoutPrimitiveRestart) {
pass.SetVertexBuffer(0, mVertexBuffer); pass.SetVertexBuffer(0, mVertexBuffer);
pass.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint32); pass.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint32);
pass.DrawIndexed(7); pass.DrawIndexed(7);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -351,7 +351,7 @@ TEST_P(TriangleStripPrimitiveRestartTests, Uint16PrimitiveRestart) {
pass.SetVertexBuffer(0, mVertexBuffer); pass.SetVertexBuffer(0, mVertexBuffer);
pass.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint16); pass.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint16);
pass.DrawIndexed(7); pass.DrawIndexed(7);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -405,7 +405,7 @@ TEST_P(LineStripPrimitiveRestartTests, Uint32PrimitiveRestart) {
pass.SetVertexBuffer(0, mVertexBuffer); pass.SetVertexBuffer(0, mVertexBuffer);
pass.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint32); pass.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint32);
pass.DrawIndexed(5); pass.DrawIndexed(5);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -434,7 +434,7 @@ TEST_P(LineStripPrimitiveRestartTests, Uint32WithoutPrimitiveRestart) {
pass.SetVertexBuffer(0, mVertexBuffer); pass.SetVertexBuffer(0, mVertexBuffer);
pass.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint32); pass.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint32);
pass.DrawIndexed(5); pass.DrawIndexed(5);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -461,7 +461,7 @@ TEST_P(LineStripPrimitiveRestartTests, Uint16PrimitiveRestart) {
pass.SetVertexBuffer(0, mVertexBuffer); pass.SetVertexBuffer(0, mVertexBuffer);
pass.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint16); pass.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint16);
pass.DrawIndexed(5); pass.DrawIndexed(5);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();

View File

@ -89,7 +89,7 @@ TEST_P(MaxLimitTests, MaxComputeWorkgroupStorageSize) {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Dispatch(1); pass.Dispatch(1);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -223,7 +223,7 @@ TEST_P(MaxLimitTests, MaxBufferBindingSize) {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Dispatch(1); pass.Dispatch(1);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);

View File

@ -135,7 +135,7 @@ class MultisampledRenderingTest : public DawnTest {
renderPassEncoder.SetPipeline(pipeline); renderPassEncoder.SetPipeline(pipeline);
renderPassEncoder.SetBindGroup(0, bindGroup); renderPassEncoder.SetBindGroup(0, bindGroup);
renderPassEncoder.Draw(3); renderPassEncoder.Draw(3);
renderPassEncoder.EndPass(); renderPassEncoder.End();
} }
void EncodeRenderPassForTest(wgpu::CommandEncoder commandEncoder, void EncodeRenderPassForTest(wgpu::CommandEncoder commandEncoder,
@ -407,7 +407,7 @@ TEST_P(MultisampledRenderingTest, ResolveInAnotherRenderPass) {
kTestDepth); kTestDepth);
wgpu::RenderPassEncoder renderPassEncoder = commandEncoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder renderPassEncoder = commandEncoder.BeginRenderPass(&renderPass);
renderPassEncoder.EndPass(); renderPassEncoder.End();
} }
wgpu::CommandBuffer commandBuffer = commandEncoder.Finish(); wgpu::CommandBuffer commandBuffer = commandEncoder.Finish();
@ -484,7 +484,7 @@ TEST_P(MultisampledRenderingTest, ResolveOneMultisampledTextureTwice) {
kTestDepth); kTestDepth);
wgpu::RenderPassEncoder renderPassEncoder = commandEncoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder renderPassEncoder = commandEncoder.BeginRenderPass(&renderPass);
renderPassEncoder.EndPass(); renderPassEncoder.End();
} }
wgpu::CommandBuffer commandBuffer = commandEncoder.Finish(); wgpu::CommandBuffer commandBuffer = commandEncoder.Finish();

View File

@ -205,7 +205,7 @@ TEST_P(MultisampledSamplingTest, SamplePositions) {
renderPassEncoder.SetVertexBuffer(0, vBuffer, kQuadNumBytes * sampleOffset, renderPassEncoder.SetVertexBuffer(0, vBuffer, kQuadNumBytes * sampleOffset,
kQuadNumBytes); kQuadNumBytes);
renderPassEncoder.Draw(4); renderPassEncoder.Draw(4);
renderPassEncoder.EndPass(); renderPassEncoder.End();
wgpu::ComputePassEncoder computePassEncoder = commandEncoder.BeginComputePass(); wgpu::ComputePassEncoder computePassEncoder = commandEncoder.BeginComputePass();
computePassEncoder.SetPipeline(checkSamplePipeline); computePassEncoder.SetPipeline(checkSamplePipeline);
@ -216,7 +216,7 @@ TEST_P(MultisampledSamplingTest, SamplePositions) {
{1, depthView}, {1, depthView},
{2, outputBuffer, alignedResultSize * sampleOffset, kResultSize}})); {2, outputBuffer, alignedResultSize * sampleOffset, kResultSize}}));
computePassEncoder.Dispatch(1); computePassEncoder.Dispatch(1);
computePassEncoder.EndPass(); computePassEncoder.End();
} }
} }

View File

@ -140,7 +140,7 @@ TEST_P(OpArrayLengthTest, Compute) {
pass.SetBindGroup(0, mBindGroup); pass.SetBindGroup(0, mBindGroup);
pass.SetBindGroup(1, resultBindGroup); pass.SetBindGroup(1, resultBindGroup);
pass.Dispatch(1); pass.Dispatch(1);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -189,7 +189,7 @@ TEST_P(OpArrayLengthTest, Fragment) {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetBindGroup(0, mBindGroup); pass.SetBindGroup(0, mBindGroup);
pass.Draw(1); pass.Draw(1);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -249,7 +249,7 @@ TEST_P(OpArrayLengthTest, Vertex) {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetBindGroup(0, mBindGroup); pass.SetBindGroup(0, mBindGroup);
pass.Draw(1); pass.Draw(1);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();

View File

@ -129,7 +129,7 @@ class DepthClampingTest : public DawnTest {
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Draw(1); pass.Draw(1);
} }
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);

View File

@ -207,7 +207,7 @@ class PrimitiveTopologyTest : public DawnTest {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetVertexBuffer(0, vertexBuffer); pass.SetVertexBuffer(0, vertexBuffer);
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();

View File

@ -164,7 +164,7 @@ class OcclusionQueryTests : public QueryTests {
pass.BeginOcclusionQuery(0); pass.BeginOcclusionQuery(0);
pass.Draw(3); pass.Draw(3);
pass.EndOcclusionQuery(); pass.EndOcclusionQuery();
pass.EndPass(); pass.End();
encoder.ResolveQuerySet(querySet, 0, kQueryCount, destination, 0); encoder.ResolveQuerySet(querySet, 0, kQueryCount, destination, 0);
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -193,7 +193,7 @@ class OcclusionQueryTests : public QueryTests {
pass.BeginOcclusionQuery(0); pass.BeginOcclusionQuery(0);
pass.Draw(3); pass.Draw(3);
pass.EndOcclusionQuery(); pass.EndOcclusionQuery();
pass.EndPass(); pass.End();
encoder.ResolveQuerySet(querySet, 0, kQueryCount, destination, 0); encoder.ResolveQuerySet(querySet, 0, kQueryCount, destination, 0);
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -281,7 +281,7 @@ TEST_P(OcclusionQueryTests, Rewrite) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.BeginOcclusionQuery(0); pass.BeginOcclusionQuery(0);
pass.EndOcclusionQuery(); pass.EndOcclusionQuery();
pass.EndPass(); pass.End();
// Begin occlusion with same query index with draw call // Begin occlusion with same query index with draw call
wgpu::RenderPassEncoder rewritePass = encoder.BeginRenderPass(&renderPass.renderPassInfo); wgpu::RenderPassEncoder rewritePass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
@ -289,7 +289,7 @@ TEST_P(OcclusionQueryTests, Rewrite) {
rewritePass.BeginOcclusionQuery(0); rewritePass.BeginOcclusionQuery(0);
rewritePass.Draw(3); rewritePass.Draw(3);
rewritePass.EndOcclusionQuery(); rewritePass.EndOcclusionQuery();
rewritePass.EndPass(); rewritePass.End();
encoder.ResolveQuerySet(querySet, 0, kQueryCount, destination, 0); encoder.ResolveQuerySet(querySet, 0, kQueryCount, destination, 0);
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -346,7 +346,7 @@ TEST_P(OcclusionQueryTests, ResolveSparseQueries) {
pass.BeginOcclusionQuery(5); pass.BeginOcclusionQuery(5);
pass.Draw(3); pass.Draw(3);
pass.EndOcclusionQuery(); pass.EndOcclusionQuery();
pass.EndPass(); pass.End();
encoder.ResolveQuerySet(querySet, 0, kQueryCount, destination, 0); encoder.ResolveQuerySet(querySet, 0, kQueryCount, destination, 0);
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -403,7 +403,7 @@ TEST_P(OcclusionQueryTests, ResolveToBufferWithOffset) {
pass.BeginOcclusionQuery(0); pass.BeginOcclusionQuery(0);
pass.Draw(3); pass.Draw(3);
pass.EndOcclusionQuery(); pass.EndOcclusionQuery();
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -601,7 +601,7 @@ TEST_P(TimestampQueryTests, TimestampOnRenderPass) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.WriteTimestamp(querySet, 0); pass.WriteTimestamp(querySet, 0);
pass.WriteTimestamp(querySet, 1); pass.WriteTimestamp(querySet, 1);
pass.EndPass(); pass.End();
encoder.ResolveQuerySet(querySet, 0, kQueryCount, destination, 0); encoder.ResolveQuerySet(querySet, 0, kQueryCount, destination, 0);
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -623,7 +623,7 @@ TEST_P(TimestampQueryTests, TimestampOnRenderPass) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.WriteTimestamp(querySet, 0); pass.WriteTimestamp(querySet, 0);
pass.WriteTimestamp(querySet, 1); pass.WriteTimestamp(querySet, 1);
pass.EndPass(); pass.End();
encoder.ResolveQuerySet(querySet, 0, kQueryCount, destination, 0); encoder.ResolveQuerySet(querySet, 0, kQueryCount, destination, 0);
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -645,7 +645,7 @@ TEST_P(TimestampQueryTests, TimestampOnComputePass) {
wgpu::ComputePassEncoder pass = encoder.BeginComputePass(); wgpu::ComputePassEncoder pass = encoder.BeginComputePass();
pass.WriteTimestamp(querySet, 0); pass.WriteTimestamp(querySet, 0);
pass.WriteTimestamp(querySet, 1); pass.WriteTimestamp(querySet, 1);
pass.EndPass(); pass.End();
encoder.ResolveQuerySet(querySet, 0, kQueryCount, destination, 0); encoder.ResolveQuerySet(querySet, 0, kQueryCount, destination, 0);
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -665,7 +665,7 @@ TEST_P(TimestampQueryTests, TimestampOnComputePass) {
wgpu::ComputePassEncoder pass = encoder.BeginComputePass(); wgpu::ComputePassEncoder pass = encoder.BeginComputePass();
pass.WriteTimestamp(querySet, 0); pass.WriteTimestamp(querySet, 0);
pass.WriteTimestamp(querySet, 1); pass.WriteTimestamp(querySet, 1);
pass.EndPass(); pass.End();
encoder.ResolveQuerySet(querySet, 0, kQueryCount, destination, 0); encoder.ResolveQuerySet(querySet, 0, kQueryCount, destination, 0);
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -685,7 +685,7 @@ TEST_P(TimestampQueryTests, TimestampOnComputePass) {
pass.WriteTimestamp(querySet, 1); pass.WriteTimestamp(querySet, 1);
pass.WriteTimestamp(querySet, 0); pass.WriteTimestamp(querySet, 0);
pass.WriteTimestamp(querySet, 1); pass.WriteTimestamp(querySet, 1);
pass.EndPass(); pass.End();
encoder.ResolveQuerySet(querySet, 0, kQueryCount, destination, 0); encoder.ResolveQuerySet(querySet, 0, kQueryCount, destination, 0);
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();

View File

@ -156,7 +156,7 @@ class ReadOnlyDepthStencilAttachmentTests
passDescriptorInit.cDepthStencilAttachmentInfo.clearStencil = values->stencilInitValue; passDescriptorInit.cDepthStencilAttachmentInfo.clearStencil = values->stencilInitValue;
} }
wgpu::RenderPassEncoder passInit = commandEncoder.BeginRenderPass(&passDescriptorInit); wgpu::RenderPassEncoder passInit = commandEncoder.BeginRenderPass(&passDescriptorInit);
passInit.EndPass(); passInit.End();
// Note that we can only select one single aspect for texture view used in bind group. // Note that we can only select one single aspect for texture view used in bind group.
wgpu::TextureViewDescriptor viewDesc = {}; wgpu::TextureViewDescriptor viewDesc = {};
@ -198,7 +198,7 @@ class ReadOnlyDepthStencilAttachmentTests
pass.SetStencilReference(values->stencilRefValue); pass.SetStencilReference(values->stencilRefValue);
} }
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = commandEncoder.Finish(); wgpu::CommandBuffer commands = commandEncoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);

View File

@ -68,7 +68,7 @@ TEST_P(RenderAttachmentTest, MoreFragmentOutputsThanAttachments) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.Draw(1); pass.Draw(1);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);

View File

@ -108,7 +108,7 @@ TEST_P(RenderBundleTest, Basic) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.ExecuteBundles(1, &renderBundle); pass.ExecuteBundles(1, &renderBundle);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -149,7 +149,7 @@ TEST_P(RenderBundleTest, MultipleBundles) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.ExecuteBundles(2, renderBundles); pass.ExecuteBundles(2, renderBundles);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -184,7 +184,7 @@ TEST_P(RenderBundleTest, BundleAndRenderPassCommands) {
pass.Draw(3, 1, 3); pass.Draw(3, 1, 3);
pass.ExecuteBundles(1, &renderBundle); pass.ExecuteBundles(1, &renderBundle);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);

View File

@ -115,7 +115,7 @@ class RenderPassLoadOpTests : public DawnTest {
renderPassDescriptor.cColorAttachments[0].clearColor = clearColor; renderPassDescriptor.cColorAttachments[0].clearColor = clearColor;
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder renderPass = encoder.BeginRenderPass(&renderPassDescriptor); wgpu::RenderPassEncoder renderPass = encoder.BeginRenderPass(&renderPassDescriptor);
renderPass.EndPass(); renderPass.End();
const uint64_t bufferSize = sizeof(T) * expectedPixelValue.size(); const uint64_t bufferSize = sizeof(T) * expectedPixelValue.size();
wgpu::BufferDescriptor bufferDescriptor; wgpu::BufferDescriptor bufferDescriptor;
@ -152,14 +152,14 @@ TEST_P(RenderPassLoadOpTests, ColorClearThenLoadAndDraw) {
utils::ComboRenderPassDescriptor renderPassClearZero({renderTargetView}); utils::ComboRenderPassDescriptor renderPassClearZero({renderTargetView});
auto commandsClearZeroEncoder = device.CreateCommandEncoder(); auto commandsClearZeroEncoder = device.CreateCommandEncoder();
auto clearZeroPass = commandsClearZeroEncoder.BeginRenderPass(&renderPassClearZero); auto clearZeroPass = commandsClearZeroEncoder.BeginRenderPass(&renderPassClearZero);
clearZeroPass.EndPass(); clearZeroPass.End();
auto commandsClearZero = commandsClearZeroEncoder.Finish(); auto commandsClearZero = commandsClearZeroEncoder.Finish();
utils::ComboRenderPassDescriptor renderPassClearGreen({renderTargetView}); utils::ComboRenderPassDescriptor renderPassClearGreen({renderTargetView});
renderPassClearGreen.cColorAttachments[0].clearColor = {0.0f, 1.0f, 0.0f, 1.0f}; renderPassClearGreen.cColorAttachments[0].clearColor = {0.0f, 1.0f, 0.0f, 1.0f};
auto commandsClearGreenEncoder = device.CreateCommandEncoder(); auto commandsClearGreenEncoder = device.CreateCommandEncoder();
auto clearGreenPass = commandsClearGreenEncoder.BeginRenderPass(&renderPassClearGreen); auto clearGreenPass = commandsClearGreenEncoder.BeginRenderPass(&renderPassClearGreen);
clearGreenPass.EndPass(); clearGreenPass.End();
auto commandsClearGreen = commandsClearGreenEncoder.Finish(); auto commandsClearGreen = commandsClearGreenEncoder.Finish();
queue.Submit(1, &commandsClearZero); queue.Submit(1, &commandsClearZero);
@ -176,7 +176,7 @@ TEST_P(RenderPassLoadOpTests, ColorClearThenLoadAndDraw) {
auto encoder = device.CreateCommandEncoder(); auto encoder = device.CreateCommandEncoder();
auto pass = encoder.BeginRenderPass(&renderPassLoad); auto pass = encoder.BeginRenderPass(&renderPassLoad);
blueQuad.Draw(&pass); blueQuad.Draw(&pass);
pass.EndPass(); pass.End();
commandsLoad = encoder.Finish(); commandsLoad = encoder.Finish();
} }

View File

@ -89,7 +89,7 @@ TEST_P(RenderPassTest, TwoRenderPassesInOneCommandBuffer) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
} }
{ {
@ -101,7 +101,7 @@ TEST_P(RenderPassTest, TwoRenderPassesInOneCommandBuffer) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -154,7 +154,7 @@ TEST_P(RenderPassTest, NoCorrespondingFragmentShaderOutputs) {
pass.Draw(3); pass.Draw(3);
} }
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);

View File

@ -194,7 +194,7 @@ class SamplerFilterAnisotropicTest : public DawnTest {
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.SetVertexBuffer(0, vertexBuffer); pass.SetVertexBuffer(0, vertexBuffer);
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();

View File

@ -139,7 +139,7 @@ class SamplerTest : public DawnTest {
pass.SetPipeline(mPipeline); pass.SetPipeline(mPipeline);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();

View File

@ -57,7 +57,7 @@ TEST_P(ScissorTest, DefaultsToWholeRenderTarget) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -85,7 +85,7 @@ TEST_P(ScissorTest, PartialRect) {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetScissorRect(kX, kY, kW, kH); pass.SetScissorRect(kX, kY, kW, kH);
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -110,7 +110,7 @@ TEST_P(ScissorTest, EmptyRect) {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetScissorRect(1, 1, 0, 0); pass.SetScissorRect(1, 1, 0, 0);
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -132,14 +132,14 @@ TEST_P(ScissorTest, NoInheritanceBetweenRenderPass) {
{ {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetScissorRect(1, 1, 1, 1); pass.SetScissorRect(1, 1, 1, 1);
pass.EndPass(); pass.End();
} }
// RenderPass 2 draw a full quad, it shouldn't be scissored // RenderPass 2 draw a full quad, it shouldn't be scissored
{ {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();

View File

@ -162,7 +162,7 @@ TEST_P(ShaderFloat16Tests, DISABLED_Basic16BitFloatFeaturesTest) {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Dispatch(1); pass.Dispatch(1);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);

View File

@ -92,7 +92,7 @@ struct Buf {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Dispatch(1); pass.Dispatch(1);
pass.EndPass(); pass.End();
commands = encoder.Finish(); commands = encoder.Finish();
} }
@ -457,7 +457,7 @@ struct Buf {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Dispatch(1); pass.Dispatch(1);
pass.EndPass(); pass.End();
commands = encoder.Finish(); commands = encoder.Finish();
} }
@ -513,7 +513,7 @@ struct Buf {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Dispatch(1); pass.Dispatch(1);
pass.EndPass(); pass.End();
commands = encoder.Finish(); commands = encoder.Finish();
} }
@ -565,7 +565,7 @@ struct Buf {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Dispatch(1); pass.Dispatch(1);
pass.EndPass(); pass.End();
commands = encoder.Finish(); commands = encoder.Finish();
} }
@ -661,7 +661,7 @@ struct Buf {
pass.SetBindGroup(0, bindGroup3); pass.SetBindGroup(0, bindGroup3);
pass.Dispatch(1); pass.Dispatch(1);
pass.EndPass(); pass.End();
commands = encoder.Finish(); commands = encoder.Finish();
} }
@ -725,7 +725,7 @@ fn main(@builtin(vertex_index) VertexIndex : u32)
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);

View File

@ -480,7 +480,7 @@ fn IsEqualTo(pixel : vec4<f32>, expected : vec4<f32>) -> bool {
renderPassEncoder.SetBindGroup(0, bindGroup); renderPassEncoder.SetBindGroup(0, bindGroup);
renderPassEncoder.SetPipeline(pipeline); renderPassEncoder.SetPipeline(pipeline);
renderPassEncoder.Draw(1); renderPassEncoder.Draw(1);
renderPassEncoder.EndPass(); renderPassEncoder.End();
wgpu::CommandBuffer commandBuffer = encoder.Finish(); wgpu::CommandBuffer commandBuffer = encoder.Finish();
queue.Submit(1, &commandBuffer); queue.Submit(1, &commandBuffer);
@ -514,7 +514,7 @@ fn IsEqualTo(pixel : vec4<f32>, expected : vec4<f32>) -> bool {
computeEncoder.SetBindGroup(0, bindGroup); computeEncoder.SetBindGroup(0, bindGroup);
computeEncoder.SetPipeline(pipeline); computeEncoder.SetPipeline(pipeline);
computeEncoder.Dispatch(1); computeEncoder.Dispatch(1);
computeEncoder.EndPass(); computeEncoder.End();
wgpu::CommandBuffer commandBuffer = encoder.Finish(); wgpu::CommandBuffer commandBuffer = encoder.Finish();
queue.Submit(1, &commandBuffer); queue.Submit(1, &commandBuffer);
@ -543,7 +543,7 @@ fn IsEqualTo(pixel : vec4<f32>, expected : vec4<f32>) -> bool {
renderPassEncoder.SetBindGroup(0, bindGroup); renderPassEncoder.SetBindGroup(0, bindGroup);
renderPassEncoder.SetPipeline(pipeline); renderPassEncoder.SetPipeline(pipeline);
renderPassEncoder.Draw(1); renderPassEncoder.Draw(1);
renderPassEncoder.EndPass(); renderPassEncoder.End();
wgpu::CommandBuffer commandBuffer = encoder.Finish(); wgpu::CommandBuffer commandBuffer = encoder.Finish();
queue.Submit(1, &commandBuffer); queue.Submit(1, &commandBuffer);
} }
@ -565,7 +565,7 @@ fn IsEqualTo(pixel : vec4<f32>, expected : vec4<f32>) -> bool {
computePassEncoder.SetBindGroup(0, bindGroup); computePassEncoder.SetBindGroup(0, bindGroup);
computePassEncoder.SetPipeline(pipeline); computePassEncoder.SetPipeline(pipeline);
computePassEncoder.Dispatch(1); computePassEncoder.Dispatch(1);
computePassEncoder.EndPass(); computePassEncoder.End();
wgpu::CommandBuffer commandBuffer = encoder.Finish(); wgpu::CommandBuffer commandBuffer = encoder.Finish();
queue.Submit(1, &commandBuffer); queue.Submit(1, &commandBuffer);
} }
@ -589,7 +589,7 @@ fn IsEqualTo(pixel : vec4<f32>, expected : vec4<f32>) -> bool {
computePassEncoder.SetBindGroup(0, bindGroup); computePassEncoder.SetBindGroup(0, bindGroup);
computePassEncoder.SetPipeline(pipeline); computePassEncoder.SetPipeline(pipeline);
computePassEncoder.Dispatch(1); computePassEncoder.Dispatch(1);
computePassEncoder.EndPass(); computePassEncoder.End();
wgpu::CommandBuffer commandBuffer = encoder.Finish(); wgpu::CommandBuffer commandBuffer = encoder.Finish();
queue.Submit(1, &commandBuffer); queue.Submit(1, &commandBuffer);
} }
@ -836,7 +836,7 @@ TEST_P(StorageTextureTests, SampledAndWriteonlyStorageTexturePingPong) {
pass.SetBindGroup(0, bindGroupB); pass.SetBindGroup(0, bindGroupB);
pass.Dispatch(1); pass.Dispatch(1);
pass.EndPass(); pass.End();
wgpu::BufferDescriptor bufferDescriptor; wgpu::BufferDescriptor bufferDescriptor;
bufferDescriptor.size = sizeof(uint32_t); bufferDescriptor.size = sizeof(uint32_t);

View File

@ -71,7 +71,7 @@ class SubresourceRenderAttachmentTest : public DawnTest {
wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder(); wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder passEncoder = commandEncoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder passEncoder = commandEncoder.BeginRenderPass(&renderPass);
passEncoder.EndPass(); passEncoder.End();
wgpu::CommandBuffer commands = commandEncoder.Finish(); wgpu::CommandBuffer commands = commandEncoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);

View File

@ -74,7 +74,7 @@ class SwapChainTests : public DawnTest {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&desc); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&desc);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);

View File

@ -90,7 +90,7 @@ class SwapChainValidationTests : public DawnTest {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPassDesc); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPassDesc);
pass.EndPass(); pass.End();
if (errorAtFinish) { if (errorAtFinish) {
ASSERT_DEVICE_ERROR(encoder.Finish()); ASSERT_DEVICE_ERROR(encoder.Finish());
@ -264,7 +264,7 @@ TEST_P(SwapChainValidationTests, ReturnedViewCharacteristics) {
utils::ComboRenderPassDescriptor renderPassDesc({view, secondTexture.CreateView()}); utils::ComboRenderPassDescriptor renderPassDesc({view, secondTexture.CreateView()});
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPassDesc); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPassDesc);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);

View File

@ -102,7 +102,7 @@ TEST_P(Texture3DTests, Sampling) {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);

View File

@ -244,7 +244,7 @@ class TextureFormatTest : public DawnTest {
renderPass.SetPipeline(pipeline); renderPass.SetPipeline(pipeline);
renderPass.SetBindGroup(0, bindGroup); renderPass.SetBindGroup(0, bindGroup);
renderPass.Draw(3); renderPass.Draw(3);
renderPass.EndPass(); renderPass.End();
{ {
wgpu::ImageCopyBuffer bufferView = utils::CreateImageCopyBuffer(readbackBuffer, 0, 256); wgpu::ImageCopyBuffer bufferView = utils::CreateImageCopyBuffer(readbackBuffer, 0, 256);

View File

@ -80,7 +80,7 @@ class TextureSubresourceTest : public DawnTest {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPassDesc); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPassDesc);
pass.SetPipeline(rp); pass.SetPipeline(rp);
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
} }
@ -130,7 +130,7 @@ class TextureSubresourceTest : public DawnTest {
pass.SetPipeline(rp); pass.SetPipeline(rp);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
} }

View File

@ -186,7 +186,7 @@ class TextureViewSamplingTest : public DawnTest {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -518,7 +518,7 @@ class TextureViewRenderingTest : public DawnTest {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPassInfo); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPassInfo);
pass.SetPipeline(oneColorPipeline); pass.SetPipeline(oneColorPipeline);
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -773,7 +773,7 @@ TEST_P(TextureView1DTest, Sampling) {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetBindGroup(0, bg); pass.SetBindGroup(0, bg);
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);

View File

@ -209,7 +209,7 @@ TEST_P(TextureZeroInitTest, RenderingMipMapClearsToZero) {
{ {
// Texture's first usage is in BeginRenderPass's call to RecordRenderPass // Texture's first usage is in BeginRenderPass's call to RecordRenderPass
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
EXPECT_LAZY_CLEAR(0u, queue.Submit(1, &commands)); EXPECT_LAZY_CLEAR(0u, queue.Submit(1, &commands));
@ -253,7 +253,7 @@ TEST_P(TextureZeroInitTest, RenderingArrayLayerClearsToZero) {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
{ {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
EXPECT_LAZY_CLEAR(0u, queue.Submit(1, &commands)); EXPECT_LAZY_CLEAR(0u, queue.Submit(1, &commands));
@ -493,7 +493,7 @@ TEST_P(TextureZeroInitTest, RenderingLoadingDepth) {
auto pass = encoder.BeginRenderPass(&renderPassDescriptor); auto pass = encoder.BeginRenderPass(&renderPassDescriptor);
pass.SetPipeline(CreatePipelineForTest()); pass.SetPipeline(CreatePipelineForTest());
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commandBuffer = encoder.Finish(); wgpu::CommandBuffer commandBuffer = encoder.Finish();
// Expect 0 lazy clears, depth stencil texture will clear using loadop // Expect 0 lazy clears, depth stencil texture will clear using loadop
EXPECT_LAZY_CLEAR(0u, queue.Submit(1, &commandBuffer)); EXPECT_LAZY_CLEAR(0u, queue.Submit(1, &commandBuffer));
@ -535,7 +535,7 @@ TEST_P(TextureZeroInitTest, RenderingLoadingStencil) {
auto pass = encoder.BeginRenderPass(&renderPassDescriptor); auto pass = encoder.BeginRenderPass(&renderPassDescriptor);
pass.SetPipeline(CreatePipelineForTest()); pass.SetPipeline(CreatePipelineForTest());
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commandBuffer = encoder.Finish(); wgpu::CommandBuffer commandBuffer = encoder.Finish();
// Expect 0 lazy clears, depth stencil texture will clear using loadop // Expect 0 lazy clears, depth stencil texture will clear using loadop
EXPECT_LAZY_CLEAR(0u, queue.Submit(1, &commandBuffer)); EXPECT_LAZY_CLEAR(0u, queue.Submit(1, &commandBuffer));
@ -574,7 +574,7 @@ TEST_P(TextureZeroInitTest, RenderingLoadingDepthStencil) {
auto pass = encoder.BeginRenderPass(&renderPassDescriptor); auto pass = encoder.BeginRenderPass(&renderPassDescriptor);
pass.SetPipeline(CreatePipelineForTest()); pass.SetPipeline(CreatePipelineForTest());
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commandBuffer = encoder.Finish(); wgpu::CommandBuffer commandBuffer = encoder.Finish();
// Expect 0 lazy clears, depth stencil texture will clear using loadop // Expect 0 lazy clears, depth stencil texture will clear using loadop
EXPECT_LAZY_CLEAR(0u, queue.Submit(1, &commandBuffer)); EXPECT_LAZY_CLEAR(0u, queue.Submit(1, &commandBuffer));
@ -610,7 +610,7 @@ TEST_P(TextureZeroInitTest, IndependentDepthStencilLoadAfterDiscard) {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
auto pass = encoder.BeginRenderPass(&renderPassDescriptor); auto pass = encoder.BeginRenderPass(&renderPassDescriptor);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commandBuffer = encoder.Finish(); wgpu::CommandBuffer commandBuffer = encoder.Finish();
EXPECT_LAZY_CLEAR(0u, queue.Submit(1, &commandBuffer)); EXPECT_LAZY_CLEAR(0u, queue.Submit(1, &commandBuffer));
} }
@ -643,7 +643,7 @@ TEST_P(TextureZeroInitTest, IndependentDepthStencilLoadAfterDiscard) {
pass.SetPipeline(CreatePipelineForTest()); pass.SetPipeline(CreatePipelineForTest());
pass.SetStencilReference(2); pass.SetStencilReference(2);
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commandBuffer = encoder.Finish(); wgpu::CommandBuffer commandBuffer = encoder.Finish();
// No lazy clear because depth will be cleared with a loadOp // No lazy clear because depth will be cleared with a loadOp
EXPECT_LAZY_CLEAR(0u, queue.Submit(1, &commandBuffer)); EXPECT_LAZY_CLEAR(0u, queue.Submit(1, &commandBuffer));
@ -685,7 +685,7 @@ TEST_P(TextureZeroInitTest, IndependentDepthStencilLoadAfterDiscard) {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
auto pass = encoder.BeginRenderPass(&renderPassDescriptor); auto pass = encoder.BeginRenderPass(&renderPassDescriptor);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commandBuffer = encoder.Finish(); wgpu::CommandBuffer commandBuffer = encoder.Finish();
EXPECT_LAZY_CLEAR(0u, queue.Submit(1, &commandBuffer)); EXPECT_LAZY_CLEAR(0u, queue.Submit(1, &commandBuffer));
} }
@ -717,7 +717,7 @@ TEST_P(TextureZeroInitTest, IndependentDepthStencilLoadAfterDiscard) {
auto pass = encoder.BeginRenderPass(&renderPassDescriptor); auto pass = encoder.BeginRenderPass(&renderPassDescriptor);
pass.SetPipeline(CreatePipelineForTest(0.7)); pass.SetPipeline(CreatePipelineForTest(0.7));
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commandBuffer = encoder.Finish(); wgpu::CommandBuffer commandBuffer = encoder.Finish();
// No lazy clear because stencil will clear using a loadOp. // No lazy clear because stencil will clear using a loadOp.
EXPECT_LAZY_CLEAR(0u, queue.Submit(1, &commandBuffer)); EXPECT_LAZY_CLEAR(0u, queue.Submit(1, &commandBuffer));
@ -770,7 +770,7 @@ TEST_P(TextureZeroInitTest, IndependentDepthStencilCopyAfterDiscard) {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
auto pass = encoder.BeginRenderPass(&renderPassDescriptor); auto pass = encoder.BeginRenderPass(&renderPassDescriptor);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commandBuffer = encoder.Finish(); wgpu::CommandBuffer commandBuffer = encoder.Finish();
EXPECT_LAZY_CLEAR(0u, queue.Submit(1, &commandBuffer)); EXPECT_LAZY_CLEAR(0u, queue.Submit(1, &commandBuffer));
} }
@ -815,7 +815,7 @@ TEST_P(TextureZeroInitTest, IndependentDepthStencilCopyAfterDiscard) {
auto pass = encoder.BeginRenderPass(&renderPassDescriptor); auto pass = encoder.BeginRenderPass(&renderPassDescriptor);
pass.SetPipeline(CreatePipelineForTest(0.3)); pass.SetPipeline(CreatePipelineForTest(0.3));
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commandBuffer = encoder.Finish(); wgpu::CommandBuffer commandBuffer = encoder.Finish();
// No lazy clear because stencil will clear using a loadOp. // No lazy clear because stencil will clear using a loadOp.
EXPECT_LAZY_CLEAR(0u, queue.Submit(1, &commandBuffer)); EXPECT_LAZY_CLEAR(0u, queue.Submit(1, &commandBuffer));
@ -837,7 +837,7 @@ TEST_P(TextureZeroInitTest, ColorAttachmentsClear) {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
EXPECT_LAZY_CLEAR(0u, queue.Submit(1, &commands)); EXPECT_LAZY_CLEAR(0u, queue.Submit(1, &commands));
@ -881,7 +881,7 @@ TEST_P(TextureZeroInitTest, RenderPassSampledTextureClear) {
pass.SetPipeline(renderPipeline); pass.SetPipeline(renderPipeline);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
// Expect 1 lazy clear for sampled texture // Expect 1 lazy clear for sampled texture
EXPECT_LAZY_CLEAR(1u, queue.Submit(1, &commands)); EXPECT_LAZY_CLEAR(1u, queue.Submit(1, &commands));
@ -939,7 +939,7 @@ TEST_P(TextureZeroInitTest, TextureBothSampledAndAttachmentClear) {
pass.SetPipeline(renderPipeline); pass.SetPipeline(renderPipeline);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
// Expect the lazy clear for the sampled subresource. // Expect the lazy clear for the sampled subresource.
@ -1004,7 +1004,7 @@ TEST_P(TextureZeroInitTest, ComputePassSampledTextureClear) {
pass.SetPipeline(computePipeline); pass.SetPipeline(computePipeline);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Dispatch(1); pass.Dispatch(1);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
EXPECT_LAZY_CLEAR(1u, queue.Submit(1, &commands)); EXPECT_LAZY_CLEAR(1u, queue.Submit(1, &commands));
@ -1167,7 +1167,7 @@ TEST_P(TextureZeroInitTest, RenderPassStoreOpClear) {
pass.SetPipeline(renderPipeline); pass.SetPipeline(renderPipeline);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
commands = encoder.Finish(); commands = encoder.Finish();
// Expect 0 lazy clears, sample texture is initialized by copyBufferToTexture and render texture // Expect 0 lazy clears, sample texture is initialized by copyBufferToTexture and render texture
// is cleared by loadop // is cleared by loadop
@ -1221,7 +1221,7 @@ TEST_P(TextureZeroInitTest, RenderingLoadingDepthStencilStoreOpClear) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPassDescriptor); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPassDescriptor);
pass.SetPipeline(CreatePipelineForTest()); pass.SetPipeline(CreatePipelineForTest());
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commandBuffer = encoder.Finish(); wgpu::CommandBuffer commandBuffer = encoder.Finish();
// Expect 0 lazy clears, depth stencil texture will clear using loadop // Expect 0 lazy clears, depth stencil texture will clear using loadop
EXPECT_LAZY_CLEAR(0u, queue.Submit(1, &commandBuffer)); EXPECT_LAZY_CLEAR(0u, queue.Submit(1, &commandBuffer));
@ -1246,7 +1246,7 @@ TEST_P(TextureZeroInitTest, RenderingLoadingDepthStencilStoreOpClear) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPassDescriptor); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPassDescriptor);
pass.SetPipeline(CreatePipelineForTest()); pass.SetPipeline(CreatePipelineForTest());
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commandBuffer = encoder.Finish(); wgpu::CommandBuffer commandBuffer = encoder.Finish();
// Expect 0 lazy clears, depth stencil texture will clear using loadop // Expect 0 lazy clears, depth stencil texture will clear using loadop
EXPECT_LAZY_CLEAR(0u, queue.Submit(1, &commandBuffer)); EXPECT_LAZY_CLEAR(0u, queue.Submit(1, &commandBuffer));
@ -1314,7 +1314,7 @@ TEST_P(TextureZeroInitTest, PreservesInitializedMip) {
pass.SetPipeline(renderPipeline); pass.SetPipeline(renderPipeline);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
commands = encoder.Finish(); commands = encoder.Finish();
// Expect 1 lazy clears, because not all mips of the sample texture are initialized by // Expect 1 lazy clears, because not all mips of the sample texture are initialized by
// copyBufferToTexture. // copyBufferToTexture.
@ -1398,7 +1398,7 @@ TEST_P(TextureZeroInitTest, PreservesInitializedArrayLayer) {
pass.SetPipeline(renderPipeline); pass.SetPipeline(renderPipeline);
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
commands = encoder.Finish(); commands = encoder.Finish();
// Expect 1 lazy clears, because not all array layers of the sample texture are initialized by // Expect 1 lazy clears, because not all array layers of the sample texture are initialized by
// copyBufferToTexture. // copyBufferToTexture.
@ -1814,7 +1814,7 @@ class CompressedTextureZeroInitTest : public TextureZeroInitTest {
{{0, bcTexture.CreateView(&textureViewDescriptor)}}); {{0, bcTexture.CreateView(&textureViewDescriptor)}});
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();

View File

@ -400,7 +400,7 @@ class VertexFormatTest : public DawnTest {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetVertexBuffer(0, vertexBuffer); pass.SetVertexBuffer(0, vertexBuffer);
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();

View File

@ -153,7 +153,7 @@ class VertexOnlyRenderPipelineTest : public DawnTest {
} }
auto pass = encoder.BeginRenderPass(&clearPass); auto pass = encoder.BeginRenderPass(&clearPass);
pass.EndPass(); pass.End();
} }
// Render resource // Render resource
@ -194,7 +194,7 @@ TEST_P(VertexOnlyRenderPipelineTest, Stencil) {
pass.SetVertexBuffer(0, vertexBuffer); pass.SetVertexBuffer(0, vertexBuffer);
// Draw the whole line // Draw the whole line
pass.Draw(2, 1, 4, 0); pass.Draw(2, 1, 4, 0);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -230,7 +230,7 @@ TEST_P(VertexOnlyRenderPipelineTest, Depth) {
pass.SetVertexBuffer(0, vertexBuffer); pass.SetVertexBuffer(0, vertexBuffer);
// Draw the whole line // Draw the whole line
pass.Draw(2, 1, 4, 0); pass.Draw(2, 1, 4, 0);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -271,7 +271,7 @@ TEST_P(VertexOnlyRenderPipelineTest, MultiplePass) {
pass.SetVertexBuffer(0, vertexBuffer); pass.SetVertexBuffer(0, vertexBuffer);
// Draw the middle line // Draw the middle line
pass.Draw(2, 1, 0, 0); pass.Draw(2, 1, 0, 0);
pass.EndPass(); pass.End();
} }
// Use the depth pipeline to set the depth on the right // Use the depth pipeline to set the depth on the right
@ -282,7 +282,7 @@ TEST_P(VertexOnlyRenderPipelineTest, MultiplePass) {
pass.SetVertexBuffer(0, vertexBuffer); pass.SetVertexBuffer(0, vertexBuffer);
// Draw the right line // Draw the right line
pass.Draw(2, 1, 2, 0); pass.Draw(2, 1, 2, 0);
pass.EndPass(); pass.End();
} }
// Use the complete pipeline to draw with depth and stencil tests // Use the complete pipeline to draw with depth and stencil tests
@ -293,7 +293,7 @@ TEST_P(VertexOnlyRenderPipelineTest, MultiplePass) {
pass.SetVertexBuffer(0, vertexBuffer); pass.SetVertexBuffer(0, vertexBuffer);
// Draw the full line with depth and stencil tests // Draw the full line with depth and stencil tests
pass.Draw(2, 1, 4, 0); pass.Draw(2, 1, 4, 0);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();

View File

@ -219,7 +219,7 @@ class VertexStateTest : public DawnTest {
} }
pass.Draw(triangles * 3, instances); pass.Draw(triangles * 3, instances);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -474,7 +474,7 @@ TEST_P(VertexStateTest, UnusedVertexSlot) {
pass.SetPipeline(instancePipeline); pass.SetPipeline(instancePipeline);
pass.Draw(3, 4); pass.Draw(3, 4);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -526,7 +526,7 @@ TEST_P(VertexStateTest, MultiplePipelinesMixedVertexState) {
pass.SetPipeline(instancePipeline); pass.SetPipeline(instancePipeline);
pass.Draw(3, 4); pass.Draw(3, 4);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -633,7 +633,7 @@ TEST_P(VertexStateTest, OverlappingVertexAttributes) {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetVertexBuffer(0, vertexBuffer); pass.SetVertexBuffer(0, vertexBuffer);
pass.Draw(1); pass.Draw(1);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -685,7 +685,7 @@ TEST_P(OptionalVertexStateTest, Basic) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.Draw(1); pass.Draw(1);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();

View File

@ -188,7 +188,7 @@ TEST_P(VideoViewsTests, NV12SampleYtoR) {
pass.SetBindGroup(0, utils::MakeBindGroup(device, renderPipeline.GetBindGroupLayout(0), pass.SetBindGroup(0, utils::MakeBindGroup(device, renderPipeline.GetBindGroupLayout(0),
{{0, sampler}, {1, textureView}})); {{0, sampler}, {1, textureView}}));
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -247,7 +247,7 @@ TEST_P(VideoViewsTests, NV12SampleUVtoRG) {
pass.SetBindGroup(0, utils::MakeBindGroup(device, renderPipeline.GetBindGroupLayout(0), pass.SetBindGroup(0, utils::MakeBindGroup(device, renderPipeline.GetBindGroupLayout(0),
{{0, sampler}, {1, textureView}})); {{0, sampler}, {1, textureView}}));
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -317,7 +317,7 @@ TEST_P(VideoViewsTests, NV12SampleYUVtoRGB) {
0, utils::MakeBindGroup(device, renderPipeline.GetBindGroupLayout(0), 0, utils::MakeBindGroup(device, renderPipeline.GetBindGroupLayout(0),
{{0, sampler}, {1, lumaTextureView}, {2, chromaTextureView}})); {{0, sampler}, {1, lumaTextureView}, {2, chromaTextureView}}));
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();

View File

@ -46,7 +46,7 @@ TEST_P(ViewportOrientationTests, OriginAt0x0) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.Draw(1); pass.Draw(1);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();

View File

@ -71,7 +71,7 @@ class ViewportTest : public DawnTest {
pass.SetViewport(x, y, width, height, 0.0, 1.0); pass.SetViewport(x, y, width, height, 0.0, 1.0);
} }
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -126,7 +126,7 @@ class ViewportTest : public DawnTest {
pass.SetViewport(0, 0, 3, 1, minDepth, maxDepth); pass.SetViewport(0, 0, 3, 1, minDepth, maxDepth);
} }
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);
@ -194,7 +194,7 @@ TEST_P(ViewportTest, EmptyViewport) {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetViewport(0.0f, 0.0f, width, height, 0.0f, 1.0f); pass.SetViewport(0.0f, 0.0f, width, height, 0.0f, 1.0f);
pass.Draw(6); pass.Draw(6);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
queue.Submit(1, &commands); queue.Submit(1, &commands);

View File

@ -598,7 +598,7 @@ void DrawCallPerf::Step() {
break; break;
} }
pass.EndPass(); pass.End();
wgpu::CommandBuffer commandBuffer = commands.Finish(); wgpu::CommandBuffer commandBuffer = commands.Finish();
queue.Submit(1, &commandBuffer); queue.Submit(1, &commandBuffer);
} }

View File

@ -486,7 +486,7 @@ void ShaderRobustnessPerf::Step() {
pass.Dispatch(ceil(float(mDimBOuter) / float(kTileSize)), pass.Dispatch(ceil(float(mDimBOuter) / float(kTileSize)),
ceil(float(mDimAOuter) / float(kTileSize)), 1); ceil(float(mDimAOuter) / float(kTileSize)), 1);
} }
pass.EndPass(); pass.End();
commands = encoder.Finish(); commands = encoder.Finish();
} }

View File

@ -129,7 +129,7 @@ class SubresourceTrackingPerf : public DawnPerfTestWithParams<SubresourceTrackin
pass.SetPipeline(mPipeline); pass.SetPipeline(mPipeline);
pass.SetBindGroup(0, bindgroup); pass.SetBindGroup(0, bindgroup);
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();

View File

@ -142,7 +142,7 @@ TEST_F(CommandBufferEncodingTests, ComputePassEncoderIndirectDispatchStateRestor
EXPECT_EQ(ToAPI(stateTracker->GetBindGroup(BindGroupIndex(1))), staticBG.Get()); EXPECT_EQ(ToAPI(stateTracker->GetBindGroup(BindGroupIndex(1))), staticBG.Get());
EXPECT_EQ(stateTracker->GetDynamicOffsets(BindGroupIndex(1)), emptyDynamicOffsets); EXPECT_EQ(stateTracker->GetDynamicOffsets(BindGroupIndex(1)), emptyDynamicOffsets);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commandBuffer = encoder.Finish(); wgpu::CommandBuffer commandBuffer = encoder.Finish();

View File

@ -1481,7 +1481,7 @@ class SetBindGroupValidationTest : public ValidationTest {
renderPassEncoder.SetBindGroup(0, bindGroup, count, offsets); renderPassEncoder.SetBindGroup(0, bindGroup, count, offsets);
} }
renderPassEncoder.Draw(3); renderPassEncoder.Draw(3);
renderPassEncoder.EndPass(); renderPassEncoder.End();
if (!expectation) { if (!expectation) {
ASSERT_DEVICE_ERROR(commandEncoder.Finish()); ASSERT_DEVICE_ERROR(commandEncoder.Finish());
} else { } else {
@ -1502,7 +1502,7 @@ class SetBindGroupValidationTest : public ValidationTest {
computePassEncoder.SetBindGroup(0, bindGroup, count, offsets); computePassEncoder.SetBindGroup(0, bindGroup, count, offsets);
} }
computePassEncoder.Dispatch(1); computePassEncoder.Dispatch(1);
computePassEncoder.EndPass(); computePassEncoder.End();
if (!expectation) { if (!expectation) {
ASSERT_DEVICE_ERROR(commandEncoder.Finish()); ASSERT_DEVICE_ERROR(commandEncoder.Finish());
} else { } else {
@ -1570,7 +1570,7 @@ TEST_F(SetBindGroupValidationTest, VerifyGroupIfChangedAfterAction) {
computePassEncoder.Dispatch(1); computePassEncoder.Dispatch(1);
computePassEncoder.SetBindGroup(0, invalidGroup, 0, nullptr); computePassEncoder.SetBindGroup(0, invalidGroup, 0, nullptr);
computePassEncoder.Dispatch(1); computePassEncoder.Dispatch(1);
computePassEncoder.EndPass(); computePassEncoder.End();
ASSERT_DEVICE_ERROR(commandEncoder.Finish()); ASSERT_DEVICE_ERROR(commandEncoder.Finish());
} }
{ {
@ -1584,7 +1584,7 @@ TEST_F(SetBindGroupValidationTest, VerifyGroupIfChangedAfterAction) {
renderPassEncoder.Draw(3); renderPassEncoder.Draw(3);
renderPassEncoder.SetBindGroup(0, invalidGroup, 0, nullptr); renderPassEncoder.SetBindGroup(0, invalidGroup, 0, nullptr);
renderPassEncoder.Draw(3); renderPassEncoder.Draw(3);
renderPassEncoder.EndPass(); renderPassEncoder.End();
ASSERT_DEVICE_ERROR(commandEncoder.Finish()); ASSERT_DEVICE_ERROR(commandEncoder.Finish());
} }
} }
@ -1753,7 +1753,7 @@ TEST_F(SetBindGroupValidationTest, DynamicOffsetOrder) {
wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder(); wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder();
wgpu::ComputePassEncoder computePassEncoder = commandEncoder.BeginComputePass(); wgpu::ComputePassEncoder computePassEncoder = commandEncoder.BeginComputePass();
computePassEncoder.SetBindGroup(0, bindGroup, offsets.size(), offsets.data()); computePassEncoder.SetBindGroup(0, bindGroup, offsets.size(), offsets.data());
computePassEncoder.EndPass(); computePassEncoder.End();
commandEncoder.Finish(); commandEncoder.Finish();
} }
{ {
@ -1766,7 +1766,7 @@ TEST_F(SetBindGroupValidationTest, DynamicOffsetOrder) {
wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder(); wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder();
wgpu::ComputePassEncoder computePassEncoder = commandEncoder.BeginComputePass(); wgpu::ComputePassEncoder computePassEncoder = commandEncoder.BeginComputePass();
computePassEncoder.SetBindGroup(0, bindGroup, offsets.size(), offsets.data()); computePassEncoder.SetBindGroup(0, bindGroup, offsets.size(), offsets.data());
computePassEncoder.EndPass(); computePassEncoder.End();
commandEncoder.Finish(); commandEncoder.Finish();
} }
{ {
@ -1777,7 +1777,7 @@ TEST_F(SetBindGroupValidationTest, DynamicOffsetOrder) {
wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder(); wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder();
wgpu::ComputePassEncoder computePassEncoder = commandEncoder.BeginComputePass(); wgpu::ComputePassEncoder computePassEncoder = commandEncoder.BeginComputePass();
computePassEncoder.SetBindGroup(0, bindGroup, offsets.size(), offsets.data()); computePassEncoder.SetBindGroup(0, bindGroup, offsets.size(), offsets.data());
computePassEncoder.EndPass(); computePassEncoder.End();
commandEncoder.Finish(); commandEncoder.Finish();
} }
{ {
@ -1790,7 +1790,7 @@ TEST_F(SetBindGroupValidationTest, DynamicOffsetOrder) {
wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder(); wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder();
wgpu::ComputePassEncoder computePassEncoder = commandEncoder.BeginComputePass(); wgpu::ComputePassEncoder computePassEncoder = commandEncoder.BeginComputePass();
computePassEncoder.SetBindGroup(0, bindGroup, offsets.size(), offsets.data()); computePassEncoder.SetBindGroup(0, bindGroup, offsets.size(), offsets.data());
computePassEncoder.EndPass(); computePassEncoder.End();
commandEncoder.Finish(); commandEncoder.Finish();
} }
{ {
@ -1801,7 +1801,7 @@ TEST_F(SetBindGroupValidationTest, DynamicOffsetOrder) {
wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder(); wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder();
wgpu::ComputePassEncoder computePassEncoder = commandEncoder.BeginComputePass(); wgpu::ComputePassEncoder computePassEncoder = commandEncoder.BeginComputePass();
computePassEncoder.SetBindGroup(0, bindGroup, offsets.size(), offsets.data()); computePassEncoder.SetBindGroup(0, bindGroup, offsets.size(), offsets.data());
computePassEncoder.EndPass(); computePassEncoder.End();
commandEncoder.Finish(); commandEncoder.Finish();
} }
} }
@ -1948,7 +1948,7 @@ TEST_F(SetBindGroupPersistenceValidationTest, BindGroupBeforePipeline) {
renderPassEncoder.SetPipeline(pipeline); renderPassEncoder.SetPipeline(pipeline);
renderPassEncoder.Draw(3); renderPassEncoder.Draw(3);
renderPassEncoder.EndPass(); renderPassEncoder.End();
commandEncoder.Finish(); commandEncoder.Finish();
} }
@ -2008,7 +2008,7 @@ TEST_F(SetBindGroupPersistenceValidationTest, NotVulkanInheritance) {
// Bind group 1 persists even though it is not "inherited". // Bind group 1 persists even though it is not "inherited".
renderPassEncoder.Draw(3); renderPassEncoder.Draw(3);
renderPassEncoder.EndPass(); renderPassEncoder.End();
commandEncoder.Finish(); commandEncoder.Finish();
} }
@ -2250,7 +2250,7 @@ class BindingsValidationTest : public BindGroupLayoutCompatibilityTest {
} }
rp.SetPipeline(pipeline); rp.SetPipeline(pipeline);
rp.Draw(3); rp.Draw(3);
rp.EndPass(); rp.End();
if (!expectation) { if (!expectation) {
ASSERT_DEVICE_ERROR(encoder.Finish()); ASSERT_DEVICE_ERROR(encoder.Finish());
} else { } else {
@ -2269,7 +2269,7 @@ class BindingsValidationTest : public BindGroupLayoutCompatibilityTest {
} }
cp.SetPipeline(pipeline); cp.SetPipeline(pipeline);
cp.Dispatch(1); cp.Dispatch(1);
cp.EndPass(); cp.End();
if (!expectation) { if (!expectation) {
ASSERT_DEVICE_ERROR(encoder.Finish()); ASSERT_DEVICE_ERROR(encoder.Finish());
} else { } else {

View File

@ -37,7 +37,7 @@ TEST_F(CommandBufferValidationTest, EndedMidRenderPass) {
{ {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&dummyRenderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&dummyRenderPass);
pass.EndPass(); pass.End();
encoder.Finish(); encoder.Finish();
} }
@ -59,8 +59,7 @@ TEST_F(CommandBufferValidationTest, EndedMidRenderPass) {
encoder.Finish(), encoder.Finish(),
HasSubstr("Command buffer recording ended before [RenderPassEncoder] was ended.")); HasSubstr("Command buffer recording ended before [RenderPassEncoder] was ended."));
ASSERT_DEVICE_ERROR( ASSERT_DEVICE_ERROR(
pass.EndPass(), pass.End(), HasSubstr("Recording in an error or already ended [RenderPassEncoder]."));
HasSubstr("Recording in an error or already ended [RenderPassEncoder]."));
} }
} }
@ -70,7 +69,7 @@ TEST_F(CommandBufferValidationTest, EndedMidComputePass) {
{ {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::ComputePassEncoder pass = encoder.BeginComputePass(); wgpu::ComputePassEncoder pass = encoder.BeginComputePass();
pass.EndPass(); pass.End();
encoder.Finish(); encoder.Finish();
} }
@ -92,8 +91,7 @@ TEST_F(CommandBufferValidationTest, EndedMidComputePass) {
encoder.Finish(), encoder.Finish(),
HasSubstr("Command buffer recording ended before [ComputePassEncoder] was ended.")); HasSubstr("Command buffer recording ended before [ComputePassEncoder] was ended."));
ASSERT_DEVICE_ERROR( ASSERT_DEVICE_ERROR(
pass.EndPass(), pass.End(), HasSubstr("Recording in an error or already ended [ComputePassEncoder]."));
HasSubstr("Recording in an error or already ended [ComputePassEncoder]."));
} }
} }
@ -105,7 +103,7 @@ TEST_F(CommandBufferValidationTest, RenderPassEndedTwice) {
{ {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&dummyRenderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&dummyRenderPass);
pass.EndPass(); pass.End();
encoder.Finish(); encoder.Finish();
} }
@ -113,8 +111,8 @@ TEST_F(CommandBufferValidationTest, RenderPassEndedTwice) {
{ {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&dummyRenderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&dummyRenderPass);
pass.EndPass(); pass.End();
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR( ASSERT_DEVICE_ERROR(
encoder.Finish(), encoder.Finish(),
HasSubstr("Recording in an error or already ended [RenderPassEncoder].")); HasSubstr("Recording in an error or already ended [RenderPassEncoder]."));
@ -127,7 +125,7 @@ TEST_F(CommandBufferValidationTest, ComputePassEndedTwice) {
{ {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::ComputePassEncoder pass = encoder.BeginComputePass(); wgpu::ComputePassEncoder pass = encoder.BeginComputePass();
pass.EndPass(); pass.End();
encoder.Finish(); encoder.Finish();
} }
@ -135,8 +133,8 @@ TEST_F(CommandBufferValidationTest, ComputePassEndedTwice) {
{ {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::ComputePassEncoder pass = encoder.BeginComputePass(); wgpu::ComputePassEncoder pass = encoder.BeginComputePass();
pass.EndPass(); pass.End();
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR( ASSERT_DEVICE_ERROR(
encoder.Finish(), encoder.Finish(),
HasSubstr("Recording in an error or already ended [ComputePassEncoder].")); HasSubstr("Recording in an error or already ended [ComputePassEncoder]."));
@ -152,8 +150,8 @@ TEST_F(CommandBufferValidationTest, BeginComputePassBeforeEndPreviousPass) {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder renderPass = encoder.BeginRenderPass(&dummyRenderPass); wgpu::RenderPassEncoder renderPass = encoder.BeginRenderPass(&dummyRenderPass);
wgpu::ComputePassEncoder computePass = encoder.BeginComputePass(); wgpu::ComputePassEncoder computePass = encoder.BeginComputePass();
computePass.EndPass(); computePass.End();
renderPass.EndPass(); renderPass.End();
ASSERT_DEVICE_ERROR(encoder.Finish()); ASSERT_DEVICE_ERROR(encoder.Finish());
} }
@ -162,8 +160,8 @@ TEST_F(CommandBufferValidationTest, BeginComputePassBeforeEndPreviousPass) {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::ComputePassEncoder computePass1 = encoder.BeginComputePass(); wgpu::ComputePassEncoder computePass1 = encoder.BeginComputePass();
wgpu::ComputePassEncoder computePass2 = encoder.BeginComputePass(); wgpu::ComputePassEncoder computePass2 = encoder.BeginComputePass();
computePass2.EndPass(); computePass2.End();
computePass1.EndPass(); computePass1.End();
ASSERT_DEVICE_ERROR(encoder.Finish()); ASSERT_DEVICE_ERROR(encoder.Finish());
} }
} }
@ -177,8 +175,8 @@ TEST_F(CommandBufferValidationTest, BeginRenderPassBeforeEndPreviousPass) {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder renderPass1 = encoder.BeginRenderPass(&dummyRenderPass); wgpu::RenderPassEncoder renderPass1 = encoder.BeginRenderPass(&dummyRenderPass);
wgpu::RenderPassEncoder renderPass2 = encoder.BeginRenderPass(&dummyRenderPass); wgpu::RenderPassEncoder renderPass2 = encoder.BeginRenderPass(&dummyRenderPass);
renderPass2.EndPass(); renderPass2.End();
renderPass1.EndPass(); renderPass1.End();
ASSERT_DEVICE_ERROR(encoder.Finish()); ASSERT_DEVICE_ERROR(encoder.Finish());
} }
@ -187,8 +185,8 @@ TEST_F(CommandBufferValidationTest, BeginRenderPassBeforeEndPreviousPass) {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::ComputePassEncoder computePass = encoder.BeginComputePass(); wgpu::ComputePassEncoder computePass = encoder.BeginComputePass();
wgpu::RenderPassEncoder renderPass = encoder.BeginRenderPass(&dummyRenderPass); wgpu::RenderPassEncoder renderPass = encoder.BeginRenderPass(&dummyRenderPass);
renderPass.EndPass(); renderPass.End();
computePass.EndPass(); computePass.End();
ASSERT_DEVICE_ERROR(encoder.Finish()); ASSERT_DEVICE_ERROR(encoder.Finish());
} }
} }
@ -237,7 +235,7 @@ TEST_F(CommandBufferValidationTest, PassDereferenced) {
{ {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&dummyRenderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&dummyRenderPass);
pass.EndPass(); pass.End();
encoder.Finish(); encoder.Finish();
} }
@ -264,7 +262,7 @@ TEST_F(CommandBufferValidationTest, PassDereferenced) {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
encoder.BeginRenderPass(&dummyRenderPass); encoder.BeginRenderPass(&dummyRenderPass);
wgpu::ComputePassEncoder pass = encoder.BeginComputePass(); wgpu::ComputePassEncoder pass = encoder.BeginComputePass();
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR( ASSERT_DEVICE_ERROR(
encoder.Finish(), encoder.Finish(),
HasSubstr("Command buffer recording ended before [RenderPassEncoder] was ended.")); HasSubstr("Command buffer recording ended before [RenderPassEncoder] was ended."));
@ -309,7 +307,7 @@ TEST_F(CommandBufferValidationTest, DestroyEncoder) {
{ {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&dummyRenderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&dummyRenderPass);
pass.EndPass(); pass.End();
encoder.Finish(); encoder.Finish();
} }
@ -317,7 +315,7 @@ TEST_F(CommandBufferValidationTest, DestroyEncoder) {
{ {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&dummyRenderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&dummyRenderPass);
pass.EndPass(); pass.End();
dawn::native::FromAPI(encoder.Get())->Destroy(); dawn::native::FromAPI(encoder.Get())->Destroy();
ASSERT_DEVICE_ERROR(encoder.Finish(), HasSubstr("Destroyed encoder cannot be finished.")); ASSERT_DEVICE_ERROR(encoder.Finish(), HasSubstr("Destroyed encoder cannot be finished."));
} }
@ -326,7 +324,7 @@ TEST_F(CommandBufferValidationTest, DestroyEncoder) {
{ {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&dummyRenderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&dummyRenderPass);
pass.EndPass(); pass.End();
dawn::native::FromAPI(encoder.Get())->Destroy(); dawn::native::FromAPI(encoder.Get())->Destroy();
} }
@ -335,7 +333,7 @@ TEST_F(CommandBufferValidationTest, DestroyEncoder) {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
dawn::native::FromAPI(encoder.Get())->Destroy(); dawn::native::FromAPI(encoder.Get())->Destroy();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&dummyRenderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&dummyRenderPass);
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(encoder.Finish(), HasSubstr("Destroyed encoder cannot be finished.")); ASSERT_DEVICE_ERROR(encoder.Finish(), HasSubstr("Destroyed encoder cannot be finished."));
} }
@ -344,14 +342,14 @@ TEST_F(CommandBufferValidationTest, DestroyEncoder) {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
dawn::native::FromAPI(encoder.Get())->Destroy(); dawn::native::FromAPI(encoder.Get())->Destroy();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&dummyRenderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&dummyRenderPass);
pass.EndPass(); pass.End();
} }
// Destroying a finished encoder should not emit any errors. // Destroying a finished encoder should not emit any errors.
{ {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&dummyRenderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&dummyRenderPass);
pass.EndPass(); pass.End();
encoder.Finish(); encoder.Finish();
dawn::native::FromAPI(encoder.Get())->Destroy(); dawn::native::FromAPI(encoder.Get())->Destroy();
} }

View File

@ -55,7 +55,7 @@ class ComputeIndirectValidationTest : public ValidationTest {
wgpu::ComputePassEncoder pass = encoder.BeginComputePass(); wgpu::ComputePassEncoder pass = encoder.BeginComputePass();
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.DispatchIndirect(indirectBuffer, indirectOffset); pass.DispatchIndirect(indirectBuffer, indirectOffset);
pass.EndPass(); pass.End();
ValidateExpectation(encoder, expectation); ValidateExpectation(encoder, expectation);
} }

View File

@ -43,7 +43,7 @@ class ComputeValidationTest : public ValidationTest {
wgpu::ComputePassEncoder pass = encoder.BeginComputePass(); wgpu::ComputePassEncoder pass = encoder.BeginComputePass();
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.Dispatch(x, y, z); pass.Dispatch(x, y, z);
pass.EndPass(); pass.End();
encoder.Finish(); encoder.Finish();
} }

View File

@ -31,7 +31,7 @@ TEST_F(DebugMarkerValidationTest, RenderSuccess) {
pass.InsertDebugMarker("Marker"); pass.InsertDebugMarker("Marker");
pass.PopDebugGroup(); pass.PopDebugGroup();
pass.PopDebugGroup(); pass.PopDebugGroup();
pass.EndPass(); pass.End();
} }
encoder.Finish(); encoder.Finish();
@ -48,7 +48,7 @@ TEST_F(DebugMarkerValidationTest, RenderUnbalancedPush) {
pass.PushDebugGroup("Event Start"); pass.PushDebugGroup("Event Start");
pass.InsertDebugMarker("Marker"); pass.InsertDebugMarker("Marker");
pass.PopDebugGroup(); pass.PopDebugGroup();
pass.EndPass(); pass.End();
} }
ASSERT_DEVICE_ERROR(encoder.Finish()); ASSERT_DEVICE_ERROR(encoder.Finish());
@ -65,7 +65,7 @@ TEST_F(DebugMarkerValidationTest, RenderUnbalancedPop) {
pass.InsertDebugMarker("Marker"); pass.InsertDebugMarker("Marker");
pass.PopDebugGroup(); pass.PopDebugGroup();
pass.PopDebugGroup(); pass.PopDebugGroup();
pass.EndPass(); pass.End();
} }
ASSERT_DEVICE_ERROR(encoder.Finish()); ASSERT_DEVICE_ERROR(encoder.Finish());
@ -127,7 +127,7 @@ TEST_F(DebugMarkerValidationTest, ComputeSuccess) {
pass.InsertDebugMarker("Marker"); pass.InsertDebugMarker("Marker");
pass.PopDebugGroup(); pass.PopDebugGroup();
pass.PopDebugGroup(); pass.PopDebugGroup();
pass.EndPass(); pass.End();
} }
encoder.Finish(); encoder.Finish();
@ -142,7 +142,7 @@ TEST_F(DebugMarkerValidationTest, ComputeUnbalancedPush) {
pass.PushDebugGroup("Event Start"); pass.PushDebugGroup("Event Start");
pass.InsertDebugMarker("Marker"); pass.InsertDebugMarker("Marker");
pass.PopDebugGroup(); pass.PopDebugGroup();
pass.EndPass(); pass.End();
} }
ASSERT_DEVICE_ERROR(encoder.Finish()); ASSERT_DEVICE_ERROR(encoder.Finish());
@ -157,7 +157,7 @@ TEST_F(DebugMarkerValidationTest, ComputeUnbalancedPop) {
pass.InsertDebugMarker("Marker"); pass.InsertDebugMarker("Marker");
pass.PopDebugGroup(); pass.PopDebugGroup();
pass.PopDebugGroup(); pass.PopDebugGroup();
pass.EndPass(); pass.End();
} }
ASSERT_DEVICE_ERROR(encoder.Finish()); ASSERT_DEVICE_ERROR(encoder.Finish());
@ -203,7 +203,7 @@ TEST_F(DebugMarkerValidationTest, NestedComputeInCommandEncoder) {
pass.PushDebugGroup("Event Start"); pass.PushDebugGroup("Event Start");
pass.InsertDebugMarker("Marker"); pass.InsertDebugMarker("Marker");
pass.PopDebugGroup(); pass.PopDebugGroup();
pass.EndPass(); pass.End();
} }
encoder.PopDebugGroup(); encoder.PopDebugGroup();
encoder.Finish(); encoder.Finish();
@ -217,7 +217,7 @@ TEST_F(DebugMarkerValidationTest, NestedComputeInCommandEncoderIndependent) {
wgpu::ComputePassEncoder pass = encoder.BeginComputePass(); wgpu::ComputePassEncoder pass = encoder.BeginComputePass();
pass.InsertDebugMarker("Marker"); pass.InsertDebugMarker("Marker");
pass.PopDebugGroup(); pass.PopDebugGroup();
pass.EndPass(); pass.End();
} }
ASSERT_DEVICE_ERROR(encoder.Finish()); ASSERT_DEVICE_ERROR(encoder.Finish());
} }
@ -233,7 +233,7 @@ TEST_F(DebugMarkerValidationTest, NestedRenderInCommandEncoder) {
pass.PushDebugGroup("Event Start"); pass.PushDebugGroup("Event Start");
pass.InsertDebugMarker("Marker"); pass.InsertDebugMarker("Marker");
pass.PopDebugGroup(); pass.PopDebugGroup();
pass.EndPass(); pass.End();
} }
encoder.PopDebugGroup(); encoder.PopDebugGroup();
encoder.Finish(); encoder.Finish();
@ -249,7 +249,7 @@ TEST_F(DebugMarkerValidationTest, NestedRenderInCommandEncoderIndependent) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
pass.InsertDebugMarker("Marker"); pass.InsertDebugMarker("Marker");
pass.PopDebugGroup(); pass.PopDebugGroup();
pass.EndPass(); pass.End();
} }
ASSERT_DEVICE_ERROR(encoder.Finish()); ASSERT_DEVICE_ERROR(encoder.Finish());
} }

View File

@ -85,7 +85,7 @@ class DrawIndirectValidationTest : public ValidationTest {
} else { } else {
pass.DrawIndirect(indirectBuffer, indirectOffset); pass.DrawIndirect(indirectBuffer, indirectOffset);
} }
pass.EndPass(); pass.End();
ValidateExpectation(encoder, expectation); ValidateExpectation(encoder, expectation);
} }

View File

@ -229,7 +229,7 @@ namespace {
vertexBufferParam.offset, vertexBufferParam.size); vertexBufferParam.offset, vertexBufferParam.size);
} }
renderPassEncoder.Draw(vertexCount, instanceCount, firstVertex, firstInstance); renderPassEncoder.Draw(vertexCount, instanceCount, firstVertex, firstInstance);
renderPassEncoder.EndPass(); renderPassEncoder.End();
if (isSuccess) { if (isSuccess) {
encoder.Finish(); encoder.Finish();
@ -261,7 +261,7 @@ namespace {
} }
renderPassEncoder.DrawIndexed(indexCount, instanceCount, firstIndex, baseVertex, renderPassEncoder.DrawIndexed(indexCount, instanceCount, firstIndex, baseVertex,
firstInstance); firstInstance);
renderPassEncoder.EndPass(); renderPassEncoder.End();
if (isSuccess) { if (isSuccess) {
encoder.Finish(); encoder.Finish();
@ -679,7 +679,7 @@ namespace {
renderPassEncoder.SetVertexBuffer(0, vertexBuffer3); renderPassEncoder.SetVertexBuffer(0, vertexBuffer3);
// It should be ok to draw 12 index // It should be ok to draw 12 index
renderPassEncoder.DrawIndexed(12, 1, 0, 0, 0); renderPassEncoder.DrawIndexed(12, 1, 0, 0, 0);
renderPassEncoder.EndPass(); renderPassEncoder.End();
// Expect success // Expect success
encoder.Finish(); encoder.Finish();
@ -698,7 +698,7 @@ namespace {
renderPassEncoder.SetVertexBuffer(0, vertexBuffer3); renderPassEncoder.SetVertexBuffer(0, vertexBuffer3);
// It should be index buffer OOB to draw 13 index // It should be index buffer OOB to draw 13 index
renderPassEncoder.DrawIndexed(13, 1, 0, 0, 0); renderPassEncoder.DrawIndexed(13, 1, 0, 0, 0);
renderPassEncoder.EndPass(); renderPassEncoder.End();
// Expect failure // Expect failure
ASSERT_DEVICE_ERROR(encoder.Finish()); ASSERT_DEVICE_ERROR(encoder.Finish());
@ -717,7 +717,7 @@ namespace {
renderPassEncoder.SetVertexBuffer(0, vertexBuffer3); renderPassEncoder.SetVertexBuffer(0, vertexBuffer3);
// It should be ok to draw 11 index // It should be ok to draw 11 index
renderPassEncoder.DrawIndexed(11, 1, 0, 0, 0); renderPassEncoder.DrawIndexed(11, 1, 0, 0, 0);
renderPassEncoder.EndPass(); renderPassEncoder.End();
// Expect success // Expect success
encoder.Finish(); encoder.Finish();
@ -736,7 +736,7 @@ namespace {
renderPassEncoder.SetVertexBuffer(0, vertexBuffer3); renderPassEncoder.SetVertexBuffer(0, vertexBuffer3);
// It should be index buffer OOB to draw 12 index // It should be index buffer OOB to draw 12 index
renderPassEncoder.DrawIndexed(12, 1, 0, 0, 0); renderPassEncoder.DrawIndexed(12, 1, 0, 0, 0);
renderPassEncoder.EndPass(); renderPassEncoder.End();
// Expect failure // Expect failure
ASSERT_DEVICE_ERROR(encoder.Finish()); ASSERT_DEVICE_ERROR(encoder.Finish());

View File

@ -32,7 +32,7 @@ class SetViewportTest : public ValidationTest {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&rp.renderPassInfo); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&rp.renderPassInfo);
pass.SetViewport(x, y, width, height, minDepth, maxDepth); pass.SetViewport(x, y, width, height, minDepth, maxDepth);
pass.EndPass(); pass.End();
if (success) { if (success) {
encoder.Finish(); encoder.Finish();
@ -141,7 +141,7 @@ class SetScissorTest : public ValidationTest {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&rp.renderPassInfo); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&rp.renderPassInfo);
pass.SetScissorRect(x, y, width, height); pass.SetScissorRect(x, y, width, height);
pass.EndPass(); pass.End();
if (success) { if (success) {
encoder.Finish(); encoder.Finish();
@ -210,7 +210,7 @@ TEST_F(SetBlendConstantTest, Success) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
constexpr wgpu::Color kTransparentBlack{0.0f, 0.0f, 0.0f, 0.0f}; constexpr wgpu::Color kTransparentBlack{0.0f, 0.0f, 0.0f, 0.0f};
pass.SetBlendConstant(&kTransparentBlack); pass.SetBlendConstant(&kTransparentBlack);
pass.EndPass(); pass.End();
} }
encoder.Finish(); encoder.Finish();
} }
@ -224,7 +224,7 @@ TEST_F(SetBlendConstantTest, AnyValueAllowed) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
constexpr wgpu::Color kAnyColorValue{-1.0f, 42.0f, -0.0f, 0.0f}; constexpr wgpu::Color kAnyColorValue{-1.0f, 42.0f, -0.0f, 0.0f};
pass.SetBlendConstant(&kAnyColorValue); pass.SetBlendConstant(&kAnyColorValue);
pass.EndPass(); pass.End();
} }
encoder.Finish(); encoder.Finish();
} }
@ -239,7 +239,7 @@ TEST_F(SetStencilReferenceTest, Success) {
{ {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
pass.SetStencilReference(0); pass.SetStencilReference(0);
pass.EndPass(); pass.End();
} }
encoder.Finish(); encoder.Finish();
} }
@ -252,7 +252,7 @@ TEST_F(SetStencilReferenceTest, AllBitsAllowed) {
{ {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
pass.SetStencilReference(0xFFFFFFFF); pass.SetStencilReference(0xFFFFFFFF);
pass.EndPass(); pass.End();
} }
encoder.Finish(); encoder.Finish();
} }

View File

@ -241,7 +241,7 @@ namespace {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
{ {
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -256,7 +256,7 @@ namespace {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
{ {
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -292,7 +292,7 @@ namespace {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
{ {
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -307,7 +307,7 @@ namespace {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
{ {
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -338,7 +338,7 @@ namespace {
wgpu::ComputePassEncoder pass = encoder.BeginComputePass(&computePass); wgpu::ComputePassEncoder pass = encoder.BeginComputePass(&computePass);
{ {
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -353,7 +353,7 @@ namespace {
wgpu::ComputePassEncoder pass = encoder.BeginComputePass(&computePass); wgpu::ComputePassEncoder pass = encoder.BeginComputePass(&computePass);
{ {
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -384,7 +384,7 @@ namespace {
wgpu::ComputePassEncoder pass = encoder.BeginComputePass(&computePass); wgpu::ComputePassEncoder pass = encoder.BeginComputePass(&computePass);
{ {
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
@ -398,7 +398,7 @@ namespace {
wgpu::ComputePassEncoder pass = encoder.BeginComputePass(&computePass); wgpu::ComputePassEncoder pass = encoder.BeginComputePass(&computePass);
{ {
pass.SetBindGroup(0, bindGroup); pass.SetBindGroup(0, bindGroup);
pass.EndPass(); pass.End();
} }
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();

View File

@ -54,7 +54,7 @@ TEST_F(IndexBufferValidationTest, UndefinedIndexFormat) {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
pass.SetIndexBuffer(buffer, wgpu::IndexFormat::Undefined); pass.SetIndexBuffer(buffer, wgpu::IndexFormat::Undefined);
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(encoder.Finish()); ASSERT_DEVICE_ERROR(encoder.Finish());
} }
@ -69,7 +69,7 @@ TEST_F(IndexBufferValidationTest, InvalidIndexFormat) {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
pass.SetIndexBuffer(buffer, static_cast<wgpu::IndexFormat>(404)); pass.SetIndexBuffer(buffer, static_cast<wgpu::IndexFormat>(404));
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(encoder.Finish()); ASSERT_DEVICE_ERROR(encoder.Finish());
} }
@ -93,7 +93,7 @@ TEST_F(IndexBufferValidationTest, IndexBufferOffsetOOBValidation) {
pass.SetIndexBuffer(buffer, wgpu::IndexFormat::Uint32, 4, wgpu::kWholeSize); pass.SetIndexBuffer(buffer, wgpu::IndexFormat::Uint32, 4, wgpu::kWholeSize);
// Implicit size of zero // Implicit size of zero
pass.SetIndexBuffer(buffer, wgpu::IndexFormat::Uint32, 256, wgpu::kWholeSize); pass.SetIndexBuffer(buffer, wgpu::IndexFormat::Uint32, 256, wgpu::kWholeSize);
pass.EndPass(); pass.End();
encoder.Finish(); encoder.Finish();
} }
@ -102,7 +102,7 @@ TEST_F(IndexBufferValidationTest, IndexBufferOffsetOOBValidation) {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
pass.SetIndexBuffer(buffer, wgpu::IndexFormat::Uint32, 4, 256); pass.SetIndexBuffer(buffer, wgpu::IndexFormat::Uint32, 4, 256);
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(encoder.Finish()); ASSERT_DEVICE_ERROR(encoder.Finish());
} }
@ -111,7 +111,7 @@ TEST_F(IndexBufferValidationTest, IndexBufferOffsetOOBValidation) {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
pass.SetIndexBuffer(buffer, wgpu::IndexFormat::Uint32, 256 + 4, 0); pass.SetIndexBuffer(buffer, wgpu::IndexFormat::Uint32, 256 + 4, 0);
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(encoder.Finish()); ASSERT_DEVICE_ERROR(encoder.Finish());
} }
@ -238,7 +238,7 @@ TEST_F(IndexBufferValidationTest, InvalidUsage) {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
pass.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint32); pass.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint32);
pass.EndPass(); pass.End();
encoder.Finish(); encoder.Finish();
} }
// Error case: using the copy buffer is an error. // Error case: using the copy buffer is an error.
@ -246,7 +246,7 @@ TEST_F(IndexBufferValidationTest, InvalidUsage) {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
pass.SetIndexBuffer(copyBuffer, wgpu::IndexFormat::Uint32); pass.SetIndexBuffer(copyBuffer, wgpu::IndexFormat::Uint32);
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(encoder.Finish()); ASSERT_DEVICE_ERROR(encoder.Finish());
} }
@ -281,7 +281,7 @@ TEST_F(IndexBufferValidationTest, OffsetAlignment) {
pass.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint32, 4); pass.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint32, 4);
pass.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint16, 0); pass.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint16, 0);
pass.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint16, 2); pass.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint16, 2);
pass.EndPass(); pass.End();
encoder.Finish(); encoder.Finish();
} }
@ -290,7 +290,7 @@ TEST_F(IndexBufferValidationTest, OffsetAlignment) {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
pass.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint32, 2); pass.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint32, 2);
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(encoder.Finish()); ASSERT_DEVICE_ERROR(encoder.Finish());
} }
// Error case: index buffer offset isn't a multiple of 2 for IndexFormat::Uint16 // Error case: index buffer offset isn't a multiple of 2 for IndexFormat::Uint16
@ -298,7 +298,7 @@ TEST_F(IndexBufferValidationTest, OffsetAlignment) {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
pass.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint16, 1); pass.SetIndexBuffer(indexBuffer, wgpu::IndexFormat::Uint16, 1);
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(encoder.Finish()); ASSERT_DEVICE_ERROR(encoder.Finish());
} }
} }

View File

@ -190,7 +190,7 @@ TEST_F(LabelTest, ComputePassEncoder) {
wgpu::ComputePassEncoder encoder = commandEncoder.BeginComputePass(&descriptor); wgpu::ComputePassEncoder encoder = commandEncoder.BeginComputePass(&descriptor);
std::string readbackLabel = dawn::native::GetObjectLabelForTesting(encoder.Get()); std::string readbackLabel = dawn::native::GetObjectLabelForTesting(encoder.Get());
ASSERT_TRUE(readbackLabel.empty()); ASSERT_TRUE(readbackLabel.empty());
encoder.EndPass(); encoder.End();
} }
// Test setting a label through API // Test setting a label through API
@ -199,7 +199,7 @@ TEST_F(LabelTest, ComputePassEncoder) {
encoder.SetLabel(label.c_str()); encoder.SetLabel(label.c_str());
std::string readbackLabel = dawn::native::GetObjectLabelForTesting(encoder.Get()); std::string readbackLabel = dawn::native::GetObjectLabelForTesting(encoder.Get());
ASSERT_EQ(label, readbackLabel); ASSERT_EQ(label, readbackLabel);
encoder.EndPass(); encoder.End();
} }
// Test setting a label through the descriptor. // Test setting a label through the descriptor.
@ -208,7 +208,7 @@ TEST_F(LabelTest, ComputePassEncoder) {
wgpu::ComputePassEncoder encoder = commandEncoder.BeginComputePass(&descriptor); wgpu::ComputePassEncoder encoder = commandEncoder.BeginComputePass(&descriptor);
std::string readbackLabel = dawn::native::GetObjectLabelForTesting(encoder.Get()); std::string readbackLabel = dawn::native::GetObjectLabelForTesting(encoder.Get());
ASSERT_EQ(label, readbackLabel); ASSERT_EQ(label, readbackLabel);
encoder.EndPass(); encoder.End();
} }
} }
@ -368,7 +368,7 @@ TEST_F(LabelTest, RenderPassEncoder) {
wgpu::RenderPassEncoder encoder = commandEncoder.BeginRenderPass(&descriptor); wgpu::RenderPassEncoder encoder = commandEncoder.BeginRenderPass(&descriptor);
std::string readbackLabel = dawn::native::GetObjectLabelForTesting(encoder.Get()); std::string readbackLabel = dawn::native::GetObjectLabelForTesting(encoder.Get());
ASSERT_TRUE(readbackLabel.empty()); ASSERT_TRUE(readbackLabel.empty());
encoder.EndPass(); encoder.End();
} }
// Test setting a label through API // Test setting a label through API
@ -377,7 +377,7 @@ TEST_F(LabelTest, RenderPassEncoder) {
encoder.SetLabel(label.c_str()); encoder.SetLabel(label.c_str());
std::string readbackLabel = dawn::native::GetObjectLabelForTesting(encoder.Get()); std::string readbackLabel = dawn::native::GetObjectLabelForTesting(encoder.Get());
ASSERT_EQ(label, readbackLabel); ASSERT_EQ(label, readbackLabel);
encoder.EndPass(); encoder.End();
} }
// Test setting a label through the descriptor. // Test setting a label through the descriptor.
@ -386,7 +386,7 @@ TEST_F(LabelTest, RenderPassEncoder) {
wgpu::RenderPassEncoder encoder = commandEncoder.BeginRenderPass(&descriptor); wgpu::RenderPassEncoder encoder = commandEncoder.BeginRenderPass(&descriptor);
std::string readbackLabel = dawn::native::GetObjectLabelForTesting(encoder.Get()); std::string readbackLabel = dawn::native::GetObjectLabelForTesting(encoder.Get());
ASSERT_EQ(label, readbackLabel); ASSERT_EQ(label, readbackLabel);
encoder.EndPass(); encoder.End();
} }
} }

View File

@ -288,7 +288,7 @@ class MinBufferSizeTestsBase : public ValidationTest {
computePassEncoder.SetBindGroup(i, bindGroups[i]); computePassEncoder.SetBindGroup(i, bindGroups[i]);
} }
computePassEncoder.Dispatch(1); computePassEncoder.Dispatch(1);
computePassEncoder.EndPass(); computePassEncoder.End();
if (!expectation) { if (!expectation) {
ASSERT_DEVICE_ERROR(commandEncoder.Finish()); ASSERT_DEVICE_ERROR(commandEncoder.Finish());
} else { } else {
@ -309,7 +309,7 @@ class MinBufferSizeTestsBase : public ValidationTest {
renderPassEncoder.SetBindGroup(i, bindGroups[i]); renderPassEncoder.SetBindGroup(i, bindGroups[i]);
} }
renderPassEncoder.Draw(3); renderPassEncoder.Draw(3);
renderPassEncoder.EndPass(); renderPassEncoder.End();
if (!expectation) { if (!expectation) {
ASSERT_DEVICE_ERROR(commandEncoder.Finish()); ASSERT_DEVICE_ERROR(commandEncoder.Finish());
} else { } else {

View File

@ -94,7 +94,7 @@ namespace {
CreatePipeline(kFormat, depthWriteInPipeline, stencilWriteInPipeline); CreatePipeline(kFormat, depthWriteInPipeline, stencilWriteInPipeline);
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
if (depthStencilReadOnlyInPass && if (depthStencilReadOnlyInPass &&
(depthWriteInPipeline || stencilWriteInPipeline)) { (depthWriteInPipeline || stencilWriteInPipeline)) {
ASSERT_DEVICE_ERROR(encoder.Finish()); ASSERT_DEVICE_ERROR(encoder.Finish());
@ -163,7 +163,7 @@ namespace {
kFormat, depthStencilReadOnlyInPass, depthStencilReadOnlyInPass); kFormat, depthStencilReadOnlyInPass, depthStencilReadOnlyInPass);
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&passDescriptor); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&passDescriptor);
pass.ExecuteBundles(1, &bundle); pass.ExecuteBundles(1, &bundle);
pass.EndPass(); pass.End();
if (!depthStencilReadOnlyInPass || depthStencilReadOnlyInBundle) { if (!depthStencilReadOnlyInPass || depthStencilReadOnlyInBundle) {
encoder.Finish(); encoder.Finish();
} else { } else {

View File

@ -93,7 +93,7 @@ TEST_F(OcclusionQueryValidationTest, InvalidOcclusionQuerySet) {
pass.EndOcclusionQuery(); pass.EndOcclusionQuery();
pass.BeginOcclusionQuery(1); pass.BeginOcclusionQuery(1);
pass.EndOcclusionQuery(); pass.EndOcclusionQuery();
pass.EndPass(); pass.End();
encoder.Finish(); encoder.Finish();
} }
@ -104,7 +104,7 @@ TEST_F(OcclusionQueryValidationTest, InvalidOcclusionQuerySet) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPassWithoutOcclusion); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPassWithoutOcclusion);
pass.BeginOcclusionQuery(0); pass.BeginOcclusionQuery(0);
pass.EndOcclusionQuery(); pass.EndOcclusionQuery();
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(encoder.Finish()); ASSERT_DEVICE_ERROR(encoder.Finish());
} }
@ -116,7 +116,7 @@ TEST_F(OcclusionQueryValidationTest, InvalidOcclusionQuerySet) {
renderPass.occlusionQuerySet = occlusionQuerySetOnOther; renderPass.occlusionQuerySet = occlusionQuerySetOnOther;
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(encoder.Finish()); ASSERT_DEVICE_ERROR(encoder.Finish());
// Clear this out so we don't hold a reference. The query set // Clear this out so we don't hold a reference. The query set
@ -131,7 +131,7 @@ TEST_F(OcclusionQueryValidationTest, InvalidOcclusionQuerySet) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
pass.BeginOcclusionQuery(0); pass.BeginOcclusionQuery(0);
pass.EndOcclusionQuery(); pass.EndOcclusionQuery();
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
wgpu::Queue queue = device.GetQueue(); wgpu::Queue queue = device.GetQueue();
occlusionQuerySet.Destroy(); occlusionQuerySet.Destroy();
@ -151,7 +151,7 @@ TEST_F(OcclusionQueryValidationTest, InvalidQueryIndex) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
pass.BeginOcclusionQuery(2); pass.BeginOcclusionQuery(2);
pass.EndOcclusionQuery(); pass.EndOcclusionQuery();
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(encoder.Finish()); ASSERT_DEVICE_ERROR(encoder.Finish());
} }
@ -161,12 +161,12 @@ TEST_F(OcclusionQueryValidationTest, InvalidQueryIndex) {
wgpu::RenderPassEncoder pass0 = encoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass0 = encoder.BeginRenderPass(&renderPass);
pass0.BeginOcclusionQuery(0); pass0.BeginOcclusionQuery(0);
pass0.EndOcclusionQuery(); pass0.EndOcclusionQuery();
pass0.EndPass(); pass0.End();
wgpu::RenderPassEncoder pass1 = encoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass1 = encoder.BeginRenderPass(&renderPass);
pass1.BeginOcclusionQuery(0); pass1.BeginOcclusionQuery(0);
pass1.EndOcclusionQuery(); pass1.EndOcclusionQuery();
pass1.EndPass(); pass1.End();
encoder.Finish(); encoder.Finish();
} }
@ -178,7 +178,7 @@ TEST_F(OcclusionQueryValidationTest, InvalidQueryIndex) {
pass.EndOcclusionQuery(); pass.EndOcclusionQuery();
pass.BeginOcclusionQuery(0); pass.BeginOcclusionQuery(0);
pass.EndOcclusionQuery(); pass.EndOcclusionQuery();
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(encoder.Finish()); ASSERT_DEVICE_ERROR(encoder.Finish());
} }
} }
@ -196,7 +196,7 @@ TEST_F(OcclusionQueryValidationTest, InvalidBeginAndEnd) {
pass.BeginOcclusionQuery(0); pass.BeginOcclusionQuery(0);
pass.BeginOcclusionQuery(1); pass.BeginOcclusionQuery(1);
pass.EndOcclusionQuery(); pass.EndOcclusionQuery();
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(encoder.Finish()); ASSERT_DEVICE_ERROR(encoder.Finish());
} }
@ -208,7 +208,7 @@ TEST_F(OcclusionQueryValidationTest, InvalidBeginAndEnd) {
pass.BeginOcclusionQuery(1); pass.BeginOcclusionQuery(1);
pass.EndOcclusionQuery(); pass.EndOcclusionQuery();
pass.EndOcclusionQuery(); pass.EndOcclusionQuery();
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(encoder.Finish()); ASSERT_DEVICE_ERROR(encoder.Finish());
} }
@ -217,7 +217,7 @@ TEST_F(OcclusionQueryValidationTest, InvalidBeginAndEnd) {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
pass.EndOcclusionQuery(); pass.EndOcclusionQuery();
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(encoder.Finish()); ASSERT_DEVICE_ERROR(encoder.Finish());
} }
} }
@ -317,7 +317,7 @@ TEST_F(TimestampQueryValidationTest, WriteTimestampOnComputePassEncoder) {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::ComputePassEncoder pass = encoder.BeginComputePass(); wgpu::ComputePassEncoder pass = encoder.BeginComputePass();
pass.WriteTimestamp(timestampQuerySet, 0); pass.WriteTimestamp(timestampQuerySet, 0);
pass.EndPass(); pass.End();
encoder.Finish(); encoder.Finish();
} }
@ -326,7 +326,7 @@ TEST_F(TimestampQueryValidationTest, WriteTimestampOnComputePassEncoder) {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::ComputePassEncoder pass = encoder.BeginComputePass(); wgpu::ComputePassEncoder pass = encoder.BeginComputePass();
pass.WriteTimestamp(occlusionQuerySet, 0); pass.WriteTimestamp(occlusionQuerySet, 0);
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(encoder.Finish()); ASSERT_DEVICE_ERROR(encoder.Finish());
} }
@ -335,7 +335,7 @@ TEST_F(TimestampQueryValidationTest, WriteTimestampOnComputePassEncoder) {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::ComputePassEncoder pass = encoder.BeginComputePass(); wgpu::ComputePassEncoder pass = encoder.BeginComputePass();
pass.WriteTimestamp(timestampQuerySet, 2); pass.WriteTimestamp(timestampQuerySet, 2);
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(encoder.Finish()); ASSERT_DEVICE_ERROR(encoder.Finish());
} }
@ -344,7 +344,7 @@ TEST_F(TimestampQueryValidationTest, WriteTimestampOnComputePassEncoder) {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::ComputePassEncoder pass = encoder.BeginComputePass(); wgpu::ComputePassEncoder pass = encoder.BeginComputePass();
pass.WriteTimestamp(timestampQuerySet, 0); pass.WriteTimestamp(timestampQuerySet, 0);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
wgpu::Queue queue = device.GetQueue(); wgpu::Queue queue = device.GetQueue();
@ -365,7 +365,7 @@ TEST_F(TimestampQueryValidationTest, WriteTimestampOnRenderPassEncoder) {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
pass.WriteTimestamp(timestampQuerySet, 0); pass.WriteTimestamp(timestampQuerySet, 0);
pass.EndPass(); pass.End();
encoder.Finish(); encoder.Finish();
} }
@ -374,7 +374,7 @@ TEST_F(TimestampQueryValidationTest, WriteTimestampOnRenderPassEncoder) {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
pass.WriteTimestamp(occlusionQuerySet, 0); pass.WriteTimestamp(occlusionQuerySet, 0);
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(encoder.Finish()); ASSERT_DEVICE_ERROR(encoder.Finish());
} }
@ -383,7 +383,7 @@ TEST_F(TimestampQueryValidationTest, WriteTimestampOnRenderPassEncoder) {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
pass.WriteTimestamp(timestampQuerySet, 2); pass.WriteTimestamp(timestampQuerySet, 2);
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(encoder.Finish()); ASSERT_DEVICE_ERROR(encoder.Finish());
} }
@ -394,7 +394,7 @@ TEST_F(TimestampQueryValidationTest, WriteTimestampOnRenderPassEncoder) {
encoder.WriteTimestamp(timestampQuerySet, 0); encoder.WriteTimestamp(timestampQuerySet, 0);
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
pass.WriteTimestamp(timestampQuerySet, 0); pass.WriteTimestamp(timestampQuerySet, 0);
pass.EndPass(); pass.End();
encoder.Finish(); encoder.Finish();
} }
@ -403,10 +403,10 @@ TEST_F(TimestampQueryValidationTest, WriteTimestampOnRenderPassEncoder) {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass0 = encoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass0 = encoder.BeginRenderPass(&renderPass);
pass0.WriteTimestamp(timestampQuerySet, 0); pass0.WriteTimestamp(timestampQuerySet, 0);
pass0.EndPass(); pass0.End();
wgpu::RenderPassEncoder pass1 = encoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass1 = encoder.BeginRenderPass(&renderPass);
pass1.WriteTimestamp(timestampQuerySet, 0); pass1.WriteTimestamp(timestampQuerySet, 0);
pass1.EndPass(); pass1.End();
encoder.Finish(); encoder.Finish();
} }
@ -416,7 +416,7 @@ TEST_F(TimestampQueryValidationTest, WriteTimestampOnRenderPassEncoder) {
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
pass.WriteTimestamp(timestampQuerySet, 0); pass.WriteTimestamp(timestampQuerySet, 0);
pass.WriteTimestamp(timestampQuerySet, 0); pass.WriteTimestamp(timestampQuerySet, 0);
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(encoder.Finish()); ASSERT_DEVICE_ERROR(encoder.Finish());
} }
@ -425,7 +425,7 @@ TEST_F(TimestampQueryValidationTest, WriteTimestampOnRenderPassEncoder) {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
pass.WriteTimestamp(timestampQuerySet, 0); pass.WriteTimestamp(timestampQuerySet, 0);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
wgpu::Queue queue = device.GetQueue(); wgpu::Queue queue = device.GetQueue();

View File

@ -251,7 +251,7 @@ namespace {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::ComputePassEncoder pass = encoder.BeginComputePass(); wgpu::ComputePassEncoder pass = encoder.BeginComputePass();
pass.SetBindGroup(1, unusedBG); pass.SetBindGroup(1, unusedBG);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
if (destroy) { if (destroy) {
@ -277,7 +277,7 @@ namespace {
pass.SetBindGroup(1, usedBG); pass.SetBindGroup(1, usedBG);
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.Dispatch(1); pass.Dispatch(1);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
if (destroy) { if (destroy) {
@ -321,7 +321,7 @@ namespace {
wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
wgpu::ComputePassEncoder pass = encoder.BeginComputePass(); wgpu::ComputePassEncoder pass = encoder.BeginComputePass();
pass.SetBindGroup(2, unusedBG); pass.SetBindGroup(2, unusedBG);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
if (destroy) { if (destroy) {
@ -350,7 +350,7 @@ namespace {
pass.SetBindGroup(2, usedBG); pass.SetBindGroup(2, usedBG);
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.Dispatch(1); pass.Dispatch(1);
pass.EndPass(); pass.End();
wgpu::CommandBuffer commands = encoder.Finish(); wgpu::CommandBuffer commands = encoder.Finish();
if (destroy) { if (destroy) {

View File

@ -137,7 +137,7 @@ TEST_F(RenderBundleValidationTest, Empty) {
wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder(); wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass);
pass.ExecuteBundles(1, &renderBundle); pass.ExecuteBundles(1, &renderBundle);
pass.EndPass(); pass.End();
commandEncoder.Finish(); commandEncoder.Finish();
} }
@ -159,7 +159,7 @@ TEST_F(RenderBundleValidationTest, EmptyErrorEncoderProducesErrorBundle) {
wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder(); wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass);
pass.ExecuteBundles(1, &renderBundle); pass.ExecuteBundles(1, &renderBundle);
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(commandEncoder.Finish()); ASSERT_DEVICE_ERROR(commandEncoder.Finish());
} }
@ -170,7 +170,7 @@ TEST_F(RenderBundleValidationTest, ZeroBundles) {
wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder(); wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass);
pass.ExecuteBundles(0, nullptr); pass.ExecuteBundles(0, nullptr);
pass.EndPass(); pass.End();
commandEncoder.Finish(); commandEncoder.Finish();
} }
@ -193,7 +193,7 @@ TEST_F(RenderBundleValidationTest, SimpleSuccess) {
wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder(); wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass);
pass.ExecuteBundles(1, &renderBundle); pass.ExecuteBundles(1, &renderBundle);
pass.EndPass(); pass.End();
commandEncoder.Finish(); commandEncoder.Finish();
} }
@ -279,7 +279,7 @@ TEST_F(RenderBundleValidationTest, StateInheritance) {
ASSERT_DEVICE_ERROR(wgpu::RenderBundle renderBundle = renderBundleEncoder.Finish()); ASSERT_DEVICE_ERROR(wgpu::RenderBundle renderBundle = renderBundleEncoder.Finish());
pass.ExecuteBundles(1, &renderBundle); pass.ExecuteBundles(1, &renderBundle);
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(commandEncoder.Finish()); ASSERT_DEVICE_ERROR(commandEncoder.Finish());
} }
@ -298,7 +298,7 @@ TEST_F(RenderBundleValidationTest, StateInheritance) {
ASSERT_DEVICE_ERROR(wgpu::RenderBundle renderBundle = renderBundleEncoder.Finish()); ASSERT_DEVICE_ERROR(wgpu::RenderBundle renderBundle = renderBundleEncoder.Finish());
pass.ExecuteBundles(1, &renderBundle); pass.ExecuteBundles(1, &renderBundle);
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(commandEncoder.Finish()); ASSERT_DEVICE_ERROR(commandEncoder.Finish());
} }
@ -317,7 +317,7 @@ TEST_F(RenderBundleValidationTest, StateInheritance) {
ASSERT_DEVICE_ERROR(wgpu::RenderBundle renderBundle = renderBundleEncoder.Finish()); ASSERT_DEVICE_ERROR(wgpu::RenderBundle renderBundle = renderBundleEncoder.Finish());
pass.ExecuteBundles(1, &renderBundle); pass.ExecuteBundles(1, &renderBundle);
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(commandEncoder.Finish()); ASSERT_DEVICE_ERROR(commandEncoder.Finish());
} }
@ -336,7 +336,7 @@ TEST_F(RenderBundleValidationTest, StateInheritance) {
ASSERT_DEVICE_ERROR(wgpu::RenderBundle renderBundle = renderBundleEncoder.Finish()); ASSERT_DEVICE_ERROR(wgpu::RenderBundle renderBundle = renderBundleEncoder.Finish());
pass.ExecuteBundles(1, &renderBundle); pass.ExecuteBundles(1, &renderBundle);
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(commandEncoder.Finish()); ASSERT_DEVICE_ERROR(commandEncoder.Finish());
} }
} }
@ -363,7 +363,7 @@ TEST_F(RenderBundleValidationTest, StatePersistence) {
pass.SetBindGroup(1, bg1); pass.SetBindGroup(1, bg1);
pass.SetVertexBuffer(0, vertexBuffer); pass.SetVertexBuffer(0, vertexBuffer);
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(commandEncoder.Finish()); ASSERT_DEVICE_ERROR(commandEncoder.Finish());
} }
@ -382,7 +382,7 @@ TEST_F(RenderBundleValidationTest, StatePersistence) {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetVertexBuffer(0, vertexBuffer); pass.SetVertexBuffer(0, vertexBuffer);
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(commandEncoder.Finish()); ASSERT_DEVICE_ERROR(commandEncoder.Finish());
} }
@ -401,7 +401,7 @@ TEST_F(RenderBundleValidationTest, StatePersistence) {
pass.ExecuteBundles(1, &renderBundle); pass.ExecuteBundles(1, &renderBundle);
pass.SetVertexBuffer(0, vertexBuffer); pass.SetVertexBuffer(0, vertexBuffer);
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(commandEncoder.Finish()); ASSERT_DEVICE_ERROR(commandEncoder.Finish());
} }
@ -420,7 +420,7 @@ TEST_F(RenderBundleValidationTest, StatePersistence) {
pass.SetBindGroup(0, bg0); pass.SetBindGroup(0, bg0);
pass.SetBindGroup(1, bg1); pass.SetBindGroup(1, bg1);
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(commandEncoder.Finish()); ASSERT_DEVICE_ERROR(commandEncoder.Finish());
} }
@ -448,7 +448,7 @@ TEST_F(RenderBundleValidationTest, ClearsState) {
pass.SetBindGroup(1, bg1); pass.SetBindGroup(1, bg1);
pass.SetVertexBuffer(0, vertexBuffer); pass.SetVertexBuffer(0, vertexBuffer);
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(commandEncoder.Finish()); ASSERT_DEVICE_ERROR(commandEncoder.Finish());
} }
@ -464,7 +464,7 @@ TEST_F(RenderBundleValidationTest, ClearsState) {
pass.SetPipeline(pipeline); pass.SetPipeline(pipeline);
pass.SetVertexBuffer(0, vertexBuffer); pass.SetVertexBuffer(0, vertexBuffer);
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(commandEncoder.Finish()); ASSERT_DEVICE_ERROR(commandEncoder.Finish());
} }
@ -480,7 +480,7 @@ TEST_F(RenderBundleValidationTest, ClearsState) {
pass.ExecuteBundles(1, &renderBundle); pass.ExecuteBundles(1, &renderBundle);
pass.SetVertexBuffer(0, vertexBuffer); pass.SetVertexBuffer(0, vertexBuffer);
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(commandEncoder.Finish()); ASSERT_DEVICE_ERROR(commandEncoder.Finish());
} }
@ -496,7 +496,7 @@ TEST_F(RenderBundleValidationTest, ClearsState) {
pass.SetBindGroup(0, bg0); pass.SetBindGroup(0, bg0);
pass.SetBindGroup(1, bg1); pass.SetBindGroup(1, bg1);
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(commandEncoder.Finish()); ASSERT_DEVICE_ERROR(commandEncoder.Finish());
} }
@ -513,7 +513,7 @@ TEST_F(RenderBundleValidationTest, ClearsState) {
pass.ExecuteBundles(0, nullptr); pass.ExecuteBundles(0, nullptr);
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(commandEncoder.Finish()); ASSERT_DEVICE_ERROR(commandEncoder.Finish());
} }
} }
@ -547,7 +547,7 @@ TEST_F(RenderBundleValidationTest, MultipleBundles) {
wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder(); wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass);
pass.ExecuteBundles(2, renderBundles); pass.ExecuteBundles(2, renderBundles);
pass.EndPass(); pass.End();
commandEncoder.Finish(); commandEncoder.Finish();
} }
@ -572,7 +572,7 @@ TEST_F(RenderBundleValidationTest, ExecuteMultipleTimes) {
pass.ExecuteBundles(1, &renderBundle); pass.ExecuteBundles(1, &renderBundle);
pass.ExecuteBundles(1, &renderBundle); pass.ExecuteBundles(1, &renderBundle);
pass.ExecuteBundles(1, &renderBundle); pass.ExecuteBundles(1, &renderBundle);
pass.EndPass(); pass.End();
commandEncoder.Finish(); commandEncoder.Finish();
} }
@ -725,7 +725,7 @@ TEST_F(RenderBundleValidationTest, UsageTracking) {
wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass);
pass.ExecuteBundles(1, &renderBundle0); pass.ExecuteBundles(1, &renderBundle0);
pass.ExecuteBundles(1, &renderBundle1); pass.ExecuteBundles(1, &renderBundle1);
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(commandEncoder.Finish()); ASSERT_DEVICE_ERROR(commandEncoder.Finish());
} }
@ -743,7 +743,7 @@ TEST_F(RenderBundleValidationTest, UsageTracking) {
pass.Draw(3); pass.Draw(3);
pass.ExecuteBundles(1, &renderBundle1); pass.ExecuteBundles(1, &renderBundle1);
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(commandEncoder.Finish()); ASSERT_DEVICE_ERROR(commandEncoder.Finish());
} }
@ -762,7 +762,7 @@ TEST_F(RenderBundleValidationTest, UsageTracking) {
pass.SetVertexBuffer(0, vertexStorageBuffer); pass.SetVertexBuffer(0, vertexStorageBuffer);
pass.Draw(3); pass.Draw(3);
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(commandEncoder.Finish()); ASSERT_DEVICE_ERROR(commandEncoder.Finish());
} }
} }
@ -948,7 +948,7 @@ TEST_F(RenderBundleValidationTest, RenderPassColorFormatMismatch) {
wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder(); wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass);
pass.ExecuteBundles(1, &renderBundle); pass.ExecuteBundles(1, &renderBundle);
pass.EndPass(); pass.End();
commandEncoder.Finish(); commandEncoder.Finish();
} }
@ -963,7 +963,7 @@ TEST_F(RenderBundleValidationTest, RenderPassColorFormatMismatch) {
wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder(); wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass);
pass.ExecuteBundles(1, &renderBundle); pass.ExecuteBundles(1, &renderBundle);
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(commandEncoder.Finish()); ASSERT_DEVICE_ERROR(commandEncoder.Finish());
} }
@ -977,7 +977,7 @@ TEST_F(RenderBundleValidationTest, RenderPassColorFormatMismatch) {
wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder(); wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass);
pass.ExecuteBundles(1, &renderBundle); pass.ExecuteBundles(1, &renderBundle);
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(commandEncoder.Finish()); ASSERT_DEVICE_ERROR(commandEncoder.Finish());
} }
} }
@ -1014,7 +1014,7 @@ TEST_F(RenderBundleValidationTest, RenderPassDepthStencilFormatMismatch) {
wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder(); wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass);
pass.ExecuteBundles(1, &renderBundle); pass.ExecuteBundles(1, &renderBundle);
pass.EndPass(); pass.End();
commandEncoder.Finish(); commandEncoder.Finish();
} }
@ -1025,7 +1025,7 @@ TEST_F(RenderBundleValidationTest, RenderPassDepthStencilFormatMismatch) {
wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder(); wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass);
pass.ExecuteBundles(1, &renderBundle); pass.ExecuteBundles(1, &renderBundle);
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(commandEncoder.Finish()); ASSERT_DEVICE_ERROR(commandEncoder.Finish());
} }
@ -1036,7 +1036,7 @@ TEST_F(RenderBundleValidationTest, RenderPassDepthStencilFormatMismatch) {
wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder(); wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass);
pass.ExecuteBundles(1, &renderBundle); pass.ExecuteBundles(1, &renderBundle);
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(commandEncoder.Finish()); ASSERT_DEVICE_ERROR(commandEncoder.Finish());
} }
} }
@ -1068,7 +1068,7 @@ TEST_F(RenderBundleValidationTest, RenderPassSampleCountMismatch) {
wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder(); wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass);
pass.ExecuteBundles(1, &renderBundle); pass.ExecuteBundles(1, &renderBundle);
pass.EndPass(); pass.End();
commandEncoder.Finish(); commandEncoder.Finish();
} }
@ -1079,7 +1079,7 @@ TEST_F(RenderBundleValidationTest, RenderPassSampleCountMismatch) {
wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder(); wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder pass = commandEncoder.BeginRenderPass(&renderPass);
pass.ExecuteBundles(1, &renderBundle); pass.ExecuteBundles(1, &renderBundle);
pass.EndPass(); pass.End();
ASSERT_DEVICE_ERROR(commandEncoder.Finish()); ASSERT_DEVICE_ERROR(commandEncoder.Finish());
} }
} }

View File

@ -37,7 +37,7 @@ namespace {
wgpu::CommandEncoder TestBeginRenderPass(const wgpu::RenderPassDescriptor* descriptor) { wgpu::CommandEncoder TestBeginRenderPass(const wgpu::RenderPassDescriptor* descriptor) {
wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder(); wgpu::CommandEncoder commandEncoder = device.CreateCommandEncoder();
wgpu::RenderPassEncoder renderPassEncoder = commandEncoder.BeginRenderPass(descriptor); wgpu::RenderPassEncoder renderPassEncoder = commandEncoder.BeginRenderPass(descriptor);
renderPassEncoder.EndPass(); renderPassEncoder.End();
return commandEncoder; return commandEncoder;
} }
}; };

Some files were not shown because too many files have changed in this diff Show More