Remove deprecated ComputePipelineDescriptor.computeStage

Bug: dawn:800
Change-Id: I8d9d2a7cdba328d1cf040f7c8c622d1d7d403be2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63741
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
Corentin Wallez 2021-09-14 11:42:27 +00:00 committed by Dawn LUCI CQ
parent 1ac4565115
commit c7203ba890
6 changed files with 5 additions and 76 deletions

View File

@ -627,8 +627,7 @@
"members": [ "members": [
{"name": "label", "type": "char", "annotation": "const*", "length": "strlen", "optional": true}, {"name": "label", "type": "char", "annotation": "const*", "length": "strlen", "optional": true},
{"name": "layout", "type": "pipeline layout", "optional": true}, {"name": "layout", "type": "pipeline layout", "optional": true},
{"name": "compute", "type": "programmable stage descriptor"}, {"name": "compute", "type": "programmable stage descriptor"}
{"name": "compute stage", "type": "programmable stage descriptor"}
] ]
}, },
"alpha op": { "alpha op": {

View File

@ -165,7 +165,6 @@
"client_handwritten_commands": [ "client_handwritten_commands": [
"BufferDestroy", "BufferDestroy",
"BufferUnmap", "BufferUnmap",
"DeviceCreateComputePipeline",
"DeviceCreateErrorBuffer", "DeviceCreateErrorBuffer",
"DeviceGetQueue", "DeviceGetQueue",
"DeviceInjectError", "DeviceInjectError",

View File

@ -29,20 +29,9 @@ namespace dawn_native {
DAWN_TRY(device->ValidateObject(descriptor->layout)); DAWN_TRY(device->ValidateObject(descriptor->layout));
} }
if (descriptor->compute.module != nullptr) { return ValidateProgrammableStage(device, descriptor->compute.module,
DAWN_TRY(ValidateProgrammableStage(device, descriptor->compute.module,
descriptor->compute.entryPoint, descriptor->layout, descriptor->compute.entryPoint, descriptor->layout,
SingleShaderStage::Compute)); 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 {};
} }
// ComputePipelineBase // ComputePipelineBase

View File

@ -130,12 +130,6 @@ namespace dawn_native {
ComputePipelineDescriptor* outDescriptor) { ComputePipelineDescriptor* outDescriptor) {
Ref<PipelineLayoutBase> layoutRef; Ref<PipelineLayoutBase> layoutRef;
*outDescriptor = descriptor; *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) { if (outDescriptor->layout == nullptr) {
DAWN_TRY_ASSIGN(layoutRef, PipelineLayoutBase::CreateDefault( DAWN_TRY_ASSIGN(layoutRef, PipelineLayoutBase::CreateDefault(

View File

@ -217,34 +217,6 @@ namespace dawn_wire { namespace client {
return ToAPI(mQueue); 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, void Device::CreateComputePipelineAsync(WGPUComputePipelineDescriptor const* descriptor,
WGPUCreateComputePipelineAsyncCallback callback, WGPUCreateComputePipelineAsyncCallback callback,
void* userdata) { void* userdata) {
@ -253,18 +225,6 @@ namespace dawn_wire { namespace client {
"GPU device disconnected", userdata); "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); auto* allocation = client->ComputePipelineAllocator().New(client);
CreatePipelineAsyncRequest request = {}; CreatePipelineAsyncRequest request = {};
@ -276,7 +236,7 @@ namespace dawn_wire { namespace client {
DeviceCreateComputePipelineAsyncCmd cmd; DeviceCreateComputePipelineAsyncCmd cmd;
cmd.deviceId = this->id; cmd.deviceId = this->id;
cmd.descriptor = &localDescriptor; cmd.descriptor = descriptor;
cmd.requestSerial = serial; cmd.requestSerial = serial;
cmd.pipelineObjectHandle = ObjectHandle{allocation->object->id, allocation->generation}; cmd.pipelineObjectHandle = ObjectHandle{allocation->object->id, allocation->generation};

View File

@ -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 that StoreOp::Clear is deprecated.
TEST_P(DeprecationTests, StoreOpClear) { TEST_P(DeprecationTests, StoreOpClear) {
utils::BasicRenderPass renderPass = utils::CreateBasicRenderPass(device, 1, 1); utils::BasicRenderPass renderPass = utils::CreateBasicRenderPass(device, 1, 1);