Title: [240101] trunk
Revision
240101
Author
justin_...@apple.com
Date
2019-01-16 17:35:01 -0800 (Wed, 16 Jan 2019)

Log Message

[WebGPU] Update vertex-buffer-triangle-strip.html to actually use vertex buffer
https://bugs.webkit.org/show_bug.cgi?id=193473

Reviewed by Dean Jackson and Myles Maxfield.

Source/WebCore:

Also, switch to using the inputSlot instead of the shaderLocation field, as this seems more correct.
As of now I cannot determine an analog for WebGPU's shaderLocation in Metal.

Test: Covered by vertex-buffer-triangle-strip.html. No change in behavior.

* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::setInputStateForPipelineDescriptor): Use the inputSlot instead of shaderLocation as bufferIndex.

LayoutTests:

Refactor the vertex shader to use the vertex stage input, rather than buffer resources.

* webgpu/vertex-buffer-triangle-strip.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (240100 => 240101)


--- trunk/LayoutTests/ChangeLog	2019-01-17 01:18:05 UTC (rev 240100)
+++ trunk/LayoutTests/ChangeLog	2019-01-17 01:35:01 UTC (rev 240101)
@@ -1,3 +1,14 @@
+2019-01-16  Justin Fan  <justin_...@apple.com>
+
+        [WebGPU] Update vertex-buffer-triangle-strip.html to actually use vertex buffer
+        https://bugs.webkit.org/show_bug.cgi?id=193473
+
+        Reviewed by Dean Jackson and Myles Maxfield.
+
+        Refactor the vertex shader to use the vertex stage input, rather than buffer resources. 
+
+        * webgpu/vertex-buffer-triangle-strip.html:
+
 2019-01-16  Chris Dumez  <cdu...@apple.com>
 
         Regression(PSON) View becomes blank after click a cross-site download link

Modified: trunk/LayoutTests/webgpu/vertex-buffer-triangle-strip.html (240100 => 240101)


--- trunk/LayoutTests/webgpu/vertex-buffer-triangle-strip.html	2019-01-17 01:18:05 UTC (rev 240100)
+++ trunk/LayoutTests/webgpu/vertex-buffer-triangle-strip.html	2019-01-17 01:35:01 UTC (rev 240101)
@@ -12,17 +12,24 @@
     
 using namespace metal;
 
-struct Vertex
+struct VertexIn
 {
+    float4 position [[attribute(0)]];
+};
+
+struct VertexOut
+{
     float4 position [[position]];
 };
 
-vertex Vertex vertex_main(const device Vertex* vertex_array [[buffer(0)]], uint vid [[vertex_id]])
+vertex VertexOut vertex_main(VertexIn vertexIn [[stage_in]])
 {
-    return vertex_array[vid];
+    VertexOut vOut;
+    vOut.position = vertexIn.position;
+    return vOut;
 }
 
-fragment float4 fragment_main(Vertex vertexIn [[stage_in]])
+fragment float4 fragment_main()
 {
     return float4(0.0, 1.0, 0.0, 1.0);
 }

Modified: trunk/Source/WebCore/ChangeLog (240100 => 240101)


--- trunk/Source/WebCore/ChangeLog	2019-01-17 01:18:05 UTC (rev 240100)
+++ trunk/Source/WebCore/ChangeLog	2019-01-17 01:35:01 UTC (rev 240101)
@@ -1,3 +1,18 @@
+2019-01-16  Justin Fan  <justin_...@apple.com>
+
+        [WebGPU] Update vertex-buffer-triangle-strip.html to actually use vertex buffer
+        https://bugs.webkit.org/show_bug.cgi?id=193473
+
+        Reviewed by Dean Jackson and Myles Maxfield.
+
+        Also, switch to using the inputSlot instead of the shaderLocation field, as this seems more correct. 
+        As of now I cannot determine an analog for WebGPU's shaderLocation in Metal. 
+
+        Test: Covered by vertex-buffer-triangle-strip.html. No change in behavior.
+
+        * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
+        (WebCore::setInputStateForPipelineDescriptor): Use the inputSlot instead of shaderLocation as bufferIndex. 
+
 2019-01-16  Myles C. Maxfield  <mmaxfi...@apple.com>
 
         [WHLSL] Add the function stage checker

Modified: trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm (240100 => 240101)


--- trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm	2019-01-17 01:18:05 UTC (rev 240100)
+++ trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm	2019-01-17 01:35:01 UTC (rev 240101)
@@ -134,7 +134,7 @@
         MTLVertexAttributeDescriptor *mtlAttributeDesc = [attributeArray objectAtIndexedSubscript:i];
         mtlAttributeDesc.format = *mtlFormat;
         mtlAttributeDesc.offset = attributes[i].offset;
-        mtlAttributeDesc.bufferIndex = attributes[i].shaderLocation;
+        mtlAttributeDesc.bufferIndex = attributes[i].inputSlot;
         [mtlVertexDescriptor.get().attributes setObject:mtlAttributeDesc atIndexedSubscript:i];
     }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to