[WebGPU] WebGPUBindGroup and device::createBindGroup prototype
authorjustin_fan@apple.com <justin_fan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Jan 2019 02:12:57 +0000 (02:12 +0000)
committerjustin_fan@apple.com <justin_fan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Jan 2019 02:12:57 +0000 (02:12 +0000)
commit558b8fc94495e946d5f6e8688f02fd3b04b3987e
treeaccab4e9b6996b2809a0e57bc3df31c814ce6c03
parent322c78f0c02effc89905dd8a946c9e7c8033e676
[WebGPU] WebGPUBindGroup and device::createBindGroup prototype
https://bugs.webkit.org/show_bug.cgi?id=193341

Reviewed by Myles C. Maxfield.

Source/WebCore:

Add *GPUBindGroup class stubs and the ability to create WebGPUBindGroups via the API.

Test: bind-groups.html

* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:

* Modules/webgpu/WebGPUBindGroup.cpp:
(WebCore::WebGPUBindGroup::create):
(WebCore::WebGPUBindGroup::WebGPUBindGroup):
* Modules/webgpu/WebGPUBindGroup.h:
* Modules/webgpu/WebGPUBindGroup.idl: Enable createBindGroup().
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::BindingResourceVisitor::operator() const): Added. Validate and convert WebGPUBindGroupDescriptor to GPU* version.
(WebCore::WebGPUDevice::createBindGroup const): Added.
* Modules/webgpu/WebGPUDevice.h:
* platform/graphics/gpu/GPUBindGroup.cpp:
(WebCore::GPUBindGroup::create):
(WebCore::GPUBindGroup::GPUBindGroup):
* platform/graphics/gpu/GPUBindGroup.h:
* platform/graphics/gpu/GPUBufferBinding.h:
* platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
(WebCore::appendArgumentToArray): Pass RetainPtr by reference to actually update descriptor.

LayoutTests:

Small test that creates a WebGPUBindGroup.

* webgpu/bind-groups-expected.txt: Added.
* webgpu/bind-groups.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239853 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
LayoutTests/ChangeLog
LayoutTests/webgpu/bind-groups-expected.txt [new file with mode: 0644]
LayoutTests/webgpu/bind-groups.html [new file with mode: 0644]
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/Modules/webgpu/WebGPUBindGroup.cpp [new file with mode: 0644]
Source/WebCore/Modules/webgpu/WebGPUBindGroup.h [new file with mode: 0644]
Source/WebCore/Modules/webgpu/WebGPUBindGroup.idl [new file with mode: 0644]
Source/WebCore/Modules/webgpu/WebGPUDevice.cpp
Source/WebCore/Modules/webgpu/WebGPUDevice.h
Source/WebCore/Modules/webgpu/WebGPUDevice.idl
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/WebCoreBuiltinNames.h
Source/WebCore/platform/graphics/gpu/GPUBindGroup.cpp [new file with mode: 0644]
Source/WebCore/platform/graphics/gpu/GPUBindGroup.h [new file with mode: 0644]
Source/WebCore/platform/graphics/gpu/GPUBufferBinding.h
Source/WebCore/platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm