[WHLSL] Hook up the compiler to our WebGPU implementation
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Mar 2019 21:30:58 +0000 (21:30 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Mar 2019 21:30:58 +0000 (21:30 +0000)
https://bugs.webkit.org/show_bug.cgi?id=195509

Unreviewed.

Update after r243091.

Source/WebCore:

* Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::trySetWHLSLFunctionsForPipelineDescriptor):

LayoutTests:

* webgpu/whlsl.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243105 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/webgpu/whlsl.html
Source/WebCore/ChangeLog
Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp
Source/WebCore/platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm

index 2407576..73654c2 100644 (file)
@@ -1,3 +1,14 @@
+2019-03-18  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        [WHLSL] Hook up the compiler to our WebGPU implementation
+        https://bugs.webkit.org/show_bug.cgi?id=195509
+
+        Unreviewed.
+
+        Update after r243091.
+
+        * webgpu/whlsl.html:
+
 2019-03-18  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         [iOS] Native selection views sometimes appear in hidden editable areas after losing focus
index 6ce3cdc..7ab4776 100644 (file)
@@ -16,7 +16,7 @@ fragment float4 fragmentShader(float4 position : SV_Position) : SV_Target 0 {
 `;
 async function start() {
     const adapter = await window.gpu.requestAdapter();
-    const device = adapter.createDevice();
+    const device = await adapter.requestDevice();
 
     const shaderModule = device.createShaderModule({code: shaderSource, isWHLSL: true});
     const vertexStage = {module: shaderModule, entryPoint: "vertexShader"};
@@ -93,7 +93,7 @@ async function start() {
     const swapChainDescriptor = {context, format: "bgra8unorm"};
     const swapChain = device.createSwapChain(swapChainDescriptor);
     const outputTexture = swapChain.getCurrentTexture();
-    const outputTextureView = outputTexture.createDefaultTextureView(); // createDefaultView()
+    const outputTextureView = outputTexture.createDefaultView(); // createDefaultView()
 
     const commandEncoder = device.createCommandEncoder(); // {}
     const red = {r: 0, g: 0, b: 1, a: 1};
index 03ab3ec..9e2c539 100644 (file)
@@ -1,3 +1,16 @@
+2019-03-18  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        [WHLSL] Hook up the compiler to our WebGPU implementation
+        https://bugs.webkit.org/show_bug.cgi?id=195509
+
+        Unreviewed.
+
+        Update after r243091.
+
+        * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
+        * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
+        (WebCore::trySetWHLSLFunctionsForPipelineDescriptor):
+
 2019-03-18  Chris Dumez  <cdumez@apple.com>
 
         REGRESSION(r236862): early frame decoupling leaves JSC ArrayBuffer objects lingering
index 95af98c..cd7c370 100644 (file)
@@ -31,6 +31,7 @@
 #include "WHLSLArrayType.h"
 #include "WHLSLArrayReferenceType.h"
 #include "WHLSLEnumerationDefinition.h"
+#include "WHLSLInferTypes.h"
 #include "WHLSLNativeFunctionDeclaration.h"
 #include "WHLSLNativeTypeDeclaration.h"
 #include "WHLSLPointerType.h"
index a9d500a..21d8f57 100644 (file)
@@ -259,8 +259,6 @@ static bool trySetWHLSLFunctionsForPipelineDescriptor(const char* const function
     if (!result)
         return false;
 
-    WTFLogAlways("Metal code: %s", result->metalSource.utf8().data());
-
     NSError *error = nil;
     auto library = adoptNS([device.platformDevice() newLibraryWithSource:result->metalSource options:nil error:&error]);
     ASSERT(library);