diff --git a/filament/backend/src/webgpu/WebGPUDriver.cpp b/filament/backend/src/webgpu/WebGPUDriver.cpp index dafab4571b..0e1c09c3a1 100644 --- a/filament/backend/src/webgpu/WebGPUDriver.cpp +++ b/filament/backend/src/webgpu/WebGPUDriver.cpp @@ -228,6 +228,14 @@ WebGPUDriver::WebGPUDriver(WebGPUPlatform& platform, const Platform::DriverConfi driverConfig.disableHeapHandleTags) { #if FWGPU_ENABLED(FWGPU_PRINT_SYSTEM) printInstanceDetails(mPlatform.getInstance()); +#endif + mAdapter = mPlatform.requestAdapter(nullptr); +#if FWGPU_ENABLED(FWGPU_PRINT_SYSTEM) + printAdapterDetails(mAdapter); +#endif + mDevice = mPlatform.requestDevice(mAdapter); +#if FWGPU_ENABLED(FWGPU_PRINT_SYSTEM) + printDeviceDetails(mDevice); #endif } @@ -430,14 +438,7 @@ void WebGPUDriver::createSwapChainR(Handle sch, void* nativeWindow, mNativeWindow = nativeWindow; assert_invariant(!mSwapChain); wgpu::Surface surface = mPlatform.createSurface(nativeWindow, flags); - mAdapter = mPlatform.requestAdapter(surface); -#if FWGPU_ENABLED(FWGPU_PRINT_SYSTEM) - printAdapterDetails(mAdapter); -#endif - mDevice = mPlatform.requestDevice(mAdapter); -#if FWGPU_ENABLED(FWGPU_PRINT_SYSTEM) - printDeviceDetails(mDevice); -#endif + mQueue = mDevice.GetQueue(); wgpu::Extent2D surfaceSize = mPlatform.getSurfaceExtent(mNativeWindow); mSwapChain = constructHandle(sch, std::move(surface), surfaceSize, mAdapter,