From c7203ba8906701254103f28b2fcdc83359eb2038 Mon Sep 17 00:00:00 2001 From: Corentin Wallez Date: Tue, 14 Sep 2021 11:42:27 +0000 Subject: [PATCH] Remove deprecated ComputePipelineDescriptor.computeStage Bug: dawn:800 Change-Id: I8d9d2a7cdba328d1cf040f7c8c622d1d7d403be2 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63741 Commit-Queue: Corentin Wallez Reviewed-by: Austin Eng --- dawn.json | 3 +- dawn_wire.json | 1 - src/dawn_native/ComputePipeline.cpp | 17 ++-------- src/dawn_native/Device.cpp | 6 ---- src/dawn_wire/client/Device.cpp | 42 +----------------------- src/tests/end2end/DeprecatedAPITests.cpp | 12 ------- 6 files changed, 5 insertions(+), 76 deletions(-) diff --git a/dawn.json b/dawn.json index 3c1d704a60..4b0eb33a0f 100644 --- a/dawn.json +++ b/dawn.json @@ -627,8 +627,7 @@ "members": [ {"name": "label", "type": "char", "annotation": "const*", "length": "strlen", "optional": true}, {"name": "layout", "type": "pipeline layout", "optional": true}, - {"name": "compute", "type": "programmable stage descriptor"}, - {"name": "compute stage", "type": "programmable stage descriptor"} + {"name": "compute", "type": "programmable stage descriptor"} ] }, "alpha op": { diff --git a/dawn_wire.json b/dawn_wire.json index 1e70145a57..5f881c1e90 100644 --- a/dawn_wire.json +++ b/dawn_wire.json @@ -165,7 +165,6 @@ "client_handwritten_commands": [ "BufferDestroy", "BufferUnmap", - "DeviceCreateComputePipeline", "DeviceCreateErrorBuffer", "DeviceGetQueue", "DeviceInjectError", diff --git a/src/dawn_native/ComputePipeline.cpp b/src/dawn_native/ComputePipeline.cpp index 0575f904ef..87b2792528 100644 --- a/src/dawn_native/ComputePipeline.cpp +++ b/src/dawn_native/ComputePipeline.cpp @@ -29,20 +29,9 @@ namespace dawn_native { DAWN_TRY(device->ValidateObject(descriptor->layout)); } - if (descriptor->compute.module != nullptr) { - DAWN_TRY(ValidateProgrammableStage(device, descriptor->compute.module, - descriptor->compute.entryPoint, descriptor->layout, - SingleShaderStage::Compute)); - } else { - // TODO(dawn:800): Remove after deprecation period. - device->EmitDeprecationWarning( - "computeStage has been deprecated. Please begin using compute instead."); - DAWN_TRY(ValidateProgrammableStage(device, descriptor->computeStage.module, - descriptor->computeStage.entryPoint, - descriptor->layout, SingleShaderStage::Compute)); - } - - return {}; + return ValidateProgrammableStage(device, descriptor->compute.module, + descriptor->compute.entryPoint, descriptor->layout, + SingleShaderStage::Compute); } // ComputePipelineBase diff --git a/src/dawn_native/Device.cpp b/src/dawn_native/Device.cpp index 2d7a9c7dc2..8c6099a166 100644 --- a/src/dawn_native/Device.cpp +++ b/src/dawn_native/Device.cpp @@ -130,12 +130,6 @@ namespace dawn_native { ComputePipelineDescriptor* outDescriptor) { Ref layoutRef; *outDescriptor = descriptor; - // TODO(dawn:800): Remove after deprecation period. - if (outDescriptor->compute.module == nullptr && - outDescriptor->computeStage.module != nullptr) { - outDescriptor->compute.module = outDescriptor->computeStage.module; - outDescriptor->compute.entryPoint = outDescriptor->computeStage.entryPoint; - } if (outDescriptor->layout == nullptr) { DAWN_TRY_ASSIGN(layoutRef, PipelineLayoutBase::CreateDefault( diff --git a/src/dawn_wire/client/Device.cpp b/src/dawn_wire/client/Device.cpp index 17f98a5fc6..6ed46988e9 100644 --- a/src/dawn_wire/client/Device.cpp +++ b/src/dawn_wire/client/Device.cpp @@ -217,34 +217,6 @@ namespace dawn_wire { namespace client { return ToAPI(mQueue); } - // TODO(dawn:800): Once the deprecated computeStage field is removed this method will no longer - // be needed and DeviceCreateComputePipeline can be removed from client_handwritten_commands in - // dawn_wire.json - WGPUComputePipeline Device::CreateComputePipeline( - WGPUComputePipelineDescriptor const* descriptor) { - DeviceCreateComputePipelineCmd cmd; - cmd.self = ToAPI(this); - - auto* allocation = client->ComputePipelineAllocator().New(client); - cmd.result = ObjectHandle{allocation->object->id, allocation->generation}; - - // Copy compute to the deprecated computeStage or visa-versa, depending on which one is - // populated, so that serialization doesn't fail. - WGPUComputePipelineDescriptor localDescriptor = *descriptor; - if (localDescriptor.computeStage.module == nullptr) { - localDescriptor.computeStage.module = localDescriptor.compute.module; - localDescriptor.computeStage.entryPoint = localDescriptor.compute.entryPoint; - } else if (localDescriptor.compute.module == nullptr) { - localDescriptor.compute.module = localDescriptor.computeStage.module; - localDescriptor.compute.entryPoint = localDescriptor.computeStage.entryPoint; - } - - cmd.descriptor = &localDescriptor; - client->SerializeCommand(cmd); - - return ToAPI(allocation->object.get()); - } - void Device::CreateComputePipelineAsync(WGPUComputePipelineDescriptor const* descriptor, WGPUCreateComputePipelineAsyncCallback callback, void* userdata) { @@ -253,18 +225,6 @@ namespace dawn_wire { namespace client { "GPU device disconnected", userdata); } - // Copy compute to the deprecated computeStage or visa-versa, depending on which one is - // populated, so that serialization doesn't fail. - // TODO(dawn:800): Remove once computeStage is removed. - WGPUComputePipelineDescriptor localDescriptor = *descriptor; - if (localDescriptor.computeStage.module == nullptr) { - localDescriptor.computeStage.module = localDescriptor.compute.module; - localDescriptor.computeStage.entryPoint = localDescriptor.compute.entryPoint; - } else if (localDescriptor.compute.module == nullptr) { - localDescriptor.compute.module = localDescriptor.computeStage.module; - localDescriptor.compute.entryPoint = localDescriptor.computeStage.entryPoint; - } - auto* allocation = client->ComputePipelineAllocator().New(client); CreatePipelineAsyncRequest request = {}; @@ -276,7 +236,7 @@ namespace dawn_wire { namespace client { DeviceCreateComputePipelineAsyncCmd cmd; cmd.deviceId = this->id; - cmd.descriptor = &localDescriptor; + cmd.descriptor = descriptor; cmd.requestSerial = serial; cmd.pipelineObjectHandle = ObjectHandle{allocation->object->id, allocation->generation}; diff --git a/src/tests/end2end/DeprecatedAPITests.cpp b/src/tests/end2end/DeprecatedAPITests.cpp index 10597ae846..e604ce883e 100644 --- a/src/tests/end2end/DeprecatedAPITests.cpp +++ b/src/tests/end2end/DeprecatedAPITests.cpp @@ -34,18 +34,6 @@ class DeprecationTests : public DawnTest { } }; -// Test that setting computeStage in a ComputePipelineDescriptor is deprecated. -TEST_P(DeprecationTests, ComputeStage) { - wgpu::ComputePipelineDescriptor csDesc; - csDesc.computeStage.module = utils::CreateShaderModule(device, R"( - [[stage(compute), workgroup_size(1)]] fn main() { - })"); - csDesc.computeStage.entryPoint = "main"; - - wgpu::ComputePipeline pipeline; - EXPECT_DEPRECATION_WARNING(pipeline = device.CreateComputePipeline(&csDesc)); -} - // Test that StoreOp::Clear is deprecated. TEST_P(DeprecationTests, StoreOpClear) { utils::BasicRenderPass renderPass = utils::CreateBasicRenderPass(device, 1, 1);