Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WebGPU] Reimplement device lost callback after https://bugs.webkit.o…
…rg/show_bug.cgi?id=257640 https://bugs.webkit.org/show_bug.cgi?id=257656 <radar://110539837> Reviewed by Dan Glastonbury. Restore the deleted code from https://bugs.webkit.org/show_bug.cgi?id=257640 as it passes the CTS and conforms to the specification. Enable newly passing requestDevice.html CTS test. Also implement the concept of invalid / stale adapters. Effectively, an adapter can only request one device so make it invalid after the device is requested. Unexpectedly the device_lost validation CTS test is now passing as well. * LayoutTests/http/tests/webgpu/webgpu/api/operation/device/lost-expected.txt: * LayoutTests/http/tests/webgpu/webgpu/api/validation/state/device_lost/destroy-expected.txt: * LayoutTests/http/tests/webgpu/webgpu/api/operation/adapter/requestDevice-expected.txt: * LayoutTests/platform/mac-wk2/TestExpectations: * Source/WebCore/Modules/WebGPU/GPUDevice.cpp: (WebCore::GPUDevice::lost): * Source/WebCore/Modules/WebGPU/Implementation/WebGPUAdapterImpl.cpp: (WebCore::WebGPU::AdapterImpl::requestDevice): * Source/WebCore/Modules/WebGPU/Implementation/WebGPUDeviceImpl.cpp: (WebCore::WebGPU::DeviceImpl::resolveDeviceLostPromise): * Source/WebCore/Modules/WebGPU/Implementation/WebGPUDeviceImpl.h: * Source/WebCore/Modules/WebGPU/InternalAPI/WebGPUDevice.h: * Source/WebGPU/WebGPU/Adapter.mm: (WebGPU::Adapter::requestDevice): * Source/WebGPU/WebGPU/Device.h: * Source/WebGPU/WebGPU/Device.mm: (WebGPU::Device::setDeviceLostCallback): (wgpuDeviceSetDeviceLostCallback): (wgpuDeviceSetDeviceLostCallbackWithBlock): * Source/WebGPU/WebGPU/WebGPUExt.h: * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteDevice.cpp: (WebKit::RemoteDevice::resolveDeviceLostPromise): * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteDevice.h: * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteDevice.messages.in: * Source/WebKit/WebProcess/GPU/graphics/WebGPU/RemoteDeviceProxy.cpp: (WebKit::WebGPU::RemoteDeviceProxy::resolveDeviceLostPromise): * Source/WebKit/WebProcess/GPU/graphics/WebGPU/RemoteDeviceProxy.h: * LayoutTests/platform/mac-wk2/TestExpectations: * Source/WebGPU/WebGPU/BindGroup.mm: (WebGPU::Device::createBindGroup): * Source/WebGPU/WebGPU/BindGroupLayout.mm: (WebGPU::Device::createBindGroupLayout): * Source/WebGPU/WebGPU/Buffer.mm: (WebGPU::Device::createBuffer): * Source/WebGPU/WebGPU/CommandEncoder.mm: (WebGPU::Device::createCommandEncoder): * Source/WebGPU/WebGPU/ComputePipeline.mm: (WebGPU::Device::createComputePipelineAsync): * Source/WebGPU/WebGPU/Device.mm: (WebGPU::Device::loseTheDevice): * Source/WebGPU/WebGPU/ExternalTexture.mm: (WebGPU::Device::createExternalTexture): * Source/WebGPU/WebGPU/PipelineLayout.mm: (WebGPU::Device::createPipelineLayout): * Source/WebGPU/WebGPU/QuerySet.mm: (WebGPU::Device::createQuerySet): * Source/WebGPU/WebGPU/RenderBundleEncoder.mm: (WebGPU::Device::createRenderBundleEncoder): * Source/WebGPU/WebGPU/RenderPipeline.mm: (WebGPU::Device::createRenderPipeline): (WebGPU::Device::createRenderPipelineAsync): * Source/WebGPU/WebGPU/Sampler.mm: (WebGPU::Device::createSampler): * Source/WebGPU/WebGPU/ShaderModule.mm: (WebGPU::Device::createShaderModule): * Source/WebGPU/WebGPU/Texture.mm: (WebGPU::Device::createTexture): * Source/WebCore/Modules/WebGPU/Implementation/WebGPUAdapterImpl.cpp: Canonical link: https://commits.webkit.org/270527@main
- Loading branch information