Skip to content

Commit b6ab04a

Browse files
WebGPU: Make WebCore and WebKit use WebGPU C++ API
https://bugs.webkit.org/show_bug.cgi?id=326477 rdar://189269291 Reviewed by Mike Wyrzykowski. Make the WebGPU C++ API (WebGPU/WebGPUCpp.h, namespace WebGPU) the interface between WebCore / WebKit and the WebGPU implementations. WebCore and WebKit no longer call any wgpu* function or use any WGPU* type. The WebCore::WebGPU enums, flags and value structs are replaced by the C++ API types. Their values on the wire do not change. For every WebGPU object type X (Adapter, Device, Queue, Buffer, Texture, TextureView, Sampler, QuerySet, ExternalTexture, ShaderModule, BindGroupLayout, PipelineLayout, BindGroup, ComputePipeline, RenderPipeline, CommandEncoder, CommandBuffer, the pass encoders, RenderBundleEncoder, RenderBundle, PresentationContext, Instance and the XR objects): - WebCore::GPUX holds a Ref<WebGPU::X>, and its descriptor converts to the WebGPU::XDescriptor. Descriptors borrow their arrays as spans, so the conversion keeps the element storage alive for the call. - WebKit::RemoteXProxy implements WebGPU::X in the Web Process. - WebKit::RemoteX holds the WebGPU::Metal::X, held as WebGPU::X. - The IPC converters target the WebGPU types. Descriptors without object handles are sent as the API structs. - WebCore::WebGPU::XImpl and the isRemoteXProxy() / isXImpl() type checks are removed. The WebCore::WebGPU namespace, the WebCore C API conversion helpers (WebGPUConvertToBackingContext, WebGPUDowncastConvertToBackingContext, WebGPUPtr.h, WebGPUAPIUtilities.h) and the InternalAPI directory are removed. WGPU_LARGE_BUFFER_SIZE becomes WebGPU::largeBufferSize outside the framework. The API bases have no label(), so WebCore::GPUX stores the label. It starts as the label of the descriptor, as the GPU Process path already did. In-process objects used to start with an empty label. WebCore keeps the types that refer to WebCore objects: - The queue and device commands that take an ImageBuffer, a VideoFrame or a media player are on WebCore::WebGPUIntegration, which holds the WebGPU::Instance. - WebCore::WebGPUCompositorIntegration connects the canvas to the presentation context. - WebCore::WebGPUXRLayerBacking adapts a WebGPU::XRProjectionLayer for WebXR. - The descriptors that WebCore holds on to, such as the pipeline descriptors kept for asynchronous creation, are WebCore::WebGPU<Name> types. They convert to the API descriptors in free functions. Behaviour changes: - Unknown GPUBufferUsage bits become WebGPU::BufferUsage::Invalid and fail validation. Before, bits from bit 16 up were dropped. - A color write mask with more than the four channel bits becomes WebGPU::ColorWrite::Invalid and fails validation. - unconfigure() of a canvas reaches the presentation context, which recreates its render buffers on the next configure(). - The canvas size is passed in WebGPU::CanvasConfiguration from configure() instead of setSize() from the compositor. The framework is compiled with ARC, and WebCore and WebKit are not. RetainPtr<T> is a different type under ARC, so the callable signatures of the API take raw CF references or spans, never RetainPtr. WebCore and WebKit include the API through <WebCore/WebGPUCppAPI.h> and not <WebGPU/WebGPUCpp.h> directly. The header map resolves WebGPUCpp.h to its source path, which is in no clang module, so whichever WebCore_Private submodule included it first owned the types in the Swift build. Tests: fast/webgpu and http/tests/webgpu cover the converted paths. Long change list skipped. Canonical link: https://commits.webkit.org/323962@main
1 parent bf08b69 commit b6ab04a

737 files changed

Lines changed: 6875 additions & 22024 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Source/CMakeLists.txt‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ endif ()
2424

2525
add_subdirectory(JavaScriptCore)
2626

27-
if (ENABLE_WEBGPU)
28-
add_subdirectory(WebGPU)
29-
endif ()
27+
# Every port installs the WebGPU C++ API header, which WebCore uses even when WebGPU is disabled.
28+
add_subdirectory(WebGPU)
3029

3130
if (ENABLE_WEBGL OR USE_ANGLE_EGL)
3231
add_subdirectory(ThirdParty/ANGLE)

‎Source/WebCore/CMakeLists.txt‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ set(WebCore_PRIVATE_INCLUDE_DIRECTORIES
1717
"${WEBCORE_DIR}/Modules/ShapeDetection"
1818
"${WEBCORE_DIR}/Modules/ShapeDetection/Interfaces"
1919
"${WEBCORE_DIR}/Modules/WebGPU"
20-
"${WEBCORE_DIR}/Modules/WebGPU/InternalAPI"
2120
"${WEBCORE_DIR}/Modules/WebGPU/Implementation"
2221
"${WEBCORE_DIR}/Modules/airplay"
2322
"${WEBCORE_DIR}/Modules/applepay"
@@ -2882,6 +2881,15 @@ if (NOT USE_FRAMEWORK_BUNDLES)
28822881
set(WebCore_INTERFACE_INCLUDE_DIRECTORIES ${WebCore_PRIVATE_FRAMEWORK_HEADERS_DIR})
28832882
endif ()
28842883

2884+
if (NOT APPLE)
2885+
# The WebGPU C++ API header, <WebGPU/WebGPUCpp.h>, which ports without WebGPU.framework copy to
2886+
# a plain include directory. WebCore headers include it, so the users of WebCore need it too.
2887+
list(APPEND WebCore_PRIVATE_INCLUDE_DIRECTORIES ${WebGPU_PRIVATE_FRAMEWORK_HEADERS_DIR})
2888+
list(APPEND WebCore_INTERFACE_INCLUDE_DIRECTORIES ${WebGPU_PRIVATE_FRAMEWORK_HEADERS_DIR})
2889+
list(APPEND WebCore_DEPENDENCIES WebGPU_CopyCppAPIHeaders)
2890+
list(APPEND WebCore_INTERFACE_DEPENDENCIES WebGPU_CopyCppAPIHeaders)
2891+
endif ()
2892+
28852893
set(WebCoreTestSupport_INTERFACE_LIBRARIES WebCoreTestSupport)
28862894
set(WebCoreTestSupport_INTERFACE_INCLUDE_DIRECTORIES
28872895
${WebCore_PRIVATE_FRAMEWORK_HEADERS_DIR}/WebCoreTestSupport
@@ -3311,7 +3319,7 @@ list(APPEND WebCore_PRIVATE_FRAMEWORK_HEADERS
33113319
${WebCore_DERIVED_SOURCES_DIR}/FrameTreeSyncData.serialization.in
33123320
${WebCore_DERIVED_SOURCES_DIR}/InspectorNativeFunctionParameters.json
33133321

3314-
Modules/WebGPU/InternalAPI/WebGPU.serialization.in
3322+
Modules/WebGPU/WebGPU.serialization.in
33153323
Modules/indexeddb/IndexedDB.serialization.in
33163324

33173325
page/ActivityState.serialization.in

‎Source/WebCore/Headers.cmake‎

Lines changed: 33 additions & 168 deletions
Original file line numberDiff line numberDiff line change
@@ -144,178 +144,43 @@ set(WebCore_PRIVATE_FRAMEWORK_HEADERS
144144
Modules/WebGPU/GPUVertexFormat.h
145145
Modules/WebGPU/GPUVertexState.h
146146
Modules/WebGPU/GPUVertexStepMode.h
147+
Modules/WebGPU/WebGPU.h
148+
Modules/WebGPU/WebGPUCanvasConfiguration.h
149+
Modules/WebGPU/WebGPUColorTargetState.h
150+
Modules/WebGPU/WebGPUCompositorIntegration.h
151+
Modules/WebGPU/WebGPUComputePipelineDescriptor.h
152+
Modules/WebGPU/WebGPUCppAPI.h
153+
Modules/WebGPU/WebGPUDepthStencilState.h
154+
Modules/WebGPU/WebGPUDevice.h
155+
Modules/WebGPU/WebGPUDeviceDescriptor.h
156+
Modules/WebGPU/WebGPUDeviceLostInfo.h
157+
Modules/WebGPU/WebGPUError.h
158+
Modules/WebGPU/WebGPUExternalTextureDescriptor.h
159+
Modules/WebGPU/WebGPUFragmentState.h
160+
Modules/WebGPU/WebGPUImageCopyExternalImage.h
161+
Modules/WebGPU/WebGPUImageCopyTextureTagged.h
162+
Modules/WebGPU/WebGPUInternalError.h
163+
Modules/WebGPU/WebGPUObjectDescriptorBase.h
164+
Modules/WebGPU/WebGPUOutOfMemoryError.h
165+
Modules/WebGPU/WebGPUPipelineDescriptorBase.h
166+
Modules/WebGPU/WebGPUPredefinedColorSpace.h
167+
Modules/WebGPU/WebGPUPresentationContextDescriptor.h
168+
Modules/WebGPU/WebGPUProgrammableStage.h
169+
Modules/WebGPU/WebGPURenderBundleEncoderDescriptor.h
170+
Modules/WebGPU/WebGPURenderPassLayout.h
171+
Modules/WebGPU/WebGPURenderPipelineDescriptor.h
172+
Modules/WebGPU/WebGPUShaderModuleCompilationHint.h
173+
Modules/WebGPU/WebGPUShaderModuleDescriptor.h
174+
Modules/WebGPU/WebGPUSupportedFeatures.h
175+
Modules/WebGPU/WebGPUSupportedLimits.h
176+
Modules/WebGPU/WebGPUValidationError.h
177+
Modules/WebGPU/WebGPUVertexBufferLayout.h
178+
Modules/WebGPU/WebGPUVertexState.h
179+
Modules/WebGPU/WebGPUXRLayerBacking.h
147180

148-
Modules/WebGPU/Implementation/WebGPUAPIUtilities.h
149-
Modules/WebGPU/Implementation/WebGPUAdapterImpl.h
150-
Modules/WebGPU/Implementation/WebGPUBindGroupImpl.h
151-
Modules/WebGPU/Implementation/WebGPUBindGroupLayoutImpl.h
152-
Modules/WebGPU/Implementation/WebGPUBufferImpl.h
153-
Modules/WebGPU/Implementation/WebGPUCommandBufferImpl.h
154-
Modules/WebGPU/Implementation/WebGPUCommandEncoderImpl.h
155181
Modules/WebGPU/Implementation/WebGPUCompositorIntegrationImpl.h
156-
Modules/WebGPU/Implementation/WebGPUComputePassEncoderImpl.h
157-
Modules/WebGPU/Implementation/WebGPUComputePipelineImpl.h
158-
Modules/WebGPU/Implementation/WebGPUConvertToBackingContext.h
159182
Modules/WebGPU/Implementation/WebGPUCreateImpl.h
160-
Modules/WebGPU/Implementation/WebGPUDeviceImpl.h
161-
Modules/WebGPU/Implementation/WebGPUDowncastConvertToBackingContext.h
162-
Modules/WebGPU/Implementation/WebGPUExternalTextureImpl.h
163183
Modules/WebGPU/Implementation/WebGPUImpl.h
164-
Modules/WebGPU/Implementation/WebGPUPipelineLayoutImpl.h
165-
Modules/WebGPU/Implementation/WebGPUPresentationContextImpl.h
166-
Modules/WebGPU/Implementation/WebGPUPtr.h
167-
Modules/WebGPU/Implementation/WebGPUQuerySetImpl.h
168-
Modules/WebGPU/Implementation/WebGPUQueueImpl.h
169-
Modules/WebGPU/Implementation/WebGPURenderBundleEncoderImpl.h
170-
Modules/WebGPU/Implementation/WebGPURenderBundleImpl.h
171-
Modules/WebGPU/Implementation/WebGPURenderPassEncoderImpl.h
172-
Modules/WebGPU/Implementation/WebGPURenderPipelineImpl.h
173-
Modules/WebGPU/Implementation/WebGPUSamplerImpl.h
174-
Modules/WebGPU/Implementation/WebGPUShaderModuleImpl.h
175-
Modules/WebGPU/Implementation/WebGPUTextureImpl.h
176-
Modules/WebGPU/Implementation/WebGPUTextureViewImpl.h
177-
Modules/WebGPU/Implementation/WebGPUXRBindingImpl.h
178-
Modules/WebGPU/Implementation/WebGPUXRProjectionLayerImpl.h
179-
Modules/WebGPU/Implementation/WebGPUXRSubImageImpl.h
180-
Modules/WebGPU/Implementation/WebGPUXRViewImpl.h
181-
182-
Modules/WebGPU/InternalAPI/WebGPU.h
183-
Modules/WebGPU/InternalAPI/WebGPUAdapter.h
184-
Modules/WebGPU/InternalAPI/WebGPUAddressMode.h
185-
Modules/WebGPU/InternalAPI/WebGPUBindGroup.h
186-
Modules/WebGPU/InternalAPI/WebGPUBindGroupDescriptor.h
187-
Modules/WebGPU/InternalAPI/WebGPUBindGroupEntry.h
188-
Modules/WebGPU/InternalAPI/WebGPUBindGroupLayout.h
189-
Modules/WebGPU/InternalAPI/WebGPUBindGroupLayoutDescriptor.h
190-
Modules/WebGPU/InternalAPI/WebGPUBindGroupLayoutEntry.h
191-
Modules/WebGPU/InternalAPI/WebGPUBlendComponent.h
192-
Modules/WebGPU/InternalAPI/WebGPUBlendFactor.h
193-
Modules/WebGPU/InternalAPI/WebGPUBlendOperation.h
194-
Modules/WebGPU/InternalAPI/WebGPUBlendState.h
195-
Modules/WebGPU/InternalAPI/WebGPUBuffer.h
196-
Modules/WebGPU/InternalAPI/WebGPUBufferBinding.h
197-
Modules/WebGPU/InternalAPI/WebGPUBufferBindingLayout.h
198-
Modules/WebGPU/InternalAPI/WebGPUBufferBindingType.h
199-
Modules/WebGPU/InternalAPI/WebGPUBufferDescriptor.h
200-
Modules/WebGPU/InternalAPI/WebGPUBufferUsage.h
201-
Modules/WebGPU/InternalAPI/WebGPUCanvasAlphaMode.h
202-
Modules/WebGPU/InternalAPI/WebGPUCanvasConfiguration.h
203-
Modules/WebGPU/InternalAPI/WebGPUCanvasToneMappingMode.h
204-
Modules/WebGPU/InternalAPI/WebGPUColor.h
205-
Modules/WebGPU/InternalAPI/WebGPUColorTargetState.h
206-
Modules/WebGPU/InternalAPI/WebGPUColorWrite.h
207-
Modules/WebGPU/InternalAPI/WebGPUCommandBuffer.h
208-
Modules/WebGPU/InternalAPI/WebGPUCommandBufferDescriptor.h
209-
Modules/WebGPU/InternalAPI/WebGPUCommandEncoder.h
210-
Modules/WebGPU/InternalAPI/WebGPUCommandEncoderDescriptor.h
211-
Modules/WebGPU/InternalAPI/WebGPUCompareFunction.h
212-
Modules/WebGPU/InternalAPI/WebGPUCompilationInfo.h
213-
Modules/WebGPU/InternalAPI/WebGPUCompilationMessage.h
214-
Modules/WebGPU/InternalAPI/WebGPUCompilationMessageType.h
215-
Modules/WebGPU/InternalAPI/WebGPUCompositorIntegration.h
216-
Modules/WebGPU/InternalAPI/WebGPUComputePassDescriptor.h
217-
Modules/WebGPU/InternalAPI/WebGPUComputePassEncoder.h
218-
Modules/WebGPU/InternalAPI/WebGPUComputePassTimestampWrites.h
219-
Modules/WebGPU/InternalAPI/WebGPUComputePipeline.h
220-
Modules/WebGPU/InternalAPI/WebGPUComputePipelineDescriptor.h
221-
Modules/WebGPU/InternalAPI/WebGPUCullMode.h
222-
Modules/WebGPU/InternalAPI/WebGPUDepthStencilState.h
223-
Modules/WebGPU/InternalAPI/WebGPUDevice.h
224-
Modules/WebGPU/InternalAPI/WebGPUDeviceDescriptor.h
225-
Modules/WebGPU/InternalAPI/WebGPUDeviceLostInfo.h
226-
Modules/WebGPU/InternalAPI/WebGPUDeviceLostReason.h
227-
Modules/WebGPU/InternalAPI/WebGPUError.h
228-
Modules/WebGPU/InternalAPI/WebGPUErrorFilter.h
229-
Modules/WebGPU/InternalAPI/WebGPUExtent3D.h
230-
Modules/WebGPU/InternalAPI/WebGPUExternalTexture.h
231-
Modules/WebGPU/InternalAPI/WebGPUExternalTextureBindingLayout.h
232-
Modules/WebGPU/InternalAPI/WebGPUExternalTextureDescriptor.h
233-
Modules/WebGPU/InternalAPI/WebGPUFeatureName.h
234-
Modules/WebGPU/InternalAPI/WebGPUFilterMode.h
235-
Modules/WebGPU/InternalAPI/WebGPUFragmentState.h
236-
Modules/WebGPU/InternalAPI/WebGPUFrontFace.h
237-
Modules/WebGPU/InternalAPI/WebGPUImageCopyBuffer.h
238-
Modules/WebGPU/InternalAPI/WebGPUImageCopyExternalImage.h
239-
Modules/WebGPU/InternalAPI/WebGPUImageCopyTexture.h
240-
Modules/WebGPU/InternalAPI/WebGPUImageCopyTextureTagged.h
241-
Modules/WebGPU/InternalAPI/WebGPUImageDataLayout.h
242-
Modules/WebGPU/InternalAPI/WebGPUIndexFormat.h
243-
Modules/WebGPU/InternalAPI/WebGPUIntegralTypes.h
244-
Modules/WebGPU/InternalAPI/WebGPUInternalError.h
245-
Modules/WebGPU/InternalAPI/WebGPULoadOp.h
246-
Modules/WebGPU/InternalAPI/WebGPUMapMode.h
247-
Modules/WebGPU/InternalAPI/WebGPUMultisampleState.h
248-
Modules/WebGPU/InternalAPI/WebGPUObjectDescriptorBase.h
249-
Modules/WebGPU/InternalAPI/WebGPUOrigin2D.h
250-
Modules/WebGPU/InternalAPI/WebGPUOrigin3D.h
251-
Modules/WebGPU/InternalAPI/WebGPUOutOfMemoryError.h
252-
Modules/WebGPU/InternalAPI/WebGPUPipelineDescriptorBase.h
253-
Modules/WebGPU/InternalAPI/WebGPUPipelineLayout.h
254-
Modules/WebGPU/InternalAPI/WebGPUPipelineLayoutDescriptor.h
255-
Modules/WebGPU/InternalAPI/WebGPUPowerPreference.h
256-
Modules/WebGPU/InternalAPI/WebGPUPredefinedColorSpace.h
257-
Modules/WebGPU/InternalAPI/WebGPUPresentationContext.h
258-
Modules/WebGPU/InternalAPI/WebGPUPresentationContextDescriptor.h
259-
Modules/WebGPU/InternalAPI/WebGPUPrimitiveState.h
260-
Modules/WebGPU/InternalAPI/WebGPUPrimitiveTopology.h
261-
Modules/WebGPU/InternalAPI/WebGPUProgrammableStage.h
262-
Modules/WebGPU/InternalAPI/WebGPUQuerySet.h
263-
Modules/WebGPU/InternalAPI/WebGPUQuerySetDescriptor.h
264-
Modules/WebGPU/InternalAPI/WebGPUQueryType.h
265-
Modules/WebGPU/InternalAPI/WebGPUQueue.h
266-
Modules/WebGPU/InternalAPI/WebGPURenderBundle.h
267-
Modules/WebGPU/InternalAPI/WebGPURenderBundleDescriptor.h
268-
Modules/WebGPU/InternalAPI/WebGPURenderBundleEncoder.h
269-
Modules/WebGPU/InternalAPI/WebGPURenderBundleEncoderDescriptor.h
270-
Modules/WebGPU/InternalAPI/WebGPURenderPassColorAttachment.h
271-
Modules/WebGPU/InternalAPI/WebGPURenderPassDepthStencilAttachment.h
272-
Modules/WebGPU/InternalAPI/WebGPURenderPassDescriptor.h
273-
Modules/WebGPU/InternalAPI/WebGPURenderPassEncoder.h
274-
Modules/WebGPU/InternalAPI/WebGPURenderPassLayout.h
275-
Modules/WebGPU/InternalAPI/WebGPURenderPassTimestampWrites.h
276-
Modules/WebGPU/InternalAPI/WebGPURenderPipeline.h
277-
Modules/WebGPU/InternalAPI/WebGPURenderPipelineDescriptor.h
278-
Modules/WebGPU/InternalAPI/WebGPURequestAdapterOptions.h
279-
Modules/WebGPU/InternalAPI/WebGPUSampler.h
280-
Modules/WebGPU/InternalAPI/WebGPUSamplerBindingLayout.h
281-
Modules/WebGPU/InternalAPI/WebGPUSamplerBindingType.h
282-
Modules/WebGPU/InternalAPI/WebGPUSamplerDescriptor.h
283-
Modules/WebGPU/InternalAPI/WebGPUShaderModule.h
284-
Modules/WebGPU/InternalAPI/WebGPUShaderModuleCompilationHint.h
285-
Modules/WebGPU/InternalAPI/WebGPUShaderModuleDescriptor.h
286-
Modules/WebGPU/InternalAPI/WebGPUShaderStage.h
287-
Modules/WebGPU/InternalAPI/WebGPUStencilFaceState.h
288-
Modules/WebGPU/InternalAPI/WebGPUStencilOperation.h
289-
Modules/WebGPU/InternalAPI/WebGPUStorageTextureAccess.h
290-
Modules/WebGPU/InternalAPI/WebGPUStorageTextureBindingLayout.h
291-
Modules/WebGPU/InternalAPI/WebGPUStoreOp.h
292-
Modules/WebGPU/InternalAPI/WebGPUSupportedFeatures.h
293-
Modules/WebGPU/InternalAPI/WebGPUSupportedLimits.h
294-
Modules/WebGPU/InternalAPI/WebGPUTexture.h
295-
Modules/WebGPU/InternalAPI/WebGPUTextureAspect.h
296-
Modules/WebGPU/InternalAPI/WebGPUTextureBindingLayout.h
297-
Modules/WebGPU/InternalAPI/WebGPUTextureComponentSwizzle.h
298-
Modules/WebGPU/InternalAPI/WebGPUTextureDescriptor.h
299-
Modules/WebGPU/InternalAPI/WebGPUTextureDimension.h
300-
Modules/WebGPU/InternalAPI/WebGPUTextureFormat.h
301-
Modules/WebGPU/InternalAPI/WebGPUTextureSampleType.h
302-
Modules/WebGPU/InternalAPI/WebGPUTextureUsage.h
303-
Modules/WebGPU/InternalAPI/WebGPUTextureView.h
304-
Modules/WebGPU/InternalAPI/WebGPUTextureViewDescriptor.h
305-
Modules/WebGPU/InternalAPI/WebGPUTextureViewDimension.h
306-
Modules/WebGPU/InternalAPI/WebGPUUncapturedErrorEventInit.h
307-
Modules/WebGPU/InternalAPI/WebGPUValidationError.h
308-
Modules/WebGPU/InternalAPI/WebGPUVertexAttribute.h
309-
Modules/WebGPU/InternalAPI/WebGPUVertexBufferLayout.h
310-
Modules/WebGPU/InternalAPI/WebGPUVertexFormat.h
311-
Modules/WebGPU/InternalAPI/WebGPUVertexState.h
312-
Modules/WebGPU/InternalAPI/WebGPUVertexStepMode.h
313-
Modules/WebGPU/InternalAPI/WebGPUXRBinding.h
314-
Modules/WebGPU/InternalAPI/WebGPUXREye.h
315-
Modules/WebGPU/InternalAPI/WebGPUXRLayerBacking.h
316-
Modules/WebGPU/InternalAPI/WebGPUXRProjectionLayer.h
317-
Modules/WebGPU/InternalAPI/WebGPUXRSubImage.h
318-
Modules/WebGPU/InternalAPI/WebGPUXRView.h
319184

320185
Modules/airplay/PlaybackTargetClientContextIdentifier.h
321186
Modules/airplay/WebMediaSessionManager.h

‎Source/WebCore/Modules/WebGPU/GPU.cpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
namespace WebCore {
4040

41-
GPU::GPU(Ref<WebGPU::GPU>&& backing)
41+
GPU::GPU(Ref<WebGPUIntegration>&& backing)
4242
: m_backing(WTF::move(backing))
4343
, m_wgslLanguageFeatures(WGSLLanguageFeatures::create())
4444
{
@@ -69,12 +69,12 @@ void GPU::requestAdapter(const std::optional<GPURequestAdapterOptions>& options,
6969
return;
7070
}
7171

72-
m_backing->requestAdapter(convertToBacking(options), [promise = WTF::move(promise)](RefPtr<WebGPU::Adapter>&& adapter) mutable {
72+
m_backing->requestAdapter(convertToBacking(options), [promise = WTF::move(promise), gpu = m_backing](RefPtr<WebGPU::Adapter>&& adapter) mutable {
7373
if (!adapter) {
7474
promise.resolve(nullptr);
7575
return;
7676
}
77-
promise.resolve(GPUAdapter::create(adapter.releaseNonNull()).ptr());
77+
promise.resolve(GPUAdapter::create(adapter.releaseNonNull(), WTF::move(gpu)).ptr());
7878
});
7979
}
8080

‎Source/WebCore/Modules/WebGPU/GPU.h‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ struct GPURequestAdapterOptions;
4848

4949
class GPU : public RefCounted<GPU> {
5050
public:
51-
static Ref<GPU> create(Ref<WebGPU::GPU>&& backing)
51+
static Ref<GPU> create(Ref<WebGPUIntegration>&& backing)
5252
{
5353
return adoptRef(*new GPU(WTF::move(backing)));
5454
}
@@ -65,14 +65,14 @@ class GPU : public RefCounted<GPU> {
6565
RefPtr<GPUCompositorIntegration> createCompositorIntegration();
6666

6767
void paintToCanvas(NativeImage&, const IntSize&, GraphicsContext&);
68-
const WebGPU::GPU& backing() const { return m_backing; }
69-
WebGPU::GPU& backing() { return m_backing; }
68+
const WebGPUIntegration& backing() const { return m_backing; }
69+
WebGPUIntegration& backing() { return m_backing; }
7070

7171
private:
72-
GPU(Ref<WebGPU::GPU>&&);
72+
GPU(Ref<WebGPUIntegration>&&);
7373

7474
struct PendingRequestAdapterArguments;
75-
const Ref<WebGPU::GPU> m_backing;
75+
const Ref<WebGPUIntegration> m_backing;
7676
const Ref<WGSLLanguageFeatures> m_wgslLanguageFeatures;
7777
};
7878

0 commit comments

Comments
 (0)