WebKit Bugzilla
Attachment 359192 Details for
Bug 193457
: [WebGPU] WebGPUProgrammablePassEncoder::setBindGroup prototype
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193457-20190115125358.patch (text/plain), 31.21 KB, created by
Justin Fan
on 2019-01-15 12:53:59 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Justin Fan
Created:
2019-01-15 12:53:59 PST
Size:
31.21 KB
patch
obsolete
>Subversion Revision: 239994 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index b238b0b7ba2a9658391a6c1875f321b16764ebe7..09bc3f37180b82e482b88962600797b7fda6a3e6 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,40 @@ >+2019-01-15 Justin Fan <justin_fan@apple.com> >+ >+ [WebGPU] WebGPUProgrammablePassEncoder::setBindGroup prototype >+ https://bugs.webkit.org/show_bug.cgi?id=193457 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ No new tests (OOPS!). >+ >+ * Sources.txt: >+ * WebCore.xcodeproj/project.pbxproj: >+ * platform/graphics/gpu/GPUBindGroup.h: >+ (WebCore::GPUBindGroup::layout const): >+ (WebCore::GPUBindGroup::bindings const): >+ * platform/graphics/gpu/GPUBindGroupLayout.h: >+ (WebCore::GPUBindGroupLayout::argumentEncoders const): >+ * platform/graphics/gpu/GPUCommandBuffer.h: >+ (WebCore::GPUCommandBuffer::device const): >+ * platform/graphics/gpu/GPUProgrammablePassEncoder.cpp: Copied from Source/WebCore/platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm. >+ (WebCore::GPUProgrammablePassEncoder::GPUProgrammablePassEncoder): >+ * platform/graphics/gpu/GPUProgrammablePassEncoder.h: >+ (WebCore::GPUProgrammablePassEncoder::setVertexBuffer): >+ (WebCore::GPUProgrammablePassEncoder::setFragmentBuffer): >+ * platform/graphics/gpu/GPURenderPassEncoder.h: >+ * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm: >+ (WebCore::GPUCommandBuffer::create): >+ (WebCore::GPUCommandBuffer::GPUCommandBuffer): >+ * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm: >+ (WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder): >+ (WebCore::GPUProgrammablePassEncoder::setBindGroup): >+ * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm: >+ (WebCore::GPURenderPassEncoder::create): >+ (WebCore::GPURenderPassEncoder::GPURenderPassEncoder): >+ (WebCore::GPURenderPassEncoder::useResource): >+ (WebCore::GPURenderPassEncoder::setVertexBuffer): >+ (WebCore::GPURenderPassEncoder::setFragmentBuffer): >+ > 2019-01-15 Chris Dumez <cdumez@apple.com> > > Regression(PSON) View becomes blank after click a cross-site download link >diff --git a/Source/WebCore/Sources.txt b/Source/WebCore/Sources.txt >index 03a45de790af6593d4677b83edf8679081abe33c..ace9644596003fa38cbc07b71a5eb833c633d644 100644 >--- a/Source/WebCore/Sources.txt >+++ b/Source/WebCore/Sources.txt >@@ -1786,6 +1786,7 @@ platform/graphics/filters/SpotLightSource.cpp > platform/graphics/gpu/GPUBindGroup.cpp > platform/graphics/gpu/GPUDevice.cpp > platform/graphics/gpu/GPUPipelineLayout.cpp >+platform/graphics/gpu/GPUProgrammablePassEncoder.cpp > platform/graphics/gpu/legacy/GPULegacyBuffer.cpp > platform/graphics/gpu/legacy/GPULegacyCommandBuffer.cpp > platform/graphics/gpu/legacy/GPULegacyCommandQueue.cpp >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index b0ca5548c11da30ae3bd05e31659cc280c7332a8..bf847d1975ec3482ae98802b9939cfe2f01d1bd5 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -2586,9 +2586,9 @@ > 91278D5E21DEDAD600B57184 /* PageAuditAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 91278D5C21DEDAD500B57184 /* PageAuditAgent.h */; }; > 91278D6221DEDAF000B57184 /* WorkerAuditAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 91278D6021DEDAF000B57184 /* WorkerAuditAgent.h */; }; > 9175CE5C21E281ED00DF2C27 /* InspectorAuditDOMObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 9175CE5821E281EC00DF2C27 /* InspectorAuditDOMObject.h */; }; >- 9175CE5C21E281ED00DF2C28 /* JSInspectorAuditDOMObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 9175CE5821E281EC00DF2C28 /* InspectorAuditDOMObject.h */; }; >+ 9175CE5C21E281ED00DF2C28 /* InspectorAuditDOMObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 9175CE5821E281EC00DF2C28 /* InspectorAuditDOMObject.h */; }; > 9175CE5E21E281ED00DF2C27 /* InspectorAuditAccessibilityObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 9175CE5A21E281ED00DF2C27 /* InspectorAuditAccessibilityObject.h */; }; >- 9175CE5E21E281ED00DF2C28 /* JSInspectorAuditAccessibilityObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 9175CE5A21E281ED00DF2C28 /* InspectorAuditAccessibilityObject.h */; }; >+ 9175CE5E21E281ED00DF2C28 /* InspectorAuditAccessibilityObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 9175CE5A21E281ED00DF2C28 /* InspectorAuditAccessibilityObject.h */; }; > 91B8F0B521953D65000C2B00 /* CertificateInfoBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 91B8F0B321953D65000C2B00 /* CertificateInfoBase.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 91B952241F58A58F00931DC2 /* RecordingSwizzleTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 91B952221F58A58000931DC2 /* RecordingSwizzleTypes.h */; }; > 91C9F2F91AE3BEB00095B61C /* AXTextStateChangeIntent.h in Headers */ = {isa = PBXBuildFile; fileRef = 91C9F2F81AE3BE240095B61C /* AXTextStateChangeIntent.h */; settings = {ATTRIBUTES = (Private, ); }; }; >@@ -6420,13 +6420,13 @@ > 1C66260F1C6E7CA600AB527C /* FontFace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontFace.h; sourceTree = "<group>"; }; > 1C81B9560E97330800266E07 /* InspectorController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorController.h; sourceTree = "<group>"; }; > 1C81B9570E97330800266E07 /* InspectorController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorController.cpp; sourceTree = "<group>"; }; >+ 1C81B9580E97330800266E07 /* InspectorClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorClient.h; sourceTree = "<group>"; }; >+ 1C840B7D21EBE0B800D0500D /* WHLSLEntryPointType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WHLSLEntryPointType.h; sourceTree = "<group>"; }; >+ 1C840B9021EC30F900D0500D /* WHLSLAddressSpace.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WHLSLAddressSpace.h; sourceTree = "<group>"; }; > 1C840B9721EC400700D0500D /* WHLSLChecker.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WHLSLChecker.h; sourceTree = "<group>"; }; > 1C840B9921EC400800D0500D /* WHLSLGatherEntryPointItems.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WHLSLGatherEntryPointItems.cpp; sourceTree = "<group>"; }; > 1C840B9A21EC400900D0500D /* WHLSLGatherEntryPointItems.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WHLSLGatherEntryPointItems.h; sourceTree = "<group>"; }; > 1C840B9B21EC400900D0500D /* WHLSLChecker.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WHLSLChecker.cpp; sourceTree = "<group>"; }; >- 1C81B9580E97330800266E07 /* InspectorClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorClient.h; sourceTree = "<group>"; }; >- 1C840B7D21EBE0B800D0500D /* WHLSLEntryPointType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WHLSLEntryPointType.h; sourceTree = "<group>"; }; >- 1C840B9021EC30F900D0500D /* WHLSLAddressSpace.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WHLSLAddressSpace.h; sourceTree = "<group>"; }; > 1C904DF90BA9D2C80081E9D0 /* Version.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Version.xcconfig; sourceTree = "<group>"; }; > 1CA19E030DC255950065A994 /* EventLoopMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = EventLoopMac.mm; sourceTree = "<group>"; }; > 1CA19E150DC255CA0065A994 /* EventLoop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventLoop.h; sourceTree = "<group>"; }; >@@ -10394,13 +10394,13 @@ > 91278D5F21DEDAEF00B57184 /* WorkerAuditAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WorkerAuditAgent.cpp; sourceTree = "<group>"; }; > 91278D6021DEDAF000B57184 /* WorkerAuditAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WorkerAuditAgent.h; sourceTree = "<group>"; }; > 9175CE5721E281EB00DF2C27 /* InspectorAuditDOMObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorAuditDOMObject.cpp; sourceTree = "<group>"; }; >- 9175CE5721E281EB00DF2C28 /* JSInspectorAuditDOMObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorAuditDOMObject.cpp; sourceTree = "<group>"; }; >+ 9175CE5721E281EB00DF2C28 /* InspectorAuditDOMObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorAuditDOMObject.cpp; sourceTree = "<group>"; }; > 9175CE5821E281EC00DF2C27 /* InspectorAuditDOMObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorAuditDOMObject.h; sourceTree = "<group>"; }; >- 9175CE5821E281EC00DF2C28 /* JSInspectorAuditDOMObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorAuditDOMObject.h; sourceTree = "<group>"; }; >+ 9175CE5821E281EC00DF2C28 /* InspectorAuditDOMObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorAuditDOMObject.h; sourceTree = "<group>"; }; > 9175CE5921E281EC00DF2C27 /* InspectorAuditAccessibilityObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorAuditAccessibilityObject.cpp; sourceTree = "<group>"; }; >- 9175CE5921E281EC00DF2C28 /* JSInspectorAuditAccessibilityObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorAuditAccessibilityObject.cpp; sourceTree = "<group>"; }; >+ 9175CE5921E281EC00DF2C28 /* InspectorAuditAccessibilityObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorAuditAccessibilityObject.cpp; sourceTree = "<group>"; }; > 9175CE5A21E281ED00DF2C27 /* InspectorAuditAccessibilityObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorAuditAccessibilityObject.h; sourceTree = "<group>"; }; >- 9175CE5A21E281ED00DF2C28 /* JSInspectorAuditAccessibilityObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorAuditAccessibilityObject.h; sourceTree = "<group>"; }; >+ 9175CE5A21E281ED00DF2C28 /* InspectorAuditAccessibilityObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorAuditAccessibilityObject.h; sourceTree = "<group>"; }; > 91B8F0B321953D65000C2B00 /* CertificateInfoBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CertificateInfoBase.h; sourceTree = "<group>"; }; > 91B952221F58A58000931DC2 /* RecordingSwizzleTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RecordingSwizzleTypes.h; sourceTree = "<group>"; }; > 91C9F2F81AE3BE240095B61C /* AXTextStateChangeIntent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AXTextStateChangeIntent.h; sourceTree = "<group>"; }; >@@ -13899,6 +13899,7 @@ > D00F595421701D8C000D71DB /* WebGPUDevice.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGPUDevice.idl; sourceTree = "<group>"; }; > D01A27AB10C9BFD800026A42 /* SpaceSplitString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpaceSplitString.cpp; sourceTree = "<group>"; }; > D01A27AC10C9BFD800026A42 /* SpaceSplitString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpaceSplitString.h; sourceTree = "<group>"; }; >+ D01D0F9821EE77C70073D14D /* GPUProgrammablePassEncoder.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = GPUProgrammablePassEncoder.cpp; sourceTree = "<group>"; }; > D0232B5821CB49B7009483B9 /* GPUBindGroupLayoutMetal.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = GPUBindGroupLayoutMetal.mm; sourceTree = "<group>"; }; > D02454D021C4A41C00B73628 /* GPUBindGroupLayout.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUBindGroupLayout.h; sourceTree = "<group>"; }; > D02B83ED21C8397A00F85473 /* WebGPUBindGroupLayoutDescriptor.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGPUBindGroupLayoutDescriptor.idl; sourceTree = "<group>"; }; >@@ -16937,12 +16938,12 @@ > isa = PBXGroup; > children = ( > A584FE2518637DAB00843B10 /* CommandLineAPIModuleSource.h */, >+ 9175CE5921E281EC00DF2C28 /* InspectorAuditAccessibilityObject.cpp */, >+ 9175CE5A21E281ED00DF2C28 /* InspectorAuditAccessibilityObject.h */, >+ 9175CE5721E281EB00DF2C28 /* InspectorAuditDOMObject.cpp */, >+ 9175CE5821E281EC00DF2C28 /* InspectorAuditDOMObject.h */, > A584FE391864E2D800843B10 /* JSCommandLineAPIHost.cpp */, > A584FE3A1864E2D800843B10 /* JSCommandLineAPIHost.h */, >- 9175CE5921E281EC00DF2C28 /* JSInspectorAuditAccessibilityObject.cpp */, >- 9175CE5A21E281ED00DF2C28 /* JSInspectorAuditAccessibilityObject.h */, >- 9175CE5721E281EB00DF2C28 /* JSInspectorAuditDOMObject.cpp */, >- 9175CE5821E281EC00DF2C28 /* JSInspectorAuditDOMObject.h */, > 7A0E771C10C00DB100A0276E /* JSInspectorFrontendHost.cpp */, > 7A0E771D10C00DB100A0276E /* JSInspectorFrontendHost.h */, > ); >@@ -18269,6 +18270,7 @@ > D003288621C9A4E500622AA6 /* GPUPipelineLayout.h */, > D003288421C9A20D00622AA6 /* GPUPipelineLayoutDescriptor.h */, > 312FF8C221A4C2F300EB199D /* GPUPipelineStageDescriptor.h */, >+ D01D0F9821EE77C70073D14D /* GPUProgrammablePassEncoder.cpp */, > D03211CF21AC954E00763CF2 /* GPUProgrammablePassEncoder.h */, > 312FF8C121A4C2F200EB199D /* GPUQueue.h */, > D001D9A921B0C6730023B9BC /* GPURenderPassColorAttachmentDescriptor.h */, >@@ -29552,7 +29554,9 @@ > 93309DF2099E64920056E581 /* InsertTextCommand.h in Headers */, > A5B81CA71FAA44620037D1E6 /* InspectorApplicationCacheAgent.h in Headers */, > 9175CE5E21E281ED00DF2C27 /* InspectorAuditAccessibilityObject.h in Headers */, >+ 9175CE5E21E281ED00DF2C28 /* InspectorAuditAccessibilityObject.h in Headers */, > 9175CE5C21E281ED00DF2C27 /* InspectorAuditDOMObject.h in Headers */, >+ 9175CE5C21E281ED00DF2C28 /* InspectorAuditDOMObject.h in Headers */, > 6A22E8701F10418600F546C3 /* InspectorCanvas.h in Headers */, > A5B81CA81FAA44620037D1E6 /* InspectorCanvasAgent.h in Headers */, > 1C81B95C0E97330800266E07 /* InspectorClient.h in Headers */, >@@ -29985,8 +29989,6 @@ > A77979290D6B9E64003851B9 /* JSImageData.h in Headers */, > 7C193C011F5E11050088F3E6 /* JSImageSmoothingQuality.h in Headers */, > A86629D309DA2B48009633A6 /* JSInputEvent.h in Headers */, >- 9175CE5E21E281ED00DF2C28 /* JSInspectorAuditAccessibilityObject.h in Headers */, >- 9175CE5C21E281ED00DF2C28 /* JSInspectorAuditDOMObject.h in Headers */, > 7A0E771F10C00DB100A0276E /* JSInspectorFrontendHost.h in Headers */, > 0F4710E61DB700C7002DCEC3 /* JSIntersectionObserver.h in Headers */, > 0F8B45761DC41DBA00443C3F /* JSIntersectionObserverCallback.h in Headers */, >diff --git a/Source/WebCore/platform/graphics/gpu/GPUBindGroup.h b/Source/WebCore/platform/graphics/gpu/GPUBindGroup.h >index 806138367971de6bad5cb65af19f75510cc33092..2cdc073736011eaa02b0e6637ea2d4310c6e7324 100644 >--- a/Source/WebCore/platform/graphics/gpu/GPUBindGroup.h >+++ b/Source/WebCore/platform/graphics/gpu/GPUBindGroup.h >@@ -41,6 +41,9 @@ class GPUBindGroup : public RefCounted<GPUBindGroup> { > public: > static Ref<GPUBindGroup> create(GPUBindGroupDescriptor&&); > >+ const GPUBindGroupLayout& layout() const { return m_layout.get(); } >+ const Vector<GPUBindGroupBinding>& bindings() const { return m_bindings; } >+ > private: > explicit GPUBindGroup(GPUBindGroupDescriptor&&); > >diff --git a/Source/WebCore/platform/graphics/gpu/GPUBindGroupLayout.h b/Source/WebCore/platform/graphics/gpu/GPUBindGroupLayout.h >index f2ad89e70df0f31ed93e6684216501c671d37a3e..6244443b287c90fe8a9e12b8eee0e68ec75e6867 100644 >--- a/Source/WebCore/platform/graphics/gpu/GPUBindGroupLayout.h >+++ b/Source/WebCore/platform/graphics/gpu/GPUBindGroupLayout.h >@@ -52,6 +52,7 @@ public: > > using BindingsMapType = HashMap<unsigned long long, GPUBindGroupLayoutBinding, WTF::IntHash<unsigned long long>, WTF::UnsignedWithZeroKeyHashTraits<unsigned long long>>; > const BindingsMapType& bindingsMap() const { return m_bindingsMap; } >+ const ArgumentEncoders& argumentEncoders() const { return m_argumentEncoders; } > > private: > GPUBindGroupLayout(BindingsMapType&&, ArgumentEncoders&&); >diff --git a/Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.h b/Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.h >index 81e8e99e2806a2bd5d161d6704229ba35d125fbf..a6bf55478b87b733d18d162d96cadecc80e2c2c6 100644 >--- a/Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.h >+++ b/Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.h >@@ -27,6 +27,7 @@ > > #if ENABLE(WEBGPU) > >+#include "GPUDevice.h" > #include <wtf/RefCounted.h> > #include <wtf/RefPtr.h> > #include <wtf/RetainPtr.h> >@@ -35,21 +36,23 @@ OBJC_PROTOCOL(MTLCommandBuffer); > > namespace WebCore { > >-class GPUDevice; >+class GPUDevice; // FIXME: Why is ommitting this throwing "Unknown type name 'GPUDevice'" error despite #include "GPUDevice.h"? > > using PlatformCommandBuffer = MTLCommandBuffer; > using PlatformCommandBufferSmartPtr = RetainPtr<MTLCommandBuffer>; > > class GPUCommandBuffer : public RefCounted<GPUCommandBuffer> { > public: >- static RefPtr<GPUCommandBuffer> create(GPUDevice&); >+ static RefPtr<GPUCommandBuffer> create(Ref<GPUDevice>); > > PlatformCommandBuffer* platformCommandBuffer() const { return m_platformCommandBuffer.get(); } >+ Ref<GPUDevice> device() const { return m_device.copyRef(); } > > private: >- GPUCommandBuffer(PlatformCommandBufferSmartPtr&&); >+ GPUCommandBuffer(PlatformCommandBufferSmartPtr&&, Ref<GPUDevice>&&); > > PlatformCommandBufferSmartPtr m_platformCommandBuffer; >+ Ref<GPUDevice> m_device; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/platform/graphics/gpu/GPUProgrammablePassEncoder.cpp b/Source/WebCore/platform/graphics/gpu/GPUProgrammablePassEncoder.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..2cab177cac4efc45f1dc6ae45a943b4cdb658650 >--- /dev/null >+++ b/Source/WebCore/platform/graphics/gpu/GPUProgrammablePassEncoder.cpp >@@ -0,0 +1,40 @@ >+/* >+ * Copyright (C) 2019 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "GPUProgrammablePassEncoder.h" >+ >+#if ENABLE(WEBGPU) >+ >+namespace WebCore { >+ >+GPUProgrammablePassEncoder::GPUProgrammablePassEncoder(Ref<GPUDevice>&& device) >+ : m_device(WTFMove(device)) >+{ >+} >+ >+} // namespace WebCore >+ >+#endif // ENABLE(WEBGPU) >diff --git a/Source/WebCore/platform/graphics/gpu/GPUProgrammablePassEncoder.h b/Source/WebCore/platform/graphics/gpu/GPUProgrammablePassEncoder.h >index 948c0c886a93a958581590c9a52b544a4bd726e5..3dc78861743afa64fe408a0751fc9103a171cccf 100644 >--- a/Source/WebCore/platform/graphics/gpu/GPUProgrammablePassEncoder.h >+++ b/Source/WebCore/platform/graphics/gpu/GPUProgrammablePassEncoder.h >@@ -27,12 +27,18 @@ > > #if ENABLE(WEBGPU) > >+#include "GPUBindGroupBinding.h" >+#include "GPUDevice.h" > #include <wtf/RefCounted.h> > >+OBJC_PROTOCOL(MTLArgumentEncoder); >+OBJC_PROTOCOL(MTLBuffer); > OBJC_PROTOCOL(MTLCommandEncoder); >+OBJC_PROTOCOL(MTLResource); > > namespace WebCore { > >+class GPUBindGroup; > class GPURenderPipeline; > > using PlatformProgrammablePassEncoder = MTLCommandEncoder; >@@ -42,13 +48,22 @@ public: > virtual ~GPUProgrammablePassEncoder() = default; > > void endPass(); >- >+ void setBindGroup(const GPUBindGroup&, unsigned long); > virtual void setPipeline(Ref<GPURenderPipeline>&&) = 0; > > protected: >+ explicit GPUProgrammablePassEncoder(Ref<GPUDevice>&&); > virtual PlatformProgrammablePassEncoder* platformPassEncoder() const = 0; > > private: >+ void setResourceAsBufferOnEncoder(MTLArgumentEncoder *, const GPUBindingResource&, unsigned long, const char* const); >+ virtual void useResource(MTLResource *, unsigned long) = 0; >+ >+ // Render command encoder methods. >+ virtual void setVertexBuffer(MTLBuffer *, unsigned long, unsigned long) {} >+ virtual void setFragmentBuffer(MTLBuffer *, unsigned long, unsigned long) {} >+ >+ Ref<GPUDevice> m_device; > bool m_isEncoding { true }; > }; > >diff --git a/Source/WebCore/platform/graphics/gpu/GPURenderPassEncoder.h b/Source/WebCore/platform/graphics/gpu/GPURenderPassEncoder.h >index 501aa3d1521472911f2e008fdad26d8122612c12..042f7d098c81f2b9a610cb47cf405af7e4a9f24d 100644 >--- a/Source/WebCore/platform/graphics/gpu/GPURenderPassEncoder.h >+++ b/Source/WebCore/platform/graphics/gpu/GPURenderPassEncoder.h >@@ -41,6 +41,7 @@ namespace WebCore { > > class GPUBuffer; > class GPUCommandBuffer; >+class GPUDevice; > > struct GPURenderPassDescriptor; > >@@ -57,11 +58,16 @@ public: > void draw(unsigned long, unsigned long, unsigned long, unsigned long); > > private: >- GPURenderPassEncoder(PlatformRenderPassEncoderSmartPtr&&); >+ GPURenderPassEncoder(PlatformRenderPassEncoderSmartPtr&&, Ref<GPUDevice>&&); > ~GPURenderPassEncoder() { endPass(); } // Ensure that encoding has ended before release. > > PlatformProgrammablePassEncoder* platformPassEncoder() const final; > >+ // GPUProgrammablePassEncoder >+ void useResource(MTLResource *, unsigned long) final; >+ void setVertexBuffer(MTLBuffer *, unsigned long, unsigned long) final; >+ void setFragmentBuffer(MTLBuffer *, unsigned long, unsigned long) final; >+ > PlatformRenderPassEncoderSmartPtr m_platformRenderPassEncoder; > RefPtr<GPURenderPipeline> m_pipeline; > }; >diff --git a/Source/WebCore/platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm b/Source/WebCore/platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm >index 61259d234fb3a124f991784a5d8fd6887037e208..c69f27700e04fe54febcf02d3b0cfce817dd4242 100644 >--- a/Source/WebCore/platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm >+++ b/Source/WebCore/platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm >@@ -37,14 +37,14 @@ > > namespace WebCore { > >-RefPtr<GPUCommandBuffer> GPUCommandBuffer::create(GPUDevice& device) >+RefPtr<GPUCommandBuffer> GPUCommandBuffer::create(Ref<GPUDevice> device) > { >- if (!device.platformDevice()) { >+ if (!device->platformDevice()) { > LOG(WebGPU, "GPUCommandBuffer::create(): Invalid GPUDevice!"); > return nullptr; > } > >- auto gpuCommandQueue = device.getQueue(); >+ auto gpuCommandQueue = device->getQueue(); > if (!gpuCommandQueue) > return nullptr; > >@@ -63,11 +63,12 @@ RefPtr<GPUCommandBuffer> GPUCommandBuffer::create(GPUDevice& device) > return nullptr; > } > >- return adoptRef(new GPUCommandBuffer(WTFMove(buffer))); >+ return adoptRef(new GPUCommandBuffer(WTFMove(buffer), WTFMove(device))); > } > >-GPUCommandBuffer::GPUCommandBuffer(PlatformCommandBufferSmartPtr&& buffer) >+GPUCommandBuffer::GPUCommandBuffer(PlatformCommandBufferSmartPtr&& buffer, Ref<GPUDevice>&& device) > : m_platformCommandBuffer(WTFMove(buffer)) >+ , m_device(WTFMove(device)) > { > UNUSED_PARAM(m_platformCommandBuffer); > } >diff --git a/Source/WebCore/platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm b/Source/WebCore/platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm >index 2e643638146a1b89ca7f8c9686653d2725d3418e..d51c53180fd402d34711a8f8b405ea38c1f369aa 100644 >--- a/Source/WebCore/platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm >+++ b/Source/WebCore/platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm >@@ -28,7 +28,11 @@ > > #if ENABLE(WEBGPU) > >+#import "GPUBindGroup.h" >+#import "GPUBindGroupLayoutBinding.h" >+#import "Logging.h" > #import <Metal/Metal.h> >+#import <wtf/BlockObjCExceptions.h> > > namespace WebCore { > >@@ -41,6 +45,93 @@ void GPUProgrammablePassEncoder::endPass() > m_isEncoding = false; > } > >+void GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder(MTLArgumentEncoder *argumentEncoder, const GPUBindingResource& resource, unsigned long index, const char* const functionName) >+{ >+ if (!argumentEncoder) { >+ LOG(WebGPU, "%s: No argument encoder for requested stage found!", functionName); >+ return; >+ } >+ >+ if (!WTF::holds_alternative<GPUBufferBinding>(resource)) { >+ LOG(WebGPU, "%s: Resource is not a buffer type!", functionName); >+ return; >+ } >+ >+ auto& bufferBinding = WTF::get<GPUBufferBinding>(resource); >+ auto buffer = bufferBinding.buffer->platformBuffer(); >+ >+ if (!buffer) { >+ LOG(WebGPU, "%s: Invalid MTLBuffer in GPUBufferBinding!", functionName); >+ return; >+ } >+ >+ BEGIN_BLOCK_OBJC_EXCEPTIONS; >+ >+ [argumentEncoder setBuffer:buffer offset:bufferBinding.offset atIndex:index]; >+ useResource(buffer, MTLResourceUsageRead); >+ >+ END_BLOCK_OBJC_EXCEPTIONS; >+} >+ >+void GPUProgrammablePassEncoder::setBindGroup(const GPUBindGroup& bindGroup, unsigned long index) >+{ >+ const char* const functionName = "GPUProgrammablePassEncoder::setBindGroup()"; >+ // Create argument buffers for each MTLArgumentEncoder in the pipeline layout. >+ if (!m_device->platformDevice()) { >+ LOG(WebGPU, "%s: Invalid MTLDevice!", functionName); >+ return; >+ } >+ >+ const auto& encoders = bindGroup.layout().argumentEncoders(); >+ RetainPtr<MTLBuffer> vertexArgumentBuffer, fragmentArgumentBuffer, computeArgumentBuffer; >+ >+ BEGIN_BLOCK_OBJC_EXCEPTIONS; >+ >+ if (encoders.vertex) { >+ vertexArgumentBuffer = adoptNS([m_device->platformDevice() newBufferWithLength:encoders.vertex.get().encodedLength options:0]); >+ [encoders.vertex setArgumentBuffer:vertexArgumentBuffer.get() offset:0]; >+ setVertexBuffer(vertexArgumentBuffer.get(), 0, index); >+ } >+ if (encoders.fragment) { >+ fragmentArgumentBuffer = adoptNS([m_device->platformDevice() newBufferWithLength:encoders.fragment.get().encodedLength options:0]); >+ [encoders.fragment setArgumentBuffer:fragmentArgumentBuffer.get() offset:0]; >+ setFragmentBuffer(fragmentArgumentBuffer.get(), 0, index); >+ } >+ if (encoders.compute) { >+ computeArgumentBuffer = adoptNS([m_device->platformDevice() newBufferWithLength:encoders.compute.get().encodedLength options:0]); >+ [encoders.compute setArgumentBuffer:computeArgumentBuffer.get() offset:0]; >+ // FIXME: Finish support for compute. >+ } >+ >+ END_BLOCK_OBJC_EXCEPTIONS; >+ >+ // Set each resource on each MTLArgumentEncoder it should be visible on. >+ const auto& bindingsMap = bindGroup.layout().bindingsMap(); >+ for (const auto& binding : bindGroup.bindings()) { >+ auto iterator = bindingsMap.find(binding.binding); >+ if (iterator == bindingsMap.end()) { >+ LOG(WebGPU, "%s: GPUBindGroupBinding %lu not found in GPUBindGroupLayout!", functionName, binding.binding); >+ return; >+ } >+ auto bindGroupLayoutBinding = iterator->value; >+ >+ switch (bindGroupLayoutBinding.type) { >+ // FIXME: Support more resource types, and support compute stage resources. >+ case GPUBindGroupLayoutBinding::BindingType::UniformBuffer: >+ case GPUBindGroupLayoutBinding::BindingType::StorageBuffer: { >+ if (bindGroupLayoutBinding.visibility & GPUShaderStageBit::VERTEX) >+ setResourceAsBufferOnEncoder(encoders.vertex.get(), binding.resource, binding.binding, functionName); >+ if (bindGroupLayoutBinding.visibility & GPUShaderStageBit::FRAGMENT) >+ setResourceAsBufferOnEncoder(encoders.fragment.get(), binding.resource, binding.binding, functionName); >+ break; >+ } >+ default: >+ LOG(WebGPU, "%s: Resource type not yet implemented.", functionName); >+ return; >+ } >+ } >+} >+ > } // namespace WebCore > > #endif // ENABLE(WEBGPU) >diff --git a/Source/WebCore/platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm b/Source/WebCore/platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm >index 5565063f6400b403854353daac67e35051401473..f73a95381b184514f7a0157a5db83fab8ff28e73 100644 >--- a/Source/WebCore/platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm >+++ b/Source/WebCore/platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm >@@ -30,6 +30,7 @@ > > #import "GPUBuffer.h" > #import "GPUCommandBuffer.h" >+#import "GPUDevice.h" > #import "GPURenderPassDescriptor.h" > #import "GPURenderPipeline.h" > #import "Logging.h" >@@ -65,11 +66,12 @@ RefPtr<GPURenderPassEncoder> GPURenderPassEncoder::create(const GPUCommandBuffer > return nullptr; > } > >- return adoptRef(new GPURenderPassEncoder(WTFMove(mtlEncoder))); >+ return adoptRef(new GPURenderPassEncoder(WTFMove(mtlEncoder), buffer.device())); > } > >-GPURenderPassEncoder::GPURenderPassEncoder(PlatformRenderPassEncoderSmartPtr&& encoder) >- : m_platformRenderPassEncoder(WTFMove(encoder)) >+GPURenderPassEncoder::GPURenderPassEncoder(PlatformRenderPassEncoderSmartPtr&& encoder, Ref<GPUDevice>&& device) >+ : GPUProgrammablePassEncoder(WTFMove(device)) >+ , m_platformRenderPassEncoder(WTFMove(encoder)) > { > } > >@@ -118,6 +120,21 @@ void GPURenderPassEncoder::draw(unsigned long vertexCount, unsigned long instanc > baseInstance:firstInstance]; > } > >+void GPURenderPassEncoder::useResource(MTLResource *resource, MTLResourceUsage usage) >+{ >+ [m_platformRenderPassEncoder useResource:resource usage:usage]; >+} >+ >+void GPURenderPassEncoder::setVertexBuffer(MTLBuffer *buffer, unsigned long offset, unsigned long index) >+{ >+ [m_platformRenderPassEncoder setVertexBuffer:buffer offset:offset atIndex:index]; >+} >+ >+void GPURenderPassEncoder::setFragmentBuffer(MTLBuffer *buffer, unsigned long offset, unsigned long index) >+{ >+ [m_platformRenderPassEncoder setFragmentBuffer:buffer offset:offset atIndex:index]; >+} >+ > } // namespace WebCore > > #endif // ENABLE(WEBGPU)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193457
:
359192
|
359337
|
359350
|
359503
|
359508
|
359510
|
359523
|
359541