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:
parent
1ac4565115
commit
c7203ba890
|
@ -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": {
|
||||
|
|
|
@ -165,7 +165,6 @@
|
|||
"client_handwritten_commands": [
|
||||
"BufferDestroy",
|
||||
"BufferUnmap",
|
||||
"DeviceCreateComputePipeline",
|
||||
"DeviceCreateErrorBuffer",
|
||||
"DeviceGetQueue",
|
||||
"DeviceInjectError",
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -130,12 +130,6 @@ namespace dawn_native {
|
|||
ComputePipelineDescriptor* outDescriptor) {
|
||||
Ref<PipelineLayoutBase> 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(
|
||||
|
|
|
@ -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};
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue