Source/WebCore:
authorjustin_fan@apple.com <justin_fan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Apr 2019 19:59:55 +0000 (19:59 +0000)
committerjustin_fan@apple.com <justin_fan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Apr 2019 19:59:55 +0000 (19:59 +0000)
commit49cbc7d74e625fda688a11b0b39a14517e90e21b
treeb1356b0edc2344069b48b896d239f21ed42f847d
parent00847ee54b3a6284684132c4db82298478989b4d
Source/WebCore:
[Web GPU] Implement blend states and color write mask for GPUColorStateDescriptor
https://bugs.webkit.org/show_bug.cgi?id=196474

Reviewed by Myles C. Maxfield.

Blend states and color write masks must now be specified on GPUColorStateDescriptor instead of
relying on underlying MTLRenderPipelineColorAttachmentDescriptor defaults.

Test: webgpu/blend-triangle-strip.html, webgpu/color-write-mask-triangle-strip.html

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Modules/webgpu/GPUBlendDescriptor.idl:
* Modules/webgpu/GPUColorStateDescriptor.idl:
* Modules/webgpu/GPUColorWriteBits.idl:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* platform/graphics/gpu/GPUBlendDescriptor.h:
* platform/graphics/gpu/GPUColorStateDescriptor.h:
* platform/graphics/gpu/GPUColorWriteBits.h:
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::mtlColorWriteMaskForGPUColorWriteFlags):
(WebCore::mtlBlendOperationForGPUBlendOperation):
(WebCore::mtlBlendFactorForGPUBlendFactor):
(WebCore::setColorStatesForColorAttachmentArray):
(WebCore::tryCreateMtlRenderPipelineState):
(WebCore::trySetColorStatesForColorAttachmentArray): Deleted.

LayoutTests:
[Web GPU] Implement blend states and color write mask for  GPUColorStateDescriptor
https://bugs.webkit.org/show_bug.cgi?id=196474

Reviewed by Myles C. Maxfield.

Add blend-triangle-strip to test color blending and color-write-mask-triangle-strip.html to test color write mask.
Update other tests to specify blend states when creating a GPURenderPipeline.

* webgpu/blend-triangle-strip-expected.html: Added.
* webgpu/blend-triangle-strip.html: Added.
* webgpu/buffer-command-buffer-races.html:
* webgpu/buffer-resource-triangles.html:
* webgpu/color-write-mask-triangle-strip-expected.html: Added.
* webgpu/color-write-mask-triangle-strip.html: Added.
* webgpu/depth-enabled-triangle-strip.html:
* webgpu/js/webgpu-functions.js:
* webgpu/render-pipelines.html:
* webgpu/texture-triangle-strip.html:
* webgpu/vertex-buffer-triangle-strip.html:
* webgpu/whlsl.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243755 268f45cc-cd09-0410-ab3c-d52691b4dbfc
28 files changed:
LayoutTests/ChangeLog
LayoutTests/webgpu/blend-triangle-strip-expected.html [new file with mode: 0644]
LayoutTests/webgpu/blend-triangle-strip.html [new file with mode: 0644]
LayoutTests/webgpu/buffer-command-buffer-races.html
LayoutTests/webgpu/buffer-resource-triangles.html
LayoutTests/webgpu/color-write-mask-triangle-strip-expected.html [new file with mode: 0644]
LayoutTests/webgpu/color-write-mask-triangle-strip.html [new file with mode: 0644]
LayoutTests/webgpu/depth-enabled-triangle-strip.html
LayoutTests/webgpu/js/webgpu-functions.js
LayoutTests/webgpu/render-pipelines.html
LayoutTests/webgpu/texture-triangle-strip.html
LayoutTests/webgpu/vertex-buffer-triangle-strip.html
LayoutTests/webgpu/whlsl.html
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources-input.xcfilelist
Source/WebCore/DerivedSources-output.xcfilelist
Source/WebCore/DerivedSources.make
Source/WebCore/Modules/webgpu/GPUBlendDescriptor.idl [new file with mode: 0644]
Source/WebCore/Modules/webgpu/GPUColorStateDescriptor.idl
Source/WebCore/Modules/webgpu/GPUColorWriteBits.idl [new file with mode: 0644]
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/WebCoreBuiltinNames.h
Source/WebCore/platform/graphics/gpu/GPUBlendDescriptor.h [new file with mode: 0644]
Source/WebCore/platform/graphics/gpu/GPUColorStateDescriptor.h
Source/WebCore/platform/graphics/gpu/GPUColorWriteBits.h [new file with mode: 0644]
Source/WebCore/platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm