Rename DeviceDescriptor -> DawnDeviceDescriptor

This is preventing supporting DeviceDescriptor from upstream
webgpu.h because the name conflicts with the existing struct.

A typedef using the original name DeviceDescriptor is added
until all embedders of Dawn are updated to use the new name.

Bug: dawn:160, dawn:689
Change-Id: Ib9cb7443b7e46e3ffe29d2ec109f2f1a831754e7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/70581
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This commit is contained in:
Austin Eng 2021-11-23 18:03:16 +00:00 committed by Dawn LUCI CQ
parent 7e851c91dd
commit 3482a80bdd
40 changed files with 87 additions and 70 deletions

View File

@ -135,7 +135,7 @@ namespace dawn_native {
return true;
}
DeviceBase* AdapterBase::CreateDevice(const DeviceDescriptor* descriptor) {
DeviceBase* AdapterBase::CreateDevice(const DawnDeviceDescriptor* descriptor) {
DeviceBase* result = nullptr;
if (mInstance->ConsumedError(CreateDeviceInternal(&result, descriptor))) {
@ -145,7 +145,7 @@ namespace dawn_native {
return result;
}
void AdapterBase::RequestDevice(const DeviceDescriptor* descriptor,
void AdapterBase::RequestDevice(const DawnDeviceDescriptor* descriptor,
WGPURequestDeviceCallback callback,
void* userdata) {
DeviceBase* result = nullptr;
@ -164,7 +164,7 @@ namespace dawn_native {
}
MaybeError AdapterBase::CreateDeviceInternal(DeviceBase** result,
const DeviceDescriptor* descriptor) {
const DawnDeviceDescriptor* descriptor) {
if (descriptor != nullptr) {
for (const char* featureStr : descriptor->requiredFeatures) {
Feature featureEnum = mInstance->FeatureNameToEnum(featureStr);

View File

@ -41,9 +41,9 @@ namespace dawn_native {
const PCIInfo& GetPCIInfo() const;
InstanceBase* GetInstance() const;
DeviceBase* CreateDevice(const DeviceDescriptor* descriptor = nullptr);
DeviceBase* CreateDevice(const DawnDeviceDescriptor* descriptor = nullptr);
void RequestDevice(const DeviceDescriptor* descriptor,
void RequestDevice(const DawnDeviceDescriptor* descriptor,
WGPURequestDeviceCallback callback,
void* userdata);
@ -66,7 +66,8 @@ namespace dawn_native {
FeaturesSet mSupportedFeatures;
private:
virtual ResultOrError<DeviceBase*> CreateDeviceImpl(const DeviceDescriptor* descriptor) = 0;
virtual ResultOrError<DeviceBase*> CreateDeviceImpl(
const DawnDeviceDescriptor* descriptor) = 0;
virtual MaybeError InitializeImpl() = 0;
@ -76,7 +77,8 @@ namespace dawn_native {
// Check base WebGPU limits and populate supported limits.
virtual MaybeError InitializeSupportedLimitsImpl(CombinedLimits* limits) = 0;
MaybeError CreateDeviceInternal(DeviceBase** result, const DeviceDescriptor* descriptor);
MaybeError CreateDeviceInternal(DeviceBase** result,
const DawnDeviceDescriptor* descriptor);
virtual MaybeError ResetInternalDeviceForTestingImpl();
InstanceBase* mInstance = nullptr;

View File

@ -125,11 +125,11 @@ namespace dawn_native {
return mImpl != nullptr;
}
WGPUDevice Adapter::CreateDevice(const DeviceDescriptor* deviceDescriptor) {
WGPUDevice Adapter::CreateDevice(const DawnDeviceDescriptor* deviceDescriptor) {
return reinterpret_cast<WGPUDevice>(mImpl->CreateDevice(deviceDescriptor));
}
void Adapter::RequestDevice(const DeviceDescriptor* descriptor,
void Adapter::RequestDevice(const DawnDeviceDescriptor* descriptor,
WGPURequestDeviceCallback callback,
void* userdata) {
mImpl->RequestDevice(descriptor, callback, userdata);

View File

@ -172,7 +172,7 @@ namespace dawn_native {
// DeviceBase
DeviceBase::DeviceBase(AdapterBase* adapter, const DeviceDescriptor* descriptor)
DeviceBase::DeviceBase(AdapterBase* adapter, const DawnDeviceDescriptor* descriptor)
: mInstance(adapter->GetInstance()), mAdapter(adapter), mNextPipelineCompatibilityToken(1) {
if (descriptor != nullptr) {
ApplyToggleOverrides(descriptor);
@ -1111,7 +1111,7 @@ namespace dawn_native {
return result.Detach();
}
void DeviceBase::ApplyFeatures(const DeviceDescriptor* deviceDescriptor) {
void DeviceBase::ApplyFeatures(const DawnDeviceDescriptor* deviceDescriptor) {
ASSERT(deviceDescriptor);
ASSERT(GetAdapter()->SupportsAllRequestedFeatures(deviceDescriptor->requiredFeatures));
@ -1565,7 +1565,7 @@ namespace dawn_native {
SetToggle(Toggle::DisallowUnsafeAPIs, true);
}
void DeviceBase::ApplyToggleOverrides(const DeviceDescriptor* deviceDescriptor) {
void DeviceBase::ApplyToggleOverrides(const DawnDeviceDescriptor* deviceDescriptor) {
ASSERT(deviceDescriptor);
for (const char* toggleName : deviceDescriptor->forceEnabledToggles) {

View File

@ -56,7 +56,7 @@ namespace dawn_native {
class DeviceBase : public RefCounted {
public:
DeviceBase(AdapterBase* adapter, const DeviceDescriptor* descriptor);
DeviceBase(AdapterBase* adapter, const DawnDeviceDescriptor* descriptor);
virtual ~DeviceBase();
void HandleError(InternalErrorType type, const char* message);
@ -437,8 +437,8 @@ namespace dawn_native {
WGPUCreateRenderPipelineAsyncCallback callback,
void* userdata);
void ApplyToggleOverrides(const DeviceDescriptor* deviceDescriptor);
void ApplyFeatures(const DeviceDescriptor* deviceDescriptor);
void ApplyToggleOverrides(const DawnDeviceDescriptor* deviceDescriptor);
void ApplyFeatures(const DawnDeviceDescriptor* deviceDescriptor);
void SetDefaultToggles();

View File

@ -394,7 +394,7 @@ namespace dawn_native { namespace d3d12 {
infoQueue->PopStorageFilter();
}
ResultOrError<DeviceBase*> Adapter::CreateDeviceImpl(const DeviceDescriptor* descriptor) {
ResultOrError<DeviceBase*> Adapter::CreateDeviceImpl(const DawnDeviceDescriptor* descriptor) {
return Device::Create(this, descriptor);
}

View File

@ -40,7 +40,8 @@ namespace dawn_native { namespace d3d12 {
const gpu_info::D3DDriverVersion& GetDriverVersion() const;
private:
ResultOrError<DeviceBase*> CreateDeviceImpl(const DeviceDescriptor* descriptor) override;
ResultOrError<DeviceBase*> CreateDeviceImpl(
const DawnDeviceDescriptor* descriptor) override;
MaybeError ResetInternalDeviceForTestingImpl() override;
bool AreTimestampQueriesSupported() const;

View File

@ -52,7 +52,8 @@ namespace dawn_native { namespace d3d12 {
static constexpr uint64_t kMaxDebugMessagesToPrint = 5;
// static
ResultOrError<Device*> Device::Create(Adapter* adapter, const DeviceDescriptor* descriptor) {
ResultOrError<Device*> Device::Create(Adapter* adapter,
const DawnDeviceDescriptor* descriptor) {
Ref<Device> device = AcquireRef(new Device(adapter, descriptor));
DAWN_TRY(device->Initialize());
return device.Detach();

View File

@ -41,7 +41,8 @@ namespace dawn_native { namespace d3d12 {
// Definition of backend types
class Device final : public DeviceBase {
public:
static ResultOrError<Device*> Create(Adapter* adapter, const DeviceDescriptor* descriptor);
static ResultOrError<Device*> Create(Adapter* adapter,
const DawnDeviceDescriptor* descriptor);
~Device() override;
MaybeError Initialize();

View File

@ -277,7 +277,8 @@ namespace dawn_native { namespace metal {
}
private:
ResultOrError<DeviceBase*> CreateDeviceImpl(const DeviceDescriptor* descriptor) override {
ResultOrError<DeviceBase*> CreateDeviceImpl(
const DawnDeviceDescriptor* descriptor) override {
return Device::Create(this, mDevice, descriptor);
}

View File

@ -40,7 +40,7 @@ namespace dawn_native { namespace metal {
public:
static ResultOrError<Device*> Create(AdapterBase* adapter,
NSPRef<id<MTLDevice>> mtlDevice,
const DeviceDescriptor* descriptor);
const DawnDeviceDescriptor* descriptor);
~Device() override;
MaybeError Initialize();
@ -77,7 +77,7 @@ namespace dawn_native { namespace metal {
private:
Device(AdapterBase* adapter,
NSPRef<id<MTLDevice>> mtlDevice,
const DeviceDescriptor* descriptor);
const DawnDeviceDescriptor* descriptor);
ResultOrError<Ref<BindGroupBase>> CreateBindGroupImpl(
const BindGroupDescriptor* descriptor) override;

View File

@ -108,7 +108,7 @@ namespace dawn_native { namespace metal {
// static
ResultOrError<Device*> Device::Create(AdapterBase* adapter,
NSPRef<id<MTLDevice>> mtlDevice,
const DeviceDescriptor* descriptor) {
const DawnDeviceDescriptor* descriptor) {
Ref<Device> device = AcquireRef(new Device(adapter, std::move(mtlDevice), descriptor));
DAWN_TRY(device->Initialize());
return device.Detach();
@ -116,7 +116,7 @@ namespace dawn_native { namespace metal {
Device::Device(AdapterBase* adapter,
NSPRef<id<MTLDevice>> mtlDevice,
const DeviceDescriptor* descriptor)
const DawnDeviceDescriptor* descriptor)
: DeviceBase(adapter, descriptor), mMtlDevice(std::move(mtlDevice)), mCompletedSerial(0) {
}

View File

@ -57,7 +57,7 @@ namespace dawn_native { namespace null {
return {};
}
ResultOrError<DeviceBase*> Adapter::CreateDeviceImpl(const DeviceDescriptor* descriptor) {
ResultOrError<DeviceBase*> Adapter::CreateDeviceImpl(const DawnDeviceDescriptor* descriptor) {
return Device::Create(this, descriptor);
}
@ -95,7 +95,8 @@ namespace dawn_native { namespace null {
// Device
// static
ResultOrError<Device*> Device::Create(Adapter* adapter, const DeviceDescriptor* descriptor) {
ResultOrError<Device*> Device::Create(Adapter* adapter,
const DawnDeviceDescriptor* descriptor) {
Ref<Device> device = AcquireRef(new Device(adapter, descriptor));
DAWN_TRY(device->Initialize());
return device.Detach();

View File

@ -86,7 +86,8 @@ namespace dawn_native { namespace null {
class Device final : public DeviceBase {
public:
static ResultOrError<Device*> Create(Adapter* adapter, const DeviceDescriptor* descriptor);
static ResultOrError<Device*> Create(Adapter* adapter,
const DawnDeviceDescriptor* descriptor);
~Device() override;
MaybeError Initialize();
@ -181,7 +182,8 @@ namespace dawn_native { namespace null {
MaybeError InitializeSupportedFeaturesImpl() override;
MaybeError InitializeSupportedLimitsImpl(CombinedLimits* limits) override;
ResultOrError<DeviceBase*> CreateDeviceImpl(const DeviceDescriptor* descriptor) override;
ResultOrError<DeviceBase*> CreateDeviceImpl(
const DawnDeviceDescriptor* descriptor) override;
};
// Helper class so |BindGroup| can allocate memory for its binding data,

View File

@ -254,7 +254,8 @@ namespace dawn_native { namespace opengl {
return {};
}
ResultOrError<DeviceBase*> CreateDeviceImpl(const DeviceDescriptor* descriptor) override {
ResultOrError<DeviceBase*> CreateDeviceImpl(
const DawnDeviceDescriptor* descriptor) override {
// There is no limit on the number of devices created from this adapter because they can
// all share the same backing OpenGL context.
return Device::Create(this, descriptor, mFunctions);

View File

@ -36,7 +36,7 @@ namespace dawn_native { namespace opengl {
// static
ResultOrError<Device*> Device::Create(AdapterBase* adapter,
const DeviceDescriptor* descriptor,
const DawnDeviceDescriptor* descriptor,
const OpenGLFunctions& functions) {
Ref<Device> device = AcquireRef(new Device(adapter, descriptor, functions));
DAWN_TRY(device->Initialize());
@ -44,7 +44,7 @@ namespace dawn_native { namespace opengl {
}
Device::Device(AdapterBase* adapter,
const DeviceDescriptor* descriptor,
const DawnDeviceDescriptor* descriptor,
const OpenGLFunctions& functions)
: DeviceBase(adapter, descriptor), gl(functions) {
}

View File

@ -38,7 +38,7 @@ namespace dawn_native { namespace opengl {
class Device final : public DeviceBase {
public:
static ResultOrError<Device*> Create(AdapterBase* adapter,
const DeviceDescriptor* descriptor,
const DawnDeviceDescriptor* descriptor,
const OpenGLFunctions& functions);
~Device() override;
@ -81,7 +81,7 @@ namespace dawn_native { namespace opengl {
private:
Device(AdapterBase* adapter,
const DeviceDescriptor* descriptor,
const DawnDeviceDescriptor* descriptor,
const OpenGLFunctions& functions);
ResultOrError<Ref<BindGroupBase>> CreateBindGroupImpl(

View File

@ -320,7 +320,7 @@ namespace dawn_native { namespace vulkan {
mBackend->GetFunctions());
}
ResultOrError<DeviceBase*> Adapter::CreateDeviceImpl(const DeviceDescriptor* descriptor) {
ResultOrError<DeviceBase*> Adapter::CreateDeviceImpl(const DawnDeviceDescriptor* descriptor) {
return Device::Create(this, descriptor);
}

View File

@ -41,7 +41,8 @@ namespace dawn_native { namespace vulkan {
MaybeError InitializeSupportedFeaturesImpl() override;
MaybeError InitializeSupportedLimitsImpl(CombinedLimits* limits) override;
ResultOrError<DeviceBase*> CreateDeviceImpl(const DeviceDescriptor* descriptor) override;
ResultOrError<DeviceBase*> CreateDeviceImpl(
const DawnDeviceDescriptor* descriptor) override;
VkPhysicalDevice mPhysicalDevice;
Backend* mBackend;

View File

@ -45,13 +45,14 @@
namespace dawn_native { namespace vulkan {
// static
ResultOrError<Device*> Device::Create(Adapter* adapter, const DeviceDescriptor* descriptor) {
ResultOrError<Device*> Device::Create(Adapter* adapter,
const DawnDeviceDescriptor* descriptor) {
Ref<Device> device = AcquireRef(new Device(adapter, descriptor));
DAWN_TRY(device->Initialize());
return device.Detach();
}
Device::Device(Adapter* adapter, const DeviceDescriptor* descriptor)
Device::Device(Adapter* adapter, const DawnDeviceDescriptor* descriptor)
: DeviceBase(adapter, descriptor) {
InitTogglesFromDriver();
}

View File

@ -42,7 +42,8 @@ namespace dawn_native { namespace vulkan {
class Device final : public DeviceBase {
public:
static ResultOrError<Device*> Create(Adapter* adapter, const DeviceDescriptor* descriptor);
static ResultOrError<Device*> Create(Adapter* adapter,
const DawnDeviceDescriptor* descriptor);
~Device() override;
MaybeError Initialize();
@ -104,7 +105,7 @@ namespace dawn_native { namespace vulkan {
float GetTimestampPeriodInNS() const override;
private:
Device(Adapter* adapter, const DeviceDescriptor* descriptor);
Device(Adapter* adapter, const DawnDeviceDescriptor* descriptor);
ResultOrError<Ref<BindGroupBase>> CreateBindGroupImpl(
const BindGroupDescriptor* descriptor) override;

View File

@ -168,7 +168,7 @@ namespace wgpu { namespace binding {
interop::Promise<interop::Interface<interop::GPUDevice>> GPUAdapter::requestDevice(
Napi::Env env,
interop::GPUDeviceDescriptor descriptor) {
dawn_native::DeviceDescriptor desc{}; // TODO(crbug.com/dawn/1133): Fill in.
dawn_native::DawnDeviceDescriptor desc{}; // TODO(crbug.com/dawn/1133): Fill in.
interop::Promise<interop::Interface<interop::GPUDevice>> promise(env, PROMISE_INFO);
// See src/dawn_native/Features.cpp for enum <-> string mappings.
@ -194,7 +194,7 @@ namespace wgpu { namespace binding {
}
// Propogate enabled/disabled dawn features
// Note: DeviceDescriptor::forceEnabledToggles and forceDisabledToggles are vectors of
// Note: DawnDeviceDescriptor::forceEnabledToggles and forceDisabledToggles are vectors of
// 'const char*', so we make sure the parsed strings survive the CreateDevice() call by
// storing them on the stack.
std::vector<std::string> enabledToggles;

View File

@ -62,7 +62,7 @@ namespace dawn_native {
// 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 DeviceDescriptor {
struct DAWN_NATIVE_EXPORT DawnDeviceDescriptor {
std::vector<const char*> requiredFeatures;
std::vector<const char*> forceEnabledToggles;
std::vector<const char*> forceDisabledToggles;
@ -70,6 +70,10 @@ namespace dawn_native {
const WGPURequiredLimits* requiredLimits = nullptr;
};
// TODO(crbug.com/dawn/160): Remove when embedders of Dawn are updated to use
// DawnDeviceDescriptor.
using DeviceDescriptor = DawnDeviceDescriptor;
// A struct to record the information of a toggle. A toggle is a code path in Dawn device that
// can be manually configured to run or not outside Dawn, including workarounds, special
// features and optimizations.
@ -124,9 +128,9 @@ namespace dawn_native {
// Create a device on this adapter, note that the interface will change to include at least
// a device descriptor and a pointer to backend specific options.
// On an error, nullptr is returned.
WGPUDevice CreateDevice(const DeviceDescriptor* deviceDescriptor = nullptr);
WGPUDevice CreateDevice(const DawnDeviceDescriptor* deviceDescriptor = nullptr);
void RequestDevice(const DeviceDescriptor* descriptor,
void RequestDevice(const DawnDeviceDescriptor* descriptor,
WGPURequestDeviceCallback callback,
void* userdata);

View File

@ -70,7 +70,7 @@ void DawnNativeTest::TearDown() {
WGPUDevice DawnNativeTest::CreateTestDevice() {
// Disabled disallowing unsafe APIs so we can test them.
dawn_native::DeviceDescriptor deviceDescriptor;
dawn_native::DawnDeviceDescriptor deviceDescriptor;
deviceDescriptor.forceDisabledToggles.push_back("disallow_unsafe_apis");
return adapter.CreateDevice(&deviceDescriptor);

View File

@ -922,7 +922,7 @@ void DawnTestBase::SetUp() {
for (const char* forceDisabledWorkaround : mParam.forceDisabledWorkarounds) {
ASSERT(gTestEnv->GetInstance()->GetToggleInfo(forceDisabledWorkaround) != nullptr);
}
dawn_native::DeviceDescriptor deviceDescriptor = {};
dawn_native::DawnDeviceDescriptor deviceDescriptor = {};
deviceDescriptor.forceEnabledToggles = mParam.forceEnabledWorkarounds;
deviceDescriptor.forceDisabledToggles = mParam.forceDisabledWorkarounds;
deviceDescriptor.requiredFeatures = GetRequiredFeatures();

View File

@ -61,7 +61,7 @@ TEST_F(DeviceInitializationTest, DeviceOutlivesInstance) {
properties.adapterType == desiredProperties.adapterType &&
properties.backendType == desiredProperties.backendType) {
// Create the device, destroy the instance, and break out of the loop.
dawn_native::DeviceDescriptor deviceDescriptor = {};
dawn_native::DawnDeviceDescriptor deviceDescriptor = {};
device = wgpu::Device::Acquire(adapter.CreateDevice(&deviceDescriptor));
instance.reset();
break;

View File

@ -55,7 +55,7 @@ TEST_F(FeatureTests, AdapterWithRequiredFeatureDisabled) {
mAdapterBase.SetSupportedFeatures(featureNamesWithoutOne);
dawn_native::Adapter adapterWithoutFeature(&mAdapterBase);
dawn_native::DeviceDescriptor deviceDescriptor;
dawn_native::DawnDeviceDescriptor deviceDescriptor;
const char* featureName = FeatureEnumToName(notSupportedFeature);
deviceDescriptor.requiredFeatures = std::vector<const char*>(1, featureName);
WGPUDevice deviceWithFeature = adapterWithoutFeature.CreateDevice(&deviceDescriptor);
@ -70,7 +70,7 @@ TEST_F(FeatureTests, GetEnabledFeatures) {
dawn_native::Feature feature = static_cast<dawn_native::Feature>(i);
const char* featureName = FeatureEnumToName(feature);
dawn_native::DeviceDescriptor deviceDescriptor;
dawn_native::DawnDeviceDescriptor deviceDescriptor;
deviceDescriptor.requiredFeatures = {featureName};
dawn_native::DeviceBase* deviceBase =
reinterpret_cast<dawn_native::DeviceBase*>(adapter.CreateDevice(&deviceDescriptor));

View File

@ -2046,7 +2046,7 @@ TEST_F(CopyCommandTest_T2T, CopyWithinSameTexture) {
class CopyCommandTest_CompressedTextureFormats : public CopyCommandTest {
protected:
WGPUDevice CreateTestDevice() override {
dawn_native::DeviceDescriptor descriptor;
dawn_native::DawnDeviceDescriptor descriptor;
descriptor.requiredFeatures = {"texture-compression-bc", "texture-compression-etc2",
"texture-compression-astc"};
return adapter.CreateDevice(&descriptor);

View File

@ -44,7 +44,7 @@ TEST_F(TextureInternalUsageValidationDisabledTest, RequiresFeature) {
class TextureInternalUsageValidationTest : public ValidationTest {
WGPUDevice CreateTestDevice() override {
dawn_native::DeviceDescriptor descriptor;
dawn_native::DawnDeviceDescriptor descriptor;
descriptor.requiredFeatures.push_back("dawn-internal-usages");
return adapter.CreateDevice(&descriptor);

View File

@ -225,7 +225,7 @@ TEST_F(OcclusionQueryValidationTest, InvalidBeginAndEnd) {
class TimestampQueryValidationTest : public QuerySetValidationTest {
protected:
WGPUDevice CreateTestDevice() override {
dawn_native::DeviceDescriptor descriptor;
dawn_native::DawnDeviceDescriptor descriptor;
descriptor.requiredFeatures.push_back("timestamp-query");
descriptor.forceDisabledToggles.push_back("disallow_unsafe_apis");
return adapter.CreateDevice(&descriptor);
@ -429,7 +429,7 @@ TEST_F(TimestampQueryValidationTest, WriteTimestampOnRenderPassEncoder) {
class PipelineStatisticsQueryValidationTest : public QuerySetValidationTest {
protected:
WGPUDevice CreateTestDevice() override {
dawn_native::DeviceDescriptor descriptor;
dawn_native::DawnDeviceDescriptor descriptor;
descriptor.requiredFeatures.push_back("pipeline-statistics-query");
// TODO(crbug.com/1177506): Pipeline statistic query is an unsafe API, disable disallowing
// unsafe APIs to test it.

View File

@ -557,7 +557,7 @@ namespace {
class WriteTextureTest_CompressedTextureFormats : public QueueWriteTextureValidationTest {
protected:
WGPUDevice CreateTestDevice() override {
dawn_native::DeviceDescriptor descriptor;
dawn_native::DawnDeviceDescriptor descriptor;
descriptor.requiredFeatures = {"texture-compression-bc", "texture-compression-etc2",
"texture-compression-astc"};
return adapter.CreateDevice(&descriptor);

View File

@ -1124,7 +1124,7 @@ TEST_F(RenderPipelineValidationTest, BindingsFromCorrectEntryPoint) {
class DepthClampingValidationTest : public RenderPipelineValidationTest {
protected:
WGPUDevice CreateTestDevice() override {
dawn_native::DeviceDescriptor descriptor;
dawn_native::DawnDeviceDescriptor descriptor;
descriptor.requiredFeatures = {"depth-clamping"};
return adapter.CreateDevice(&descriptor);
}

View File

@ -58,7 +58,7 @@ class RequestDeviceValidationTest : public ValidationTest {
// Test that requesting a device without specifying limits is valid.
TEST_F(RequestDeviceValidationTest, NoRequiredLimits) {
dawn_native::DeviceDescriptor descriptor;
dawn_native::DawnDeviceDescriptor descriptor;
adapter.RequestDevice(&descriptor, ExpectRequestDeviceSuccess,
CheckDevice([](wgpu::Device device) {
// Check one of the default limits.
@ -71,7 +71,7 @@ TEST_F(RequestDeviceValidationTest, NoRequiredLimits) {
// Test that requesting a device with the default limits is valid.
TEST_F(RequestDeviceValidationTest, DefaultLimits) {
wgpu::RequiredLimits limits = {};
dawn_native::DeviceDescriptor descriptor;
dawn_native::DawnDeviceDescriptor descriptor;
descriptor.requiredLimits = reinterpret_cast<const WGPURequiredLimits*>(&limits);
adapter.RequestDevice(&descriptor, ExpectRequestDeviceSuccess,
CheckDevice([](wgpu::Device device) {
@ -85,7 +85,7 @@ TEST_F(RequestDeviceValidationTest, DefaultLimits) {
// Test that requesting a device where a required limit is above the maximum value.
TEST_F(RequestDeviceValidationTest, HigherIsBetter) {
wgpu::RequiredLimits limits = {};
dawn_native::DeviceDescriptor descriptor;
dawn_native::DawnDeviceDescriptor descriptor;
descriptor.requiredLimits = reinterpret_cast<const WGPURequiredLimits*>(&limits);
wgpu::SupportedLimits supportedLimits;
@ -138,7 +138,7 @@ TEST_F(RequestDeviceValidationTest, HigherIsBetter) {
// Test that requesting a device where a required limit is below the minimum value.
TEST_F(RequestDeviceValidationTest, LowerIsBetter) {
wgpu::RequiredLimits limits = {};
dawn_native::DeviceDescriptor descriptor;
dawn_native::DawnDeviceDescriptor descriptor;
descriptor.requiredLimits = reinterpret_cast<const WGPURequiredLimits*>(&limits);
wgpu::SupportedLimits supportedLimits;
@ -199,7 +199,7 @@ TEST_F(RequestDeviceValidationTest, InvalidChainedStruct) {
wgpu::RequiredLimits limits = {};
limits.nextInChain = &depthClamp;
dawn_native::DeviceDescriptor descriptor;
dawn_native::DawnDeviceDescriptor descriptor;
descriptor.requiredLimits = reinterpret_cast<const WGPURequiredLimits*>(&limits);
adapter.RequestDevice(&descriptor, ExpectRequestDeviceError, nullptr);
}

View File

@ -586,7 +586,7 @@ namespace {
class CompressedTextureFormatsValidationTests : public TextureValidationTest {
protected:
WGPUDevice CreateTestDevice() override {
dawn_native::DeviceDescriptor descriptor;
dawn_native::DawnDeviceDescriptor descriptor;
descriptor.requiredFeatures = {"texture-compression-bc", "texture-compression-etc2",
"texture-compression-astc"};
return adapter.CreateDevice(&descriptor);

View File

@ -43,7 +43,7 @@ namespace {
// Create device with a valid name of a toggle
{
const char* kValidToggleName = "emulate_store_and_msaa_resolve";
dawn_native::DeviceDescriptor descriptor;
dawn_native::DawnDeviceDescriptor descriptor;
descriptor.forceEnabledToggles.push_back(kValidToggleName);
WGPUDevice deviceWithToggle = adapter.CreateDevice(&descriptor);
@ -60,7 +60,7 @@ namespace {
// Create device with an invalid toggle name
{
const char* kInvalidToggleName = "!@#$%^&*";
dawn_native::DeviceDescriptor descriptor;
dawn_native::DawnDeviceDescriptor descriptor;
descriptor.forceEnabledToggles.push_back(kInvalidToggleName);
WGPUDevice deviceWithToggle = adapter.CreateDevice(&descriptor);
@ -77,7 +77,7 @@ namespace {
TEST_F(ToggleValidationTest, TurnOffVsyncWithToggle) {
const char* kValidToggleName = "turn_off_vsync";
dawn_native::DeviceDescriptor descriptor;
dawn_native::DawnDeviceDescriptor descriptor;
descriptor.forceEnabledToggles.push_back(kValidToggleName);
WGPUDevice deviceWithToggle = adapter.CreateDevice(&descriptor);

View File

@ -22,7 +22,7 @@
class UnsafeAPIValidationTest : public ValidationTest {
protected:
WGPUDevice CreateTestDevice() override {
dawn_native::DeviceDescriptor descriptor;
dawn_native::DawnDeviceDescriptor descriptor;
descriptor.forceEnabledToggles.push_back("disallow_unsafe_apis");
return adapter.CreateDevice(&descriptor);
}
@ -109,7 +109,7 @@ TEST_F(UnsafeAPIValidationTest, PipelineOverridableConstants) {
class UnsafeQueryAPIValidationTest : public ValidationTest {
protected:
WGPUDevice CreateTestDevice() override {
dawn_native::DeviceDescriptor descriptor;
dawn_native::DawnDeviceDescriptor descriptor;
descriptor.requiredFeatures.push_back("pipeline-statistics-query");
descriptor.requiredFeatures.push_back("timestamp-query");
descriptor.forceEnabledToggles.push_back("disallow_unsafe_apis");

View File

@ -195,7 +195,7 @@ wgpu::SupportedLimits ValidationTest::GetSupportedLimits() {
WGPUDevice ValidationTest::CreateTestDevice() {
// Disabled disallowing unsafe APIs so we can test them.
dawn_native::DeviceDescriptor deviceDescriptor;
dawn_native::DawnDeviceDescriptor deviceDescriptor;
deviceDescriptor.forceDisabledToggles.push_back("disallow_unsafe_apis");
for (const std::string& toggle : gToggleParser->GetEnabledToggles()) {

View File

@ -21,7 +21,7 @@ namespace {
class VideoViewsValidation : public ValidationTest {
protected:
WGPUDevice CreateTestDevice() override {
dawn_native::DeviceDescriptor descriptor;
dawn_native::DawnDeviceDescriptor descriptor;
descriptor.requiredFeatures = {"multiplanar-formats"};
return adapter.CreateDevice(&descriptor);
}

View File

@ -318,7 +318,7 @@ namespace dawn_native { namespace vulkan {
protected:
dawn_native::vulkan::Adapter* backendAdapter;
dawn_native::DeviceDescriptor deviceDescriptor;
dawn_native::DawnDeviceDescriptor deviceDescriptor;
wgpu::Device secondDevice;
dawn_native::vulkan::Device* secondDeviceVk;

View File

@ -419,7 +419,7 @@ namespace dawn_native { namespace vulkan {
dawn_native::vulkan::Device* secondDeviceVk;
dawn_native::vulkan::Adapter* backendAdapter;
dawn_native::DeviceDescriptor deviceDescriptor;
dawn_native::DawnDeviceDescriptor deviceDescriptor;
wgpu::TextureDescriptor defaultDescriptor;
VkImage defaultImage;