diff --git a/src/dawn_native/Adapter.cpp b/src/dawn_native/Adapter.cpp index a0ee2c7a1e..f57e44bc2f 100644 --- a/src/dawn_native/Adapter.cpp +++ b/src/dawn_native/Adapter.cpp @@ -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); diff --git a/src/dawn_native/Adapter.h b/src/dawn_native/Adapter.h index d2bd13962b..1b9286e873 100644 --- a/src/dawn_native/Adapter.h +++ b/src/dawn_native/Adapter.h @@ -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 CreateDeviceImpl(const DeviceDescriptor* descriptor) = 0; + virtual ResultOrError 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; diff --git a/src/dawn_native/DawnNative.cpp b/src/dawn_native/DawnNative.cpp index db2d649d60..80dfc72f69 100644 --- a/src/dawn_native/DawnNative.cpp +++ b/src/dawn_native/DawnNative.cpp @@ -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(mImpl->CreateDevice(deviceDescriptor)); } - void Adapter::RequestDevice(const DeviceDescriptor* descriptor, + void Adapter::RequestDevice(const DawnDeviceDescriptor* descriptor, WGPURequestDeviceCallback callback, void* userdata) { mImpl->RequestDevice(descriptor, callback, userdata); diff --git a/src/dawn_native/Device.cpp b/src/dawn_native/Device.cpp index 259a00de21..d53b22e052 100644 --- a/src/dawn_native/Device.cpp +++ b/src/dawn_native/Device.cpp @@ -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) { diff --git a/src/dawn_native/Device.h b/src/dawn_native/Device.h index fd56a87061..f70f22dff9 100644 --- a/src/dawn_native/Device.h +++ b/src/dawn_native/Device.h @@ -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(); diff --git a/src/dawn_native/d3d12/AdapterD3D12.cpp b/src/dawn_native/d3d12/AdapterD3D12.cpp index d1baba3a3a..72ffad9a97 100644 --- a/src/dawn_native/d3d12/AdapterD3D12.cpp +++ b/src/dawn_native/d3d12/AdapterD3D12.cpp @@ -394,7 +394,7 @@ namespace dawn_native { namespace d3d12 { infoQueue->PopStorageFilter(); } - ResultOrError Adapter::CreateDeviceImpl(const DeviceDescriptor* descriptor) { + ResultOrError Adapter::CreateDeviceImpl(const DawnDeviceDescriptor* descriptor) { return Device::Create(this, descriptor); } diff --git a/src/dawn_native/d3d12/AdapterD3D12.h b/src/dawn_native/d3d12/AdapterD3D12.h index f4044d155b..4f404479dc 100644 --- a/src/dawn_native/d3d12/AdapterD3D12.h +++ b/src/dawn_native/d3d12/AdapterD3D12.h @@ -40,7 +40,8 @@ namespace dawn_native { namespace d3d12 { const gpu_info::D3DDriverVersion& GetDriverVersion() const; private: - ResultOrError CreateDeviceImpl(const DeviceDescriptor* descriptor) override; + ResultOrError CreateDeviceImpl( + const DawnDeviceDescriptor* descriptor) override; MaybeError ResetInternalDeviceForTestingImpl() override; bool AreTimestampQueriesSupported() const; diff --git a/src/dawn_native/d3d12/DeviceD3D12.cpp b/src/dawn_native/d3d12/DeviceD3D12.cpp index 027ead1fd1..8eb4a8780d 100644 --- a/src/dawn_native/d3d12/DeviceD3D12.cpp +++ b/src/dawn_native/d3d12/DeviceD3D12.cpp @@ -52,7 +52,8 @@ namespace dawn_native { namespace d3d12 { static constexpr uint64_t kMaxDebugMessagesToPrint = 5; // static - ResultOrError Device::Create(Adapter* adapter, const DeviceDescriptor* descriptor) { + ResultOrError Device::Create(Adapter* adapter, + const DawnDeviceDescriptor* descriptor) { Ref device = AcquireRef(new Device(adapter, descriptor)); DAWN_TRY(device->Initialize()); return device.Detach(); diff --git a/src/dawn_native/d3d12/DeviceD3D12.h b/src/dawn_native/d3d12/DeviceD3D12.h index a1c48c1afa..42810e3385 100644 --- a/src/dawn_native/d3d12/DeviceD3D12.h +++ b/src/dawn_native/d3d12/DeviceD3D12.h @@ -41,7 +41,8 @@ namespace dawn_native { namespace d3d12 { // Definition of backend types class Device final : public DeviceBase { public: - static ResultOrError Create(Adapter* adapter, const DeviceDescriptor* descriptor); + static ResultOrError Create(Adapter* adapter, + const DawnDeviceDescriptor* descriptor); ~Device() override; MaybeError Initialize(); diff --git a/src/dawn_native/metal/BackendMTL.mm b/src/dawn_native/metal/BackendMTL.mm index 9475020e70..e931af351d 100644 --- a/src/dawn_native/metal/BackendMTL.mm +++ b/src/dawn_native/metal/BackendMTL.mm @@ -277,7 +277,8 @@ namespace dawn_native { namespace metal { } private: - ResultOrError CreateDeviceImpl(const DeviceDescriptor* descriptor) override { + ResultOrError CreateDeviceImpl( + const DawnDeviceDescriptor* descriptor) override { return Device::Create(this, mDevice, descriptor); } diff --git a/src/dawn_native/metal/DeviceMTL.h b/src/dawn_native/metal/DeviceMTL.h index d7d09a2301..6f5153bc87 100644 --- a/src/dawn_native/metal/DeviceMTL.h +++ b/src/dawn_native/metal/DeviceMTL.h @@ -40,7 +40,7 @@ namespace dawn_native { namespace metal { public: static ResultOrError Create(AdapterBase* adapter, NSPRef> 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> mtlDevice, - const DeviceDescriptor* descriptor); + const DawnDeviceDescriptor* descriptor); ResultOrError> CreateBindGroupImpl( const BindGroupDescriptor* descriptor) override; diff --git a/src/dawn_native/metal/DeviceMTL.mm b/src/dawn_native/metal/DeviceMTL.mm index 10445e5b1d..db93279bac 100644 --- a/src/dawn_native/metal/DeviceMTL.mm +++ b/src/dawn_native/metal/DeviceMTL.mm @@ -108,7 +108,7 @@ namespace dawn_native { namespace metal { // static ResultOrError Device::Create(AdapterBase* adapter, NSPRef> mtlDevice, - const DeviceDescriptor* descriptor) { + const DawnDeviceDescriptor* descriptor) { Ref 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> mtlDevice, - const DeviceDescriptor* descriptor) + const DawnDeviceDescriptor* descriptor) : DeviceBase(adapter, descriptor), mMtlDevice(std::move(mtlDevice)), mCompletedSerial(0) { } diff --git a/src/dawn_native/null/DeviceNull.cpp b/src/dawn_native/null/DeviceNull.cpp index 1abeec4815..0250e4df38 100644 --- a/src/dawn_native/null/DeviceNull.cpp +++ b/src/dawn_native/null/DeviceNull.cpp @@ -57,7 +57,7 @@ namespace dawn_native { namespace null { return {}; } - ResultOrError Adapter::CreateDeviceImpl(const DeviceDescriptor* descriptor) { + ResultOrError Adapter::CreateDeviceImpl(const DawnDeviceDescriptor* descriptor) { return Device::Create(this, descriptor); } @@ -95,7 +95,8 @@ namespace dawn_native { namespace null { // Device // static - ResultOrError Device::Create(Adapter* adapter, const DeviceDescriptor* descriptor) { + ResultOrError Device::Create(Adapter* adapter, + const DawnDeviceDescriptor* descriptor) { Ref device = AcquireRef(new Device(adapter, descriptor)); DAWN_TRY(device->Initialize()); return device.Detach(); diff --git a/src/dawn_native/null/DeviceNull.h b/src/dawn_native/null/DeviceNull.h index 35e42cbde5..c7b6848050 100644 --- a/src/dawn_native/null/DeviceNull.h +++ b/src/dawn_native/null/DeviceNull.h @@ -86,7 +86,8 @@ namespace dawn_native { namespace null { class Device final : public DeviceBase { public: - static ResultOrError Create(Adapter* adapter, const DeviceDescriptor* descriptor); + static ResultOrError 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 CreateDeviceImpl(const DeviceDescriptor* descriptor) override; + ResultOrError CreateDeviceImpl( + const DawnDeviceDescriptor* descriptor) override; }; // Helper class so |BindGroup| can allocate memory for its binding data, diff --git a/src/dawn_native/opengl/BackendGL.cpp b/src/dawn_native/opengl/BackendGL.cpp index 1907162e82..3c57200b59 100644 --- a/src/dawn_native/opengl/BackendGL.cpp +++ b/src/dawn_native/opengl/BackendGL.cpp @@ -254,7 +254,8 @@ namespace dawn_native { namespace opengl { return {}; } - ResultOrError CreateDeviceImpl(const DeviceDescriptor* descriptor) override { + ResultOrError 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); diff --git a/src/dawn_native/opengl/DeviceGL.cpp b/src/dawn_native/opengl/DeviceGL.cpp index db5e06e55a..a098dfb901 100644 --- a/src/dawn_native/opengl/DeviceGL.cpp +++ b/src/dawn_native/opengl/DeviceGL.cpp @@ -36,7 +36,7 @@ namespace dawn_native { namespace opengl { // static ResultOrError Device::Create(AdapterBase* adapter, - const DeviceDescriptor* descriptor, + const DawnDeviceDescriptor* descriptor, const OpenGLFunctions& functions) { Ref 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) { } diff --git a/src/dawn_native/opengl/DeviceGL.h b/src/dawn_native/opengl/DeviceGL.h index b67f748362..f1317069b1 100644 --- a/src/dawn_native/opengl/DeviceGL.h +++ b/src/dawn_native/opengl/DeviceGL.h @@ -38,7 +38,7 @@ namespace dawn_native { namespace opengl { class Device final : public DeviceBase { public: static ResultOrError 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> CreateBindGroupImpl( diff --git a/src/dawn_native/vulkan/AdapterVk.cpp b/src/dawn_native/vulkan/AdapterVk.cpp index bf2aa02693..10ae4f2a7d 100644 --- a/src/dawn_native/vulkan/AdapterVk.cpp +++ b/src/dawn_native/vulkan/AdapterVk.cpp @@ -320,7 +320,7 @@ namespace dawn_native { namespace vulkan { mBackend->GetFunctions()); } - ResultOrError Adapter::CreateDeviceImpl(const DeviceDescriptor* descriptor) { + ResultOrError Adapter::CreateDeviceImpl(const DawnDeviceDescriptor* descriptor) { return Device::Create(this, descriptor); } diff --git a/src/dawn_native/vulkan/AdapterVk.h b/src/dawn_native/vulkan/AdapterVk.h index 9d98d2c6e1..548370ad6a 100644 --- a/src/dawn_native/vulkan/AdapterVk.h +++ b/src/dawn_native/vulkan/AdapterVk.h @@ -41,7 +41,8 @@ namespace dawn_native { namespace vulkan { MaybeError InitializeSupportedFeaturesImpl() override; MaybeError InitializeSupportedLimitsImpl(CombinedLimits* limits) override; - ResultOrError CreateDeviceImpl(const DeviceDescriptor* descriptor) override; + ResultOrError CreateDeviceImpl( + const DawnDeviceDescriptor* descriptor) override; VkPhysicalDevice mPhysicalDevice; Backend* mBackend; diff --git a/src/dawn_native/vulkan/DeviceVk.cpp b/src/dawn_native/vulkan/DeviceVk.cpp index 48a8b19205..d5db95df5e 100644 --- a/src/dawn_native/vulkan/DeviceVk.cpp +++ b/src/dawn_native/vulkan/DeviceVk.cpp @@ -45,13 +45,14 @@ namespace dawn_native { namespace vulkan { // static - ResultOrError Device::Create(Adapter* adapter, const DeviceDescriptor* descriptor) { + ResultOrError Device::Create(Adapter* adapter, + const DawnDeviceDescriptor* descriptor) { Ref 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(); } diff --git a/src/dawn_native/vulkan/DeviceVk.h b/src/dawn_native/vulkan/DeviceVk.h index f77e0b4591..befa89c562 100644 --- a/src/dawn_native/vulkan/DeviceVk.h +++ b/src/dawn_native/vulkan/DeviceVk.h @@ -42,7 +42,8 @@ namespace dawn_native { namespace vulkan { class Device final : public DeviceBase { public: - static ResultOrError Create(Adapter* adapter, const DeviceDescriptor* descriptor); + static ResultOrError 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> CreateBindGroupImpl( const BindGroupDescriptor* descriptor) override; diff --git a/src/dawn_node/binding/GPUAdapter.cpp b/src/dawn_node/binding/GPUAdapter.cpp index 9ddca1ea16..c9a6edb42e 100644 --- a/src/dawn_node/binding/GPUAdapter.cpp +++ b/src/dawn_node/binding/GPUAdapter.cpp @@ -168,7 +168,7 @@ namespace wgpu { namespace binding { interop::Promise> 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> 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 enabledToggles; diff --git a/src/include/dawn_native/DawnNative.h b/src/include/dawn_native/DawnNative.h index 4f0e8f78c1..9382141d03 100644 --- a/src/include/dawn_native/DawnNative.h +++ b/src/include/dawn_native/DawnNative.h @@ -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 requiredFeatures; std::vector forceEnabledToggles; std::vector 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); diff --git a/src/tests/DawnNativeTest.cpp b/src/tests/DawnNativeTest.cpp index 28d69bfa31..0e4705348d 100644 --- a/src/tests/DawnNativeTest.cpp +++ b/src/tests/DawnNativeTest.cpp @@ -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); diff --git a/src/tests/DawnTest.cpp b/src/tests/DawnTest.cpp index 4b7a62ee64..8e8a90bd05 100644 --- a/src/tests/DawnTest.cpp +++ b/src/tests/DawnTest.cpp @@ -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(); diff --git a/src/tests/end2end/DeviceInitializationTests.cpp b/src/tests/end2end/DeviceInitializationTests.cpp index 31948e6a1b..e379300bfa 100644 --- a/src/tests/end2end/DeviceInitializationTests.cpp +++ b/src/tests/end2end/DeviceInitializationTests.cpp @@ -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; diff --git a/src/tests/unittests/FeatureTests.cpp b/src/tests/unittests/FeatureTests.cpp index db67982bee..144b0e1f1b 100644 --- a/src/tests/unittests/FeatureTests.cpp +++ b/src/tests/unittests/FeatureTests.cpp @@ -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(1, featureName); WGPUDevice deviceWithFeature = adapterWithoutFeature.CreateDevice(&deviceDescriptor); @@ -70,7 +70,7 @@ TEST_F(FeatureTests, GetEnabledFeatures) { dawn_native::Feature feature = static_cast(i); const char* featureName = FeatureEnumToName(feature); - dawn_native::DeviceDescriptor deviceDescriptor; + dawn_native::DawnDeviceDescriptor deviceDescriptor; deviceDescriptor.requiredFeatures = {featureName}; dawn_native::DeviceBase* deviceBase = reinterpret_cast(adapter.CreateDevice(&deviceDescriptor)); diff --git a/src/tests/unittests/validation/CopyCommandsValidationTests.cpp b/src/tests/unittests/validation/CopyCommandsValidationTests.cpp index a086e1410a..7954fdc517 100644 --- a/src/tests/unittests/validation/CopyCommandsValidationTests.cpp +++ b/src/tests/unittests/validation/CopyCommandsValidationTests.cpp @@ -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); diff --git a/src/tests/unittests/validation/InternalUsageValidationTests.cpp b/src/tests/unittests/validation/InternalUsageValidationTests.cpp index 4c04e53034..33f5323c2b 100644 --- a/src/tests/unittests/validation/InternalUsageValidationTests.cpp +++ b/src/tests/unittests/validation/InternalUsageValidationTests.cpp @@ -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); diff --git a/src/tests/unittests/validation/QueryValidationTests.cpp b/src/tests/unittests/validation/QueryValidationTests.cpp index 7f2d0c2227..49d0fb6dff 100644 --- a/src/tests/unittests/validation/QueryValidationTests.cpp +++ b/src/tests/unittests/validation/QueryValidationTests.cpp @@ -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. diff --git a/src/tests/unittests/validation/QueueWriteTextureValidationTests.cpp b/src/tests/unittests/validation/QueueWriteTextureValidationTests.cpp index cbe8bb85af..863e80ec40 100644 --- a/src/tests/unittests/validation/QueueWriteTextureValidationTests.cpp +++ b/src/tests/unittests/validation/QueueWriteTextureValidationTests.cpp @@ -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); diff --git a/src/tests/unittests/validation/RenderPipelineValidationTests.cpp b/src/tests/unittests/validation/RenderPipelineValidationTests.cpp index fc2046bb77..2af96d2599 100644 --- a/src/tests/unittests/validation/RenderPipelineValidationTests.cpp +++ b/src/tests/unittests/validation/RenderPipelineValidationTests.cpp @@ -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); } diff --git a/src/tests/unittests/validation/RequestDeviceValidationTests.cpp b/src/tests/unittests/validation/RequestDeviceValidationTests.cpp index d64b78e20d..57ddc76e48 100644 --- a/src/tests/unittests/validation/RequestDeviceValidationTests.cpp +++ b/src/tests/unittests/validation/RequestDeviceValidationTests.cpp @@ -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(&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(&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(&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(&limits); adapter.RequestDevice(&descriptor, ExpectRequestDeviceError, nullptr); } diff --git a/src/tests/unittests/validation/TextureValidationTests.cpp b/src/tests/unittests/validation/TextureValidationTests.cpp index 6a430a4293..df93cc06c5 100644 --- a/src/tests/unittests/validation/TextureValidationTests.cpp +++ b/src/tests/unittests/validation/TextureValidationTests.cpp @@ -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); diff --git a/src/tests/unittests/validation/ToggleValidationTests.cpp b/src/tests/unittests/validation/ToggleValidationTests.cpp index b0f489f5fe..de8155ca69 100644 --- a/src/tests/unittests/validation/ToggleValidationTests.cpp +++ b/src/tests/unittests/validation/ToggleValidationTests.cpp @@ -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); diff --git a/src/tests/unittests/validation/UnsafeAPIValidationTests.cpp b/src/tests/unittests/validation/UnsafeAPIValidationTests.cpp index 8d0e9f7a6d..9739c804e7 100644 --- a/src/tests/unittests/validation/UnsafeAPIValidationTests.cpp +++ b/src/tests/unittests/validation/UnsafeAPIValidationTests.cpp @@ -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"); diff --git a/src/tests/unittests/validation/ValidationTest.cpp b/src/tests/unittests/validation/ValidationTest.cpp index 51de6b34c0..669a056fb6 100644 --- a/src/tests/unittests/validation/ValidationTest.cpp +++ b/src/tests/unittests/validation/ValidationTest.cpp @@ -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()) { diff --git a/src/tests/unittests/validation/VideoViewsValidationTests.cpp b/src/tests/unittests/validation/VideoViewsValidationTests.cpp index 7c8c5f5e88..b5f38bb77a 100644 --- a/src/tests/unittests/validation/VideoViewsValidationTests.cpp +++ b/src/tests/unittests/validation/VideoViewsValidationTests.cpp @@ -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); } diff --git a/src/tests/white_box/VulkanImageWrappingTestsDmaBuf.cpp b/src/tests/white_box/VulkanImageWrappingTestsDmaBuf.cpp index 4349f4d8ee..eca5f29086 100644 --- a/src/tests/white_box/VulkanImageWrappingTestsDmaBuf.cpp +++ b/src/tests/white_box/VulkanImageWrappingTestsDmaBuf.cpp @@ -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; diff --git a/src/tests/white_box/VulkanImageWrappingTestsOpaqueFD.cpp b/src/tests/white_box/VulkanImageWrappingTestsOpaqueFD.cpp index b81f8ce077..6c252e07e9 100644 --- a/src/tests/white_box/VulkanImageWrappingTestsOpaqueFD.cpp +++ b/src/tests/white_box/VulkanImageWrappingTestsOpaqueFD.cpp @@ -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;