12019-07-26 Justin Fan <justin_fan@apple.com>
2
3 [WebGPU] Update GPUComputePipeline errors to match GPURenderPipeline implementation
4 https://bugs.webkit.org/show_bug.cgi?id=200097
5
6 Reviewed by NOBODY (OOPS!).
7
8 Remove passing around a functionName in GPUComputePipeline creation in favor of setting it on the GPUErrorScopes.
9 Also, WebGPU objects no longer create new Ref<>s unless object creation succeeds.
10
11 No new tests. Covered by existing tests.
12
13 * Modules/webgpu/WebGPUDevice.cpp:
14 (WebCore::WebGPUDevice::createBuffer const):
15 (WebCore::WebGPUDevice::createBufferMapped const):
16 (WebCore::WebGPUDevice::createComputePipeline const):
17 * platform/graphics/gpu/GPUBuffer.h:
18 * platform/graphics/gpu/GPUComputePipeline.h:
19 * platform/graphics/gpu/GPUDevice.cpp:
20 (WebCore::GPUDevice::tryCreateBuffer):
21 (WebCore::GPUDevice::tryCreateComputePipeline const):
22 * platform/graphics/gpu/GPUDevice.h:
23 * platform/graphics/gpu/GPUErrorScopes.cpp:
24 (WebCore::GPUErrorScopes::generatePrefixedError): Only validaton errors have messages right now.
25 * platform/graphics/gpu/GPUErrorScopes.h:
26 * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
27 (WebCore::GPUBuffer::validateBufferUsage):
28 (WebCore::GPUBuffer::tryCreate):
29 (WebCore::GPUBuffer::GPUBuffer):
30 * platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm:
31 (WebCore::trySetMetalFunctions):
32 (WebCore::trySetFunctions):
33 (WebCore::convertComputePipelineDescriptor):
34 (WebCore::tryCreateMTLComputePipelineState):
35 (WebCore::GPUComputePipeline::tryCreate):
36 (WebCore::GPUComputePipeline::GPUComputePipeline):
37 * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
38 (WebCore::trySetMetalFunctions):
39 (WebCore::trySetFunctions):
40
41 These classes were made RefCounted in a previous patch; remove their move ctors to fix build.
42 * Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:
43 * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
44 * Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
45 * Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
46 * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
47 * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h:
48