From 89c89b76403a0bf7392e49ff5ee9d7e7ef1de426 Mon Sep 17 00:00:00 2001 From: Loko Kung Date: Sat, 22 Apr 2023 00:33:51 +0000 Subject: [PATCH] Removes deprecation period code for renamed APIs (i.e. endPass/dispatch) - Note that by default these are already errors, not warnings. Change-Id: If35284041963cd387839fe102efe4dca73e594dc Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/128064 Reviewed-by: Shrek Shao Reviewed-by: Austin Eng Kokoro: Kokoro Commit-Queue: Loko Kung --- dawn.json | 25 --------- src/dawn/native/ComputePassEncoder.cpp | 27 ---------- src/dawn/native/ComputePassEncoder.h | 7 --- src/dawn/native/RenderPassEncoder.cpp | 8 --- src/dawn/native/RenderPassEncoder.h | 1 - .../validation/DeprecatedAPITests.cpp | 54 ------------------- .../unittests/wire/WireArgumentTests.cpp | 4 +- 7 files changed, 2 insertions(+), 124 deletions(-) diff --git a/dawn.json b/dawn.json index c81698367e..f6f8ea234e 100644 --- a/dawn.json +++ b/dawn.json @@ -843,15 +843,6 @@ {"name": "query index", "type": "uint32_t"} ] }, - { - "name": "dispatch", - "tags": ["deprecated"], - "args": [ - {"name": "workgroupCountX", "type": "uint32_t"}, - {"name": "workgroupCountY", "type": "uint32_t", "default": "1"}, - {"name": "workgroupCountZ", "type": "uint32_t", "default": "1"} - ] - }, { "name": "dispatch workgroups", "args": [ @@ -860,14 +851,6 @@ {"name": "workgroupCountZ", "type": "uint32_t", "default": "1"} ] }, - { - "name": "dispatch indirect", - "tags": ["deprecated"], - "args": [ - {"name": "indirect buffer", "type": "buffer"}, - {"name": "indirect offset", "type": "uint64_t"} - ] - }, { "name": "dispatch workgroups indirect", "args": [ @@ -878,10 +861,6 @@ { "name": "end" }, - { - "name": "end pass", - "tags": ["deprecated"] - }, { "name": "end pipeline statistics query", "tags": ["upstream", "emscripten"] @@ -2186,10 +2165,6 @@ { "name": "end" }, - { - "name": "end pass", - "tags": ["deprecated"] - }, { "name": "end pipeline statistics query", "tags": ["upstream", "emscripten"] diff --git a/src/dawn/native/ComputePassEncoder.cpp b/src/dawn/native/ComputePassEncoder.cpp index 11254b6b55..30f4db1bb5 100644 --- a/src/dawn/native/ComputePassEncoder.cpp +++ b/src/dawn/native/ComputePassEncoder.cpp @@ -176,24 +176,6 @@ void ComputePassEncoder::APIEnd() { } } -void ComputePassEncoder::APIEndPass() { - if (GetDevice()->ConsumedError(DAWN_MAKE_DEPRECATION_ERROR( - GetDevice(), "endPass() has been deprecated. Use end() instead."))) { - return; - } - APIEnd(); -} - -void ComputePassEncoder::APIDispatch(uint32_t workgroupCountX, - uint32_t workgroupCountY, - uint32_t workgroupCountZ) { - if (GetDevice()->ConsumedError(DAWN_MAKE_DEPRECATION_ERROR( - GetDevice(), "dispatch() has been deprecated. Use dispatchWorkgroups() instead."))) { - return; - } - APIDispatchWorkgroups(workgroupCountX, workgroupCountY, workgroupCountZ); -} - void ComputePassEncoder::APIDispatchWorkgroups(uint32_t workgroupCountX, uint32_t workgroupCountY, uint32_t workgroupCountZ) { @@ -331,15 +313,6 @@ ComputePassEncoder::TransformIndirectDispatchBuffer(Ref indirectBuff return std::make_pair(std::move(validatedIndirectBuffer), uint64_t(0)); } -void ComputePassEncoder::APIDispatchIndirect(BufferBase* indirectBuffer, uint64_t indirectOffset) { - if (GetDevice()->ConsumedError(DAWN_MAKE_DEPRECATION_ERROR( - GetDevice(), - "dispatchIndirect() has been deprecated. Use dispatchWorkgroupsIndirect() instead."))) { - return; - } - APIDispatchWorkgroupsIndirect(indirectBuffer, indirectOffset); -} - void ComputePassEncoder::APIDispatchWorkgroupsIndirect(BufferBase* indirectBuffer, uint64_t indirectOffset) { mEncodingContext->TryEncode( diff --git a/src/dawn/native/ComputePassEncoder.h b/src/dawn/native/ComputePassEncoder.h index ae5de357b0..2d6600ba20 100644 --- a/src/dawn/native/ComputePassEncoder.h +++ b/src/dawn/native/ComputePassEncoder.h @@ -42,7 +42,6 @@ class ComputePassEncoder final : public ProgrammableEncoder { ObjectType GetType() const override; void APIEnd(); - void APIEndPass(); // TODO(dawn:1286): Remove after deprecation period. void APIDispatchWorkgroups(uint32_t workgroupCountX, uint32_t workgroupCountY = 1, @@ -62,12 +61,6 @@ class ComputePassEncoder final : public ProgrammableEncoder { RestoreCommandBufferState(std::move(state)); } - // Deprecated - void APIDispatch(uint32_t workgroupCountX, - uint32_t workgroupCountY = 1, - uint32_t workgroupCountZ = 1); - void APIDispatchIndirect(BufferBase* indirectBuffer, uint64_t indirectOffset); - protected: ComputePassEncoder(DeviceBase* device, const ComputePassDescriptor* descriptor, diff --git a/src/dawn/native/RenderPassEncoder.cpp b/src/dawn/native/RenderPassEncoder.cpp index 5b0b318a09..0d6759bdb4 100644 --- a/src/dawn/native/RenderPassEncoder.cpp +++ b/src/dawn/native/RenderPassEncoder.cpp @@ -184,14 +184,6 @@ void RenderPassEncoder::End() { } } -void RenderPassEncoder::APIEndPass() { - if (GetDevice()->ConsumedError(DAWN_MAKE_DEPRECATION_ERROR( - GetDevice(), "endPass() has been deprecated. Use end() instead."))) { - return; - } - APIEnd(); -} - void RenderPassEncoder::APISetStencilReference(uint32_t reference) { mEncodingContext->TryEncode( this, diff --git a/src/dawn/native/RenderPassEncoder.h b/src/dawn/native/RenderPassEncoder.h index c0f596f4d9..03738ff082 100644 --- a/src/dawn/native/RenderPassEncoder.h +++ b/src/dawn/native/RenderPassEncoder.h @@ -48,7 +48,6 @@ class RenderPassEncoder final : public RenderEncoderBase { // NOTE: this will lock the device internally. To avoid deadlock when the device is already // locked, use End() instead. void APIEnd(); - void APIEndPass(); // TODO(dawn:1286): Remove after deprecation period. void APISetStencilReference(uint32_t reference); void APISetBlendConstant(const Color* color); diff --git a/src/dawn/tests/unittests/validation/DeprecatedAPITests.cpp b/src/dawn/tests/unittests/validation/DeprecatedAPITests.cpp index 464f379101..1c5d46b6a1 100644 --- a/src/dawn/tests/unittests/validation/DeprecatedAPITests.cpp +++ b/src/dawn/tests/unittests/validation/DeprecatedAPITests.cpp @@ -24,57 +24,3 @@ WGPUDevice DeprecationTests::CreateTestDevice(dawn::native::Adapter dawnAdapter) wgpu::DeviceDescriptor descriptor = {}; return dawnAdapter.CreateDevice(&descriptor); } - -// 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_ERROR_OR_WARNING(pass.EndPass()); - } - - { - wgpu::ComputePassEncoder pass = encoder.BeginComputePass(); - - EXPECT_DEPRECATION_ERROR_OR_WARNING(pass.EndPass()); - } -} - -// Test that dispatch() and dispatchIndirect() is deprecated. -TEST_P(DeprecationTests, Dispatch) { - wgpu::ShaderModule module = utils::CreateShaderModule(device, R"( - @compute @workgroup_size(1, 1, 1) - fn main() { - })"); - - wgpu::ComputePipelineDescriptor csDesc; - csDesc.compute.module = module; - csDesc.compute.entryPoint = "main"; - wgpu::ComputePipeline pipeline = device.CreateComputePipeline(&csDesc); - - std::array indirectBufferData = {1, 0, 0}; - - wgpu::Buffer indirectBuffer = utils::CreateBufferFromData( - device, &indirectBufferData[0], indirectBufferData.size() * sizeof(uint32_t), - wgpu::BufferUsage::Indirect); - - wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); - wgpu::ComputePassEncoder pass = encoder.BeginComputePass(); - pass.SetPipeline(pipeline); - - EXPECT_DEPRECATION_ERROR_OR_WARNING(pass.Dispatch(1)); - - EXPECT_DEPRECATION_ERROR_OR_WARNING(pass.DispatchIndirect(indirectBuffer, 0)); - - pass.End(); -} - -INSTANTIATE_TEST_SUITE_P(DeprecatedAPITest, - DeprecationTests, - testing::Values(true, false), - [](const testing::TestParamInfo& info) { - return info.param ? "Disallowed" : "Allowed"; - }); diff --git a/src/dawn/tests/unittests/wire/WireArgumentTests.cpp b/src/dawn/tests/unittests/wire/WireArgumentTests.cpp index 4f3be8b214..ec4cffcefd 100644 --- a/src/dawn/tests/unittests/wire/WireArgumentTests.cpp +++ b/src/dawn/tests/unittests/wire/WireArgumentTests.cpp @@ -34,7 +34,7 @@ class WireArgumentTests : public WireTest { TEST_F(WireArgumentTests, ValueArgument) { WGPUCommandEncoder encoder = wgpuDeviceCreateCommandEncoder(device, nullptr); WGPUComputePassEncoder pass = wgpuCommandEncoderBeginComputePass(encoder, nullptr); - wgpuComputePassEncoderDispatch(pass, 1, 2, 3); + wgpuComputePassEncoderDispatchWorkgroups(pass, 1, 2, 3); WGPUCommandEncoder apiEncoder = api.GetNewCommandEncoder(); EXPECT_CALL(api, DeviceCreateCommandEncoder(apiDevice, nullptr)).WillOnce(Return(apiEncoder)); @@ -42,7 +42,7 @@ TEST_F(WireArgumentTests, ValueArgument) { WGPUComputePassEncoder apiPass = api.GetNewComputePassEncoder(); EXPECT_CALL(api, CommandEncoderBeginComputePass(apiEncoder, nullptr)).WillOnce(Return(apiPass)); - EXPECT_CALL(api, ComputePassEncoderDispatch(apiPass, 1, 2, 3)).Times(1); + EXPECT_CALL(api, ComputePassEncoderDispatchWorkgroups(apiPass, 1, 2, 3)).Times(1); FlushClient(); }