[WebGPU] Implement errors for GPURenderPipeline creation master
authorjustin_fan@apple.com <justin_fan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Jul 2019 01:42:37 +0000 (01:42 +0000)
committerjustin_fan@apple.com <justin_fan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Jul 2019 01:42:37 +0000 (01:42 +0000)
commit4991aa79de6f36a77539096362fb7b2cc3bd25b2
treebb383dc4c439bb0439e0c9621f2942e393593a6d
parent8aa9a279418a2e16a1f70c6e1de37a41d6efb4eb
[WebGPU] Implement errors for GPURenderPipeline creation
https://bugs.webkit.org/show_bug.cgi?id=200046

Reviewed by Myles C. Maxfield.

Source/WebCore:

Replacing error logging in GPURenderPipeline creation with GPUError generation.
Update GPUErrorScopes to re-use an error message prefix for less boiler-plate.

Test: webgpu/render-pipeline-errors.html

* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createRenderPipeline const):
* Modules/webgpu/WebGPURenderPipelineDescriptor.cpp:
(WebCore::WebGPURenderPipelineDescriptor::tryCreateGPURenderPipelineDescriptor const):
* Modules/webgpu/WebGPURenderPipelineDescriptor.h:
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::tryCreateRenderPipeline const):
* platform/graphics/gpu/GPUDevice.h:
* platform/graphics/gpu/GPUErrorScopes.cpp:
(WebCore::GPUErrorScopes::generatePrefixedError):
* platform/graphics/gpu/GPUErrorScopes.h:
(WebCore::GPUErrorScopes::setErrorPrefix):
* platform/graphics/gpu/GPURenderPipeline.h:
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::tryCreateMtlDepthStencilState):
(WebCore::trySetVertexInput):
(WebCore::trySetColorStates):
(WebCore::trySetMetalFunctions):
(WebCore::trySetFunctions):
(WebCore::convertRenderPipelineDescriptor):
(WebCore::tryCreateMtlRenderPipelineState):
(WebCore::GPURenderPipeline::tryCreate):
(WebCore::GPURenderPipeline::GPURenderPipeline):

LayoutTests:

Add test to cover reproducible render pipeline creation errors.

* webgpu/js/webgpu-functions.js:
(runTestsWithDevice):
* webgpu/render-pipeline-errors-expected.txt: Added.
* webgpu/render-pipeline-errors.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247764 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
LayoutTests/ChangeLog
LayoutTests/webgpu/js/webgpu-functions.js
LayoutTests/webgpu/render-pipeline-errors-expected.txt [new file with mode: 0644]
LayoutTests/webgpu/render-pipeline-errors.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Modules/webgpu/WebGPUDevice.cpp
Source/WebCore/Modules/webgpu/WebGPURenderPipelineDescriptor.cpp
Source/WebCore/Modules/webgpu/WebGPURenderPipelineDescriptor.h
Source/WebCore/platform/graphics/gpu/GPUDevice.cpp
Source/WebCore/platform/graphics/gpu/GPUDevice.h
Source/WebCore/platform/graphics/gpu/GPUErrorScopes.cpp
Source/WebCore/platform/graphics/gpu/GPUErrorScopes.h
Source/WebCore/platform/graphics/gpu/GPURenderPipeline.h
Source/WebCore/platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm