Title: [243089] trunk
Revision
243089
Author
justin_...@apple.com
Date
2019-03-18 12:07:56 -0700 (Mon, 18 Mar 2019)

Log Message

[Web GPU] API updates: GPUTexture.createDefaultView and type-safe GPURenderPassEncoder.setPipeline
https://bugs.webkit.org/show_bug.cgi?id=195896

Reviewed by Jon Lee.

Source/WebCore:

Rename createDefaultTextureView -> createDefaultView and move setPipeline from GPUProgrammablePassEncoder to GPURenderPassEncoder.

Existing tests updated for createDefaultView name.

* Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
(WebCore::WebGPUProgrammablePassEncoder::setPipeline): Deleted.
* Modules/webgpu/WebGPUProgrammablePassEncoder.h:
* Modules/webgpu/WebGPUProgrammablePassEncoder.idl:
* Modules/webgpu/WebGPURenderPassEncoder.cpp:
(WebCore::WebGPURenderPassEncoder::setPipeline):
* Modules/webgpu/WebGPURenderPassEncoder.h:
* Modules/webgpu/WebGPURenderPassEncoder.idl:
* Modules/webgpu/WebGPUTexture.cpp:
(WebCore::WebGPUTexture::createDefaultView):
(WebCore::WebGPUTexture::createDefaultTextureView): Deleted.
* Modules/webgpu/WebGPUTexture.h:
* Modules/webgpu/WebGPUTexture.idl:
* platform/graphics/gpu/GPUProgrammablePassEncoder.h:
* platform/graphics/gpu/GPURenderPassEncoder.h:

LayoutTests:

Rename createDefaultTextureView -> createDefaultView.

* webgpu/buffer-command-buffer-races.html:
* webgpu/depth-enabled-triangle-strip.html:
* webgpu/js/webgpu-functions.js:
(beginBasicRenderPass):
* webgpu/texture-triangle-strip.html:
* webgpu/textures-textureviews.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (243088 => 243089)


--- trunk/LayoutTests/ChangeLog	2019-03-18 19:03:32 UTC (rev 243088)
+++ trunk/LayoutTests/ChangeLog	2019-03-18 19:07:56 UTC (rev 243089)
@@ -1,3 +1,19 @@
+2019-03-18  Justin Fan  <justin_...@apple.com>
+
+        [Web GPU] API updates: GPUTexture.createDefaultView and type-safe GPURenderPassEncoder.setPipeline
+        https://bugs.webkit.org/show_bug.cgi?id=195896
+
+        Reviewed by Jon Lee.
+
+        Rename createDefaultTextureView -> createDefaultView.
+
+        * webgpu/buffer-command-buffer-races.html:
+        * webgpu/depth-enabled-triangle-strip.html:
+        * webgpu/js/webgpu-functions.js:
+        (beginBasicRenderPass):
+        * webgpu/texture-triangle-strip.html:
+        * webgpu/textures-textureviews.html:
+
 2019-03-18  Joseph Pecoraro  <pecor...@apple.com>
 
         Web Inspector: HAR Extension for `serverIPAddress` port number

Modified: trunk/LayoutTests/webgpu/buffer-command-buffer-races.html (243088 => 243089)


--- trunk/LayoutTests/webgpu/buffer-command-buffer-races.html	2019-03-18 19:03:32 UTC (rev 243088)
+++ trunk/LayoutTests/webgpu/buffer-command-buffer-races.html	2019-03-18 19:07:56 UTC (rev 243089)
@@ -107,7 +107,7 @@
     colorBuffer.setSubData(0, greenArray.buffer);
 
     const attachment = {
-        attachment: swapChain.getCurrentTexture().createDefaultTextureView(),
+        attachment: swapChain.getCurrentTexture().createDefaultView(),
         loadOp: "load",
         storeOp: "store",
         clearColor: { r: 1, g: 0, b: 0, a: 1 }

Modified: trunk/LayoutTests/webgpu/depth-enabled-triangle-strip.html (243088 => 243089)


--- trunk/LayoutTests/webgpu/depth-enabled-triangle-strip.html	2019-03-18 19:03:32 UTC (rev 243088)
+++ trunk/LayoutTests/webgpu/depth-enabled-triangle-strip.html	2019-03-18 19:07:56 UTC (rev 243089)
@@ -92,7 +92,7 @@
     const commandEncoder = device.createCommandEncoder();
 
     const basicAttachment = {
-        attachment: swapChain.getCurrentTexture().createDefaultTextureView(),
+        attachment: swapChain.getCurrentTexture().createDefaultView(),
         loadOp: "clear",
         storeOp: "store",
         clearColor: { r: 1.0, g: 0, b: 0, a: 1.0 }
@@ -99,7 +99,7 @@
     };
 
     const depthAttachment = {
-        attachment: createBasicDepthTexture(canvas, device).createDefaultTextureView(),
+        attachment: createBasicDepthTexture(canvas, device).createDefaultView(),
         depthLoadOp: "clear",
         depthStoreOp: "store",
         clearDepth: 1.0

Modified: trunk/LayoutTests/webgpu/js/webgpu-functions.js (243088 => 243089)


--- trunk/LayoutTests/webgpu/js/webgpu-functions.js	2019-03-18 19:03:32 UTC (rev 243088)
+++ trunk/LayoutTests/webgpu/js/webgpu-functions.js	2019-03-18 19:07:56 UTC (rev 243089)
@@ -68,7 +68,7 @@
 
 function beginBasicRenderPass(swapChain, commandEncoder) {
     const basicAttachment = {
-        attachment: swapChain.getCurrentTexture().createDefaultTextureView(),
+        attachment: swapChain.getCurrentTexture().createDefaultView(),
         loadOp: "clear",
         storeOp: "store",
         clearColor: { r: 1.0, g: 0, b: 0, a: 1.0 }

Modified: trunk/LayoutTests/webgpu/texture-triangle-strip.html (243088 => 243089)


--- trunk/LayoutTests/webgpu/texture-triangle-strip.html	2019-03-18 19:03:32 UTC (rev 243088)
+++ trunk/LayoutTests/webgpu/texture-triangle-strip.html	2019-03-18 19:07:56 UTC (rev 243089)
@@ -171,7 +171,7 @@
 
     const textureBinding = { 
         binding: textureBindingNum, 
-        resource: texture.createDefaultTextureView() 
+        resource: texture.createDefaultView() 
     };
     const samplerBinding = {
         binding: samplerBindingNum,

Modified: trunk/LayoutTests/webgpu/textures-textureviews.html (243088 => 243089)


--- trunk/LayoutTests/webgpu/textures-textureviews.html	2019-03-18 19:03:32 UTC (rev 243088)
+++ trunk/LayoutTests/webgpu/textures-textureviews.html	2019-03-18 19:07:56 UTC (rev 243089)
@@ -33,7 +33,7 @@
     const texture = swapChain.getCurrentTexture();
     assert_true(texture instanceof WebGPUTexture, "Successfully acquired next texture.");
 
-    const textureView = texture.createDefaultTextureView();
+    const textureView = texture.createDefaultView();
     assert_true(textureView instanceof WebGPUTextureView, "Successfully created texture view from next texture.");
 }, "Create texture view from swap chain.");
 

Modified: trunk/Source/WebCore/ChangeLog (243088 => 243089)


--- trunk/Source/WebCore/ChangeLog	2019-03-18 19:03:32 UTC (rev 243088)
+++ trunk/Source/WebCore/ChangeLog	2019-03-18 19:07:56 UTC (rev 243089)
@@ -1,3 +1,30 @@
+2019-03-18  Justin Fan  <justin_...@apple.com>
+
+        [Web GPU] API updates: GPUTexture.createDefaultView and type-safe GPURenderPassEncoder.setPipeline
+        https://bugs.webkit.org/show_bug.cgi?id=195896
+
+        Reviewed by Jon Lee.
+
+        Rename createDefaultTextureView -> createDefaultView and move setPipeline from GPUProgrammablePassEncoder to GPURenderPassEncoder.
+
+        Existing tests updated for createDefaultView name.
+
+        * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
+        (WebCore::WebGPUProgrammablePassEncoder::setPipeline): Deleted.
+        * Modules/webgpu/WebGPUProgrammablePassEncoder.h:
+        * Modules/webgpu/WebGPUProgrammablePassEncoder.idl:
+        * Modules/webgpu/WebGPURenderPassEncoder.cpp:
+        (WebCore::WebGPURenderPassEncoder::setPipeline):
+        * Modules/webgpu/WebGPURenderPassEncoder.h:
+        * Modules/webgpu/WebGPURenderPassEncoder.idl:
+        * Modules/webgpu/WebGPUTexture.cpp:
+        (WebCore::WebGPUTexture::createDefaultView):
+        (WebCore::WebGPUTexture::createDefaultTextureView): Deleted.
+        * Modules/webgpu/WebGPUTexture.h:
+        * Modules/webgpu/WebGPUTexture.idl:
+        * platform/graphics/gpu/GPUProgrammablePassEncoder.h:
+        * platform/graphics/gpu/GPURenderPassEncoder.h:
+
 2019-03-18  Chris Dumez  <cdu...@apple.com>
 
         [iOS] The network process sometimes gets killed for trying to suspend while holding locked files

Modified: trunk/Source/WebCore/Modules/webgpu/WebGPUProgrammablePassEncoder.cpp (243088 => 243089)


--- trunk/Source/WebCore/Modules/webgpu/WebGPUProgrammablePassEncoder.cpp	2019-03-18 19:03:32 UTC (rev 243088)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPUProgrammablePassEncoder.cpp	2019-03-18 19:07:56 UTC (rev 243089)
@@ -68,19 +68,6 @@
     passEncoder()->setBindGroup(index, *bindGroup.bindGroup());
 }
 
-void WebGPUProgrammablePassEncoder::setPipeline(const WebGPURenderPipeline& pipeline)
-{
-    if (!passEncoder()) {
-        LOG(WebGPU, "GPUProgrammablePassEncoder::setPipeline(): Invalid operation!");
-        return;
-    }
-    if (!pipeline.renderPipeline()) {
-        LOG(WebGPU, "GPUProgrammablePassEncoder::setPipeline(): Invalid pipeline!");
-        return;
-    }
-    passEncoder()->setPipeline(makeRef(*pipeline.renderPipeline()));
-}
-
 } // namespace WebCore
 
 #endif // ENABLE(WEBGPU)

Modified: trunk/Source/WebCore/Modules/webgpu/WebGPUProgrammablePassEncoder.h (243088 => 243089)


--- trunk/Source/WebCore/Modules/webgpu/WebGPUProgrammablePassEncoder.h	2019-03-18 19:03:32 UTC (rev 243088)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPUProgrammablePassEncoder.h	2019-03-18 19:07:56 UTC (rev 243089)
@@ -42,7 +42,6 @@
 
     void endPass();
     void setBindGroup(unsigned, WebGPUBindGroup&) const;
-    void setPipeline(const WebGPURenderPipeline&);
 
 protected:
     WebGPUProgrammablePassEncoder(Ref<WebGPUCommandEncoder>&&);

Modified: trunk/Source/WebCore/Modules/webgpu/WebGPUProgrammablePassEncoder.idl (243088 => 243089)


--- trunk/Source/WebCore/Modules/webgpu/WebGPUProgrammablePassEncoder.idl	2019-03-18 19:03:32 UTC (rev 243088)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPUProgrammablePassEncoder.idl	2019-03-18 19:07:56 UTC (rev 243089)
@@ -33,5 +33,4 @@
 ] interface WebGPUProgrammablePassEncoder {
     void endPass();
     void setBindGroup(u32 index, WebGPUBindGroup bindGroup/*, optional sequence<u32> dynamicOffsets*/);
-    void setPipeline(WebGPURenderPipeline pipeline); // FIXME: Support WebGPUComputePipelines.
 };

Modified: trunk/Source/WebCore/Modules/webgpu/WebGPURenderPassEncoder.cpp (243088 => 243089)


--- trunk/Source/WebCore/Modules/webgpu/WebGPURenderPassEncoder.cpp	2019-03-18 19:03:32 UTC (rev 243088)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPURenderPassEncoder.cpp	2019-03-18 19:07:56 UTC (rev 243089)
@@ -47,6 +47,19 @@
 {
 }
 
+void WebGPURenderPassEncoder::setPipeline(const WebGPURenderPipeline& pipeline)
+{
+    if (!m_passEncoder) {
+        LOG(WebGPU, "GPUProgrammablePassEncoder::setPipeline(): Invalid operation!");
+        return;
+    }
+    if (!pipeline.renderPipeline()) {
+        LOG(WebGPU, "GPUProgrammablePassEncoder::setPipeline(): Invalid pipeline!");
+        return;
+    }
+    m_passEncoder->setPipeline(makeRef(*pipeline.renderPipeline()));
+}
+
 void WebGPURenderPassEncoder::setVertexBuffers(unsigned long startSlot, Vector<RefPtr<WebGPUBuffer>>&& buffers, Vector<unsigned long long>&& offsets)
 {
 #if !LOG_DISABLED

Modified: trunk/Source/WebCore/Modules/webgpu/WebGPURenderPassEncoder.h (243088 => 243089)


--- trunk/Source/WebCore/Modules/webgpu/WebGPURenderPassEncoder.h	2019-03-18 19:03:32 UTC (rev 243088)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPURenderPassEncoder.h	2019-03-18 19:07:56 UTC (rev 243089)
@@ -42,6 +42,7 @@
 public:
     static Ref<WebGPURenderPassEncoder> create(Ref<WebGPUCommandEncoder>&&, RefPtr<GPURenderPassEncoder>&&);
 
+    void setPipeline(const WebGPURenderPipeline&);
     void setVertexBuffers(unsigned long, Vector<RefPtr<WebGPUBuffer>>&&, Vector<unsigned long long>&&);
     void draw(unsigned long vertexCount, unsigned long instanceCount, unsigned long firstVertex, unsigned long firstInstance);
 

Modified: trunk/Source/WebCore/Modules/webgpu/WebGPURenderPassEncoder.idl (243088 => 243089)


--- trunk/Source/WebCore/Modules/webgpu/WebGPURenderPassEncoder.idl	2019-03-18 19:03:32 UTC (rev 243088)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPURenderPassEncoder.idl	2019-03-18 19:07:56 UTC (rev 243089)
@@ -32,6 +32,8 @@
     EnabledAtRuntime=WebGPU,
     JSGenerateToJSObject
 ] interface WebGPURenderPassEncoder : WebGPUProgrammablePassEncoder {
+    void setPipeline(WebGPURenderPipeline pipeline);
+
     void setVertexBuffers(u32 startSlot, sequence<WebGPUBuffer> buffers, sequence<u64> offsets);
 
     void draw(u32 vertexCount, u32 instanceCount, u32 firstVertex, u32 firstInstance);

Modified: trunk/Source/WebCore/Modules/webgpu/WebGPUTexture.cpp (243088 => 243089)


--- trunk/Source/WebCore/Modules/webgpu/WebGPUTexture.cpp	2019-03-18 19:03:32 UTC (rev 243088)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPUTexture.cpp	2019-03-18 19:07:56 UTC (rev 243089)
@@ -42,10 +42,10 @@
 {
 }
 
-Ref<WebGPUTextureView> WebGPUTexture::createDefaultTextureView()
+Ref<WebGPUTextureView> WebGPUTexture::createDefaultView()
 {
     if (!m_texture) {
-        LOG(WebGPU, "GPUTexture::createDefaultTextureView(): Invalid operation!");
+        LOG(WebGPU, "GPUTexture::createDefaultView(): Invalid operation!");
         return WebGPUTextureView::create(nullptr);
     }
 

Modified: trunk/Source/WebCore/Modules/webgpu/WebGPUTexture.h (243088 => 243089)


--- trunk/Source/WebCore/Modules/webgpu/WebGPUTexture.h	2019-03-18 19:03:32 UTC (rev 243088)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPUTexture.h	2019-03-18 19:07:56 UTC (rev 243089)
@@ -41,7 +41,7 @@
 
     RefPtr<GPUTexture> texture() const { return m_texture; }
 
-    Ref<WebGPUTextureView> createDefaultTextureView();
+    Ref<WebGPUTextureView> createDefaultView();
     void destroy();
 
 private:

Modified: trunk/Source/WebCore/Modules/webgpu/WebGPUTexture.idl (243088 => 243089)


--- trunk/Source/WebCore/Modules/webgpu/WebGPUTexture.idl	2019-03-18 19:03:32 UTC (rev 243088)
+++ trunk/Source/WebCore/Modules/webgpu/WebGPUTexture.idl	2019-03-18 19:07:56 UTC (rev 243089)
@@ -29,7 +29,7 @@
     EnabledAtRuntime=WebGPU,
     ImplementationLacksVTable
 ] interface WebGPUTexture {
-    WebGPUTextureView createDefaultTextureView();
+    WebGPUTextureView createDefaultView();
     void destroy();
 
     // Not Yet Implemented:

Modified: trunk/Source/WebCore/platform/graphics/gpu/GPUProgrammablePassEncoder.h (243088 => 243089)


--- trunk/Source/WebCore/platform/graphics/gpu/GPUProgrammablePassEncoder.h	2019-03-18 19:03:32 UTC (rev 243088)
+++ trunk/Source/WebCore/platform/graphics/gpu/GPUProgrammablePassEncoder.h	2019-03-18 19:07:56 UTC (rev 243089)
@@ -50,7 +50,6 @@
 
     virtual void endPass();
     void setBindGroup(unsigned, GPUBindGroup&);
-    virtual void setPipeline(Ref<const GPURenderPipeline>&&) = 0;
 
 protected:
     GPUProgrammablePassEncoder(Ref<GPUCommandBuffer>&&);

Modified: trunk/Source/WebCore/platform/graphics/gpu/GPURenderPassEncoder.h (243088 => 243089)


--- trunk/Source/WebCore/platform/graphics/gpu/GPURenderPassEncoder.h	2019-03-18 19:03:32 UTC (rev 243088)
+++ trunk/Source/WebCore/platform/graphics/gpu/GPURenderPassEncoder.h	2019-03-18 19:07:56 UTC (rev 243089)
@@ -52,7 +52,7 @@
     static RefPtr<GPURenderPassEncoder> tryCreate(Ref<GPUCommandBuffer>&&, GPURenderPassDescriptor&&);
 
     void endPass() final;
-    void setPipeline(Ref<const GPURenderPipeline>&&) final;
+    void setPipeline(Ref<const GPURenderPipeline>&&);
 
     void setVertexBuffers(unsigned long, Vector<Ref<GPUBuffer>>&&, Vector<unsigned long long>&&);
     void draw(unsigned long vertexCount, unsigned long instanceCount, unsigned long firstVertex, unsigned long firstInstance);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to