Remove DawnDeviceDescriptor code paths

This was listed as deprecated and has been for a while (at least a
year.) No code paths in Dawn make use of it and the few remaining
uses in Chrome are being removed in
https://chromium-review.googlesource.com/c/chromium/src/+/4501347

Bug: dawn:1797
Change-Id: Ifff4e5609e228080361e5d3a20a881eaf811ab6c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/131321
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
Brandon Jones 2023-05-04 02:01:52 +00:00 committed by Dawn LUCI CQ
parent 8f9ea96c20
commit 45b44fdb9f
2 changed files with 0 additions and 67 deletions

View File

@ -36,19 +36,6 @@ namespace dawn::native {
class InstanceBase;
class AdapterBase;
// An optional parameter of Adapter::CreateDevice() to send additional information when creating
// a Device. For example, we can use it to enable a workaround, optimization or feature.
struct DAWN_NATIVE_EXPORT DawnDeviceDescriptor {
DawnDeviceDescriptor();
~DawnDeviceDescriptor();
std::vector<const char*> requiredFeatures;
std::vector<const char*> forceEnabledToggles;
std::vector<const char*> forceDisabledToggles;
const WGPURequiredLimits* requiredLimits = nullptr;
};
// Each toggle is assigned with a TogglesStage, indicating the validation and earliest usage
// time of the toggle.
enum class ToggleStage { Instance, Adapter, Device };
@ -110,13 +97,9 @@ class DAWN_NATIVE_EXPORT Adapter {
explicit operator bool() const;
// Create a device on this adapter. On an error, nullptr is returned.
WGPUDevice CreateDevice(const DawnDeviceDescriptor* deviceDescriptor);
WGPUDevice CreateDevice(const wgpu::DeviceDescriptor* deviceDescriptor);
WGPUDevice CreateDevice(const WGPUDeviceDescriptor* deviceDescriptor = nullptr);
void RequestDevice(const DawnDeviceDescriptor* descriptor,
WGPURequestDeviceCallback callback,
void* userdata);
void RequestDevice(const wgpu::DeviceDescriptor* descriptor,
WGPURequestDeviceCallback callback,
void* userdata);

View File

@ -29,38 +29,6 @@
namespace dawn::native {
namespace {
struct ComboDeprecatedDawnDeviceDescriptor : DeviceDescriptor {
explicit ComboDeprecatedDawnDeviceDescriptor(const DawnDeviceDescriptor* deviceDescriptor) {
dawn::WarningLog() << "DawnDeviceDescriptor is deprecated. Please use "
"WGPUDeviceDescriptor instead.";
DeviceDescriptor* desc = this;
if (deviceDescriptor != nullptr) {
desc->nextInChain = &mTogglesDesc;
mTogglesDesc.enabledToggles = deviceDescriptor->forceEnabledToggles.data();
mTogglesDesc.enabledTogglesCount = deviceDescriptor->forceEnabledToggles.size();
mTogglesDesc.disabledToggles = deviceDescriptor->forceDisabledToggles.data();
mTogglesDesc.disabledTogglesCount = deviceDescriptor->forceDisabledToggles.size();
desc->requiredLimits =
reinterpret_cast<const RequiredLimits*>(deviceDescriptor->requiredLimits);
FeaturesInfo featuresInfo;
for (const char* featureStr : deviceDescriptor->requiredFeatures) {
mRequiredFeatures.push_back(featuresInfo.FeatureNameToAPIEnum(featureStr));
}
desc->requiredFeatures = mRequiredFeatures.data();
desc->requiredFeaturesCount = mRequiredFeatures.size();
}
}
DawnTogglesDescriptor mTogglesDesc = {};
std::vector<wgpu::FeatureName> mRequiredFeatures = {};
};
} // namespace
const DawnProcTable& GetProcsAutogen();
const DawnProcTable& GetProcs() {
@ -71,12 +39,6 @@ std::vector<const char*> GetTogglesUsed(WGPUDevice device) {
return FromAPI(device)->GetTogglesUsed();
}
// DawnDeviceDescriptor
DawnDeviceDescriptor::DawnDeviceDescriptor() = default;
DawnDeviceDescriptor::~DawnDeviceDescriptor() = default;
// Adapter
Adapter::Adapter() = default;
@ -142,11 +104,6 @@ Adapter::operator bool() const {
return mImpl != nullptr;
}
WGPUDevice Adapter::CreateDevice(const DawnDeviceDescriptor* deviceDescriptor) {
ComboDeprecatedDawnDeviceDescriptor desc(deviceDescriptor);
return ToAPI(mImpl->APICreateDevice(&desc));
}
WGPUDevice Adapter::CreateDevice(const wgpu::DeviceDescriptor* deviceDescriptor) {
return CreateDevice(reinterpret_cast<const WGPUDeviceDescriptor*>(deviceDescriptor));
}
@ -155,13 +112,6 @@ WGPUDevice Adapter::CreateDevice(const WGPUDeviceDescriptor* deviceDescriptor) {
return ToAPI(mImpl->APICreateDevice(FromAPI(deviceDescriptor)));
}
void Adapter::RequestDevice(const DawnDeviceDescriptor* descriptor,
WGPURequestDeviceCallback callback,
void* userdata) {
ComboDeprecatedDawnDeviceDescriptor desc(descriptor);
mImpl->APIRequestDevice(&desc, callback, userdata);
}
void Adapter::RequestDevice(const wgpu::DeviceDescriptor* descriptor,
WGPURequestDeviceCallback callback,
void* userdata) {