Changeset 247442 in webkit
- Timestamp:
- Jul 15, 2019, 1:35:47 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 17 deleted
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r247441 r247442 1 2019-07-15 Ryan Haddad <ryanhaddad@apple.com> 2 3 Unreviewed, rolling out r247397, r247378, r247366. 4 5 Broke watchOS builds. 6 7 Reverted changesets: 8 9 "[WebGPU] Implement GPUError and error scopes" 10 https://bugs.webkit.org/show_bug.cgi?id=199655 11 https://trac.webkit.org/changeset/247366/webkit 12 13 "[WebGPU] Move error scopes out of GPUDevice for more portable error generation" 14 https://bugs.webkit.org/show_bug.cgi?id=199740 15 https://trac.webkit.org/changeset/247397/webkit 16 1 17 2019-07-15 Rob Buis <rbuis@igalia.com> 2 18 -
trunk/Source/WebCore/CMakeLists.txt
r247366 r247442 481 481 Modules/webgpu/GPUCompareFunction.idl 482 482 Modules/webgpu/GPUDepthStencilStateDescriptor.idl 483 Modules/webgpu/GPUErrorFilter.idl484 483 Modules/webgpu/GPUExtent3D.idl 485 484 Modules/webgpu/GPULoadOp.idl 486 485 Modules/webgpu/GPUOrigin3D.idl 487 Modules/webgpu/GPUOutOfMemoryError.idl488 486 Modules/webgpu/GPURequestAdapterOptions.idl 489 487 Modules/webgpu/GPUSamplerDescriptor.idl … … 493 491 Modules/webgpu/GPUTextureFormat.idl 494 492 Modules/webgpu/GPUTextureUsage.idl 495 Modules/webgpu/GPUValidationError.idl496 493 Modules/webgpu/GPUVertexAttributeDescriptor.idl 497 494 Modules/webgpu/GPUVertexBufferDescriptor.idl … … 512 509 Modules/webgpu/WebGPUComputePipelineDescriptor.idl 513 510 Modules/webgpu/WebGPUDevice.idl 514 Modules/webgpu/WebGPUDeviceErrorScopes.idl515 511 Modules/webgpu/WebGPUPipelineDescriptorBase.idl 516 512 Modules/webgpu/WebGPUPipelineLayout.idl -
trunk/Source/WebCore/ChangeLog
r247441 r247442 1 2019-07-15 Ryan Haddad <ryanhaddad@apple.com> 2 3 Unreviewed, rolling out r247397, r247378, r247366. 4 5 Broke watchOS builds. 6 7 Reverted changesets: 8 9 "[WebGPU] Implement GPUError and error scopes" 10 https://bugs.webkit.org/show_bug.cgi?id=199655 11 https://trac.webkit.org/changeset/247366/webkit 12 13 "[WebGPU] Move error scopes out of GPUDevice for more portable error generation" 14 https://bugs.webkit.org/show_bug.cgi?id=199740 15 https://trac.webkit.org/changeset/247397/webkit 16 1 17 2019-07-15 Rob Buis <rbuis@igalia.com> 2 18 -
trunk/Source/WebCore/DerivedSources-input.xcfilelist
r247366 r247442 331 331 $(PROJECT_DIR)/Modules/webgpu/GPUCompareFunction.idl 332 332 $(PROJECT_DIR)/Modules/webgpu/GPUDepthStencilStateDescriptor.idl 333 $(PROJECT_DIR)/Modules/webgpu/GPUErrorFilter.idl334 333 $(PROJECT_DIR)/Modules/webgpu/GPUExtent3D.idl 335 334 $(PROJECT_DIR)/Modules/webgpu/GPUInputStateDescriptor.idl 336 335 $(PROJECT_DIR)/Modules/webgpu/GPULoadOp.idl 337 336 $(PROJECT_DIR)/Modules/webgpu/GPUOrigin3D.idl 338 $(PROJECT_DIR)/Modules/webgpu/GPUOutOfMemoryError.idl339 337 $(PROJECT_DIR)/Modules/webgpu/GPURequestAdapterOptions.idl 340 338 $(PROJECT_DIR)/Modules/webgpu/GPUSamplerDescriptor.idl … … 344 342 $(PROJECT_DIR)/Modules/webgpu/GPUTextureFormat.idl 345 343 $(PROJECT_DIR)/Modules/webgpu/GPUTextureUsage.idl 346 $(PROJECT_DIR)/Modules/webgpu/GPUValidationError.idl347 344 $(PROJECT_DIR)/Modules/webgpu/GPUVertexAttributeDescriptor.idl 348 345 $(PROJECT_DIR)/Modules/webgpu/GPUVertexBufferDescriptor.idl … … 365 362 $(PROJECT_DIR)/Modules/webgpu/WebGPUComputePipelineDescriptor.idl 366 363 $(PROJECT_DIR)/Modules/webgpu/WebGPUDevice.idl 367 $(PROJECT_DIR)/Modules/webgpu/WebGPUDeviceErrorScopes.idl368 364 $(PROJECT_DIR)/Modules/webgpu/WebGPUPipelineDescriptorBase.idl 369 365 $(PROJECT_DIR)/Modules/webgpu/WebGPUPipelineLayout.idl -
trunk/Source/WebCore/DerivedSources-output.xcfilelist
r247366 r247442 610 610 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUDepthStencilStateDescriptor.cpp 611 611 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUDepthStencilStateDescriptor.h 612 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUErrorFilter.cpp613 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUErrorFilter.h614 612 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUExtent3D.cpp 615 613 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUExtent3D.h … … 620 618 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUOrigin3D.cpp 621 619 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUOrigin3D.h 622 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUOutOfMemoryError.cpp623 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUOutOfMemoryError.h624 620 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPURequestAdapterOptions.cpp 625 621 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPURequestAdapterOptions.h … … 636 632 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUTextureUsage.cpp 637 633 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUTextureUsage.h 638 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUValidationError.cpp639 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUValidationError.h640 634 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUVertexAttributeDescriptor.cpp 641 635 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUVertexAttributeDescriptor.h … … 1950 1944 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWebGPUDevice.cpp 1951 1945 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWebGPUDevice.h 1952 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWebGPUDeviceErrorScopes.cpp1953 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWebGPUDeviceErrorScopes.h1954 1946 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWebGPUPipelineDescriptorBase.cpp 1955 1947 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWebGPUPipelineDescriptorBase.h -
trunk/Source/WebCore/DerivedSources.make
r247366 r247442 387 387 $(WebCore)/Modules/webgpu/GPUCompareFunction.idl \ 388 388 $(WebCore)/Modules/webgpu/GPUDepthStencilStateDescriptor.idl \ 389 $(WebCore)/Modules/webgpu/GPUErrorFilter.idl \390 389 $(WebCore)/Modules/webgpu/GPUExtent3D.idl \ 391 390 $(WebCore)/Modules/webgpu/GPULoadOp.idl \ 392 391 $(WebCore)/Modules/webgpu/GPUOrigin3D.idl \ 393 $(WebCore)/Modules/webgpu/GPUOutOfMemoryError.idl \394 392 $(WebCore)/Modules/webgpu/GPURequestAdapterOptions.idl \ 395 393 $(WebCore)/Modules/webgpu/GPUSamplerDescriptor.idl \ … … 399 397 $(WebCore)/Modules/webgpu/GPUTextureFormat.idl \ 400 398 $(WebCore)/Modules/webgpu/GPUTextureUsage.idl \ 401 $(WebCore)/Modules/webgpu/GPUValidationError.idl \402 399 $(WebCore)/Modules/webgpu/GPUVertexAttributeDescriptor.idl \ 403 400 $(WebCore)/Modules/webgpu/GPUVertexBufferDescriptor.idl \ … … 418 415 $(WebCore)/Modules/webgpu/WebGPUComputePipelineDescriptor.idl \ 419 416 $(WebCore)/Modules/webgpu/WebGPUDevice.idl \ 420 $(WebCore)/Modules/webgpu/WebGPUDeviceErrorScopes.idl \421 417 $(WebCore)/Modules/webgpu/WebGPUQueue.idl \ 422 418 $(WebCore)/Modules/webgpu/WebGPUPipelineDescriptorBase.idl \ -
trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.cpp
r247366 r247442 27 27 #include "WHLSLCheckTextureReferences.h" 28 28 29 #include "WHLSLInferTypes.h" 30 29 31 #if ENABLE(WEBGPU) 30 31 #include "WHLSLArrayReferenceType.h"32 #include "WHLSLArrayType.h"33 #include "WHLSLInferTypes.h"34 #include "WHLSLNativeTypeDeclaration.h"35 #include "WHLSLPointerType.h"36 #include "WHLSLVisitor.h"37 32 38 33 namespace WebCore { -
trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp
r247378 r247442 31 31 #include "WHLSLCallExpression.h" 32 32 #include "WHLSLFunctionDefinition.h" 33 #include "WHLSLProgram.h"34 33 #include "WHLSLVisitor.h" 35 34 #include <wtf/HashSet.h> -
trunk/Source/WebCore/Modules/webgpu/WebGPUDevice.cpp
r247397 r247442 29 29 #if ENABLE(WEBGPU) 30 30 31 #include "Exception.h"32 31 #include "GPUBindGroup.h" 33 32 #include "GPUBindGroupBinding.h" … … 44 43 #include "GPUTextureDescriptor.h" 45 44 #include "JSDOMConvertBufferSource.h" 46 #include "JSGPUOutOfMemoryError.h"47 #include "JSGPUValidationError.h"48 45 #include "JSWebGPUBuffer.h" 49 46 #include "Logging.h" … … 67 64 #include "WebGPUSwapChain.h" 68 65 #include "WebGPUTexture.h" 69 #include <wtf/Optional.h>70 #include <wtf/text/WTFString.h>71 66 72 67 namespace WebCore { … … 82 77 : m_adapter(WTFMove(adapter)) 83 78 , m_device(WTFMove(device)) 84 , m_errorScopes(GPUErrorScopes::create())85 79 { 86 80 } … … 88 82 Ref<WebGPUBuffer> WebGPUDevice::createBuffer(const GPUBufferDescriptor& descriptor) const 89 83 { 90 auto buffer = m_device->tryCreateBuffer(descriptor , GPUBufferMappedOption::NotMapped, m_errorScopes.copyRef());84 auto buffer = m_device->tryCreateBuffer(descriptor); 91 85 return WebGPUBuffer::create(WTFMove(buffer)); 92 86 } … … 96 90 JSC::JSValue wrappedArrayBuffer = JSC::jsNull(); 97 91 98 auto buffer = m_device->tryCreateBuffer(descriptor, GPUBufferMappedOption::IsMapped, m_errorScopes.copyRef());92 auto buffer = m_device->tryCreateBuffer(descriptor, true); 99 93 if (buffer) { 100 94 auto arrayBuffer = buffer->mapOnCreation(); … … 187 181 } 188 182 189 void WebGPUDevice::popErrorScope(ErrorPromise&& promise)190 {191 String failMessage;192 Optional<GPUError> error = m_errorScopes->popErrorScope(failMessage);193 if (failMessage.isEmpty())194 promise.resolve(error);195 else196 promise.reject(Exception { OperationError, "GPUDevice::popErrorScope(): " + failMessage });197 }198 199 183 } // namespace WebCore 200 184 -
trunk/Source/WebCore/Modules/webgpu/WebGPUDevice.h
r247397 r247442 29 29 30 30 #include "GPUDevice.h" 31 #include "GPUErrorScopes.h"32 #include "JSDOMPromiseDeferred.h"33 31 #include "WebGPUAdapter.h" 34 32 #include "WebGPUQueue.h" … … 46 44 namespace WebCore { 47 45 48 class GPUOutOfMemoryError;49 class GPUValidationError;50 46 class ScriptExecutionContext; 51 47 class WebGPUBindGroup; … … 70 66 struct WebGPURenderPipelineDescriptor; 71 67 struct WebGPUShaderModuleDescriptor; 72 73 enum class GPUErrorFilter;74 75 using ErrorIDLUnion = IDLUnion<IDLInterface<GPUOutOfMemoryError>, IDLInterface<GPUValidationError>>;76 using ErrorPromise = DOMPromiseDeferred<IDLNullable<ErrorIDLUnion>>;77 68 78 69 class WebGPUDevice : public RefCounted<WebGPUDevice> { … … 101 92 Ref<WebGPUQueue> getQueue() const; 102 93 103 void pushErrorScope(GPUErrorFilter filter) { m_errorScopes->pushErrorScope(filter); }104 void popErrorScope(ErrorPromise&&);105 106 94 private: 107 95 WebGPUDevice(Ref<const WebGPUAdapter>&&, Ref<GPUDevice>&&); … … 110 98 Ref<GPUDevice> m_device; 111 99 mutable RefPtr<WebGPUQueue> m_queue; 112 113 Ref<GPUErrorScopes> m_errorScopes;114 100 }; 115 101 -
trunk/Source/WebCore/Sources.txt
r247397 r247442 368 368 Modules/webgpu/WebGPUComputePipelineDescriptor.cpp 369 369 Modules/webgpu/WebGPUDevice.cpp 370 Modules/webgpu/WebGPUDeviceErrorScopes.cpp371 370 Modules/webgpu/WebGPUQueue.cpp 372 371 Modules/webgpu/WebGPUPipelineLayout.cpp … … 1829 1828 1830 1829 platform/graphics/gpu/GPUDevice.cpp 1831 platform/graphics/gpu/GPUError.cpp1832 platform/graphics/gpu/GPUErrorScopes.cpp1833 platform/graphics/gpu/GPUValidationError.cpp1834 1830 platform/graphics/gpu/GPUPipelineLayout.cpp 1835 1831 platform/graphics/gpu/GPUProgrammablePassEncoder.cpp … … 2761 2757 JSGPUCompareFunction.cpp 2762 2758 JSGPUDepthStencilStateDescriptor.cpp 2763 JSGPUErrorFilter.cpp2764 2759 JSGPUExtent3D.cpp 2765 2760 JSGPULoadOp.cpp 2766 2761 JSGPUOrigin3D.cpp 2767 JSGPUOutOfMemoryError.cpp2768 2762 JSGPURequestAdapterOptions.cpp 2769 2763 JSGPUSamplerDescriptor.cpp … … 2773 2767 JSGPUTextureFormat.cpp 2774 2768 JSGPUTextureUsage.cpp 2775 JSGPUValidationError.cpp2776 2769 JSGPUVertexAttributeDescriptor.cpp 2777 2770 JSGPUVertexBufferDescriptor.cpp … … 3326 3319 JSWebGPUComputePipelineDescriptor.cpp 3327 3320 JSWebGPUDevice.cpp 3328 JSWebGPUDeviceErrorScopes.cpp3329 3321 JSWebGPUQueue.cpp 3330 3322 JSWebGPUPipelineDescriptorBase.cpp -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r247397 r247442 13955 13955 D03211CF21AC954E00763CF2 /* GPUProgrammablePassEncoder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUProgrammablePassEncoder.h; sourceTree = "<group>"; }; 13956 13956 D03211D021AC954F00763CF2 /* GPURenderPassDescriptor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPURenderPassDescriptor.h; sourceTree = "<group>"; }; 13957 D03586B122D7F2EA00DA0284 /* GPUErrorScopes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUErrorScopes.h; sourceTree = "<group>"; };13958 D03586B222D7F2EA00DA0284 /* GPUErrorScopes.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = GPUErrorScopes.cpp; sourceTree = "<group>"; };13959 13957 D036DD8D208FFC0C00F9F4B2 /* WebGLCompressedTextureASTC.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGLCompressedTextureASTC.idl; sourceTree = "<group>"; }; 13960 13958 D03C849A21FFC6670002227F /* GPUDepthStencilStateDescriptor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUDepthStencilStateDescriptor.h; sourceTree = "<group>"; }; … … 14021 14019 D093D227217951D400329217 /* GPUCanvasContext.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = GPUCanvasContext.idl; sourceTree = "<group>"; }; 14022 14020 D093D2292179541600329217 /* GPUCanvasContext.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = GPUCanvasContext.cpp; sourceTree = "<group>"; }; 14023 D09AFAFF22D02E5300C4538C /* WebGPUDeviceErrorScopes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebGPUDeviceErrorScopes.h; sourceTree = "<group>"; };14024 D09AFB0122D02E5300C4538C /* WebGPUDeviceErrorScopes.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebGPUDeviceErrorScopes.cpp; sourceTree = "<group>"; };14025 D09AFB0222D0471900C4538C /* GPUErrorFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUErrorFilter.h; sourceTree = "<group>"; };14026 D09AFB0322D40CC500C4538C /* WebGPUDeviceErrorScopes.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGPUDeviceErrorScopes.idl; sourceTree = "<group>"; };14027 D09AFB0622D417B300C4538C /* GPUErrorFilter.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = GPUErrorFilter.idl; sourceTree = "<group>"; };14028 D09AFB0722D5391B00C4538C /* GPUError.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUError.h; sourceTree = "<group>"; };14029 D09AFB0822D5542800C4538C /* GPUError.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = GPUError.cpp; sourceTree = "<group>"; };14030 D09AFB0C22D55E9000C4538C /* GPUValidationError.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = GPUValidationError.idl; sourceTree = "<group>"; };14031 D09AFB0D22D55F3B00C4538C /* GPUValidationError.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUValidationError.h; sourceTree = "<group>"; };14032 D09AFB0E22D55FF500C4538C /* GPUValidationError.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = GPUValidationError.cpp; sourceTree = "<group>"; };14033 D09AFB1722D6694E00C4538C /* GPUOutOfMemoryError.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = GPUOutOfMemoryError.idl; sourceTree = "<group>"; };14034 D09AFB1922D6698A00C4538C /* GPUOutOfMemoryError.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUOutOfMemoryError.h; sourceTree = "<group>"; };14035 D09AFB2D22D6C01400C4538C /* GPUError.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = GPUError.cpp; sourceTree = "<group>"; };14036 D09AFB3722D7D5C600C4538C /* GPUObjectBase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUObjectBase.h; sourceTree = "<group>"; };14037 14021 D0A20D542092A0A600E0C259 /* WebGLCompressedTextureASTC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebGLCompressedTextureASTC.h; sourceTree = "<group>"; }; 14038 14022 D0A20D562092A0A600E0C259 /* WebGLCompressedTextureASTC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebGLCompressedTextureASTC.cpp; sourceTree = "<group>"; }; … … 18337 18321 312FF8BF21A4C2F100EB199D /* GPUDevice.cpp */, 18338 18322 312FF8BE21A4C2F100EB199D /* GPUDevice.h */, 18339 D09AFB0822D5542800C4538C /* GPUError.cpp */,18340 D09AFB2D22D6C01400C4538C /* GPUError.cpp */,18341 D09AFB0722D5391B00C4538C /* GPUError.h */,18342 D09AFB0222D0471900C4538C /* GPUErrorFilter.h */,18343 D03586B222D7F2EA00DA0284 /* GPUErrorScopes.cpp */,18344 D03586B122D7F2EA00DA0284 /* GPUErrorScopes.h */,18345 18323 D026F47D220A2AC600AC5F49 /* GPUExtent3D.h */, 18346 18324 D0F7559F2203BA1400118058 /* GPULimits.h */, 18347 18325 D08AA02F220D0BD50058C502 /* GPULoadOp.h */, 18348 D09AFB3722D7D5C600C4538C /* GPUObjectBase.h */,18349 D09AFB1922D6698A00C4538C /* GPUOutOfMemoryError.h */,18350 18326 312FF8C421A4C2F400EB199D /* GPUPipelineDescriptorBase.h */, 18351 18327 D003288721C9A4E500622AA6 /* GPUPipelineLayout.cpp */, … … 18373 18349 D026F485220A477200AC5F49 /* GPUTextureUsage.h */, 18374 18350 D06EF552220BA26A0018724E /* GPUUtils.h */, 18375 D09AFB0E22D55FF500C4538C /* GPUValidationError.cpp */,18376 D09AFB0D22D55F3B00C4538C /* GPUValidationError.h */,18377 18351 D0D8649B21BA1C2D003C983C /* GPUVertexAttributeDescriptor.h */, 18378 18352 D0D8649C21BA1CE8003C983C /* GPUVertexBufferDescriptor.h */, … … 25964 25938 D03C849E21FFCF000002227F /* GPUCompareFunction.idl */, 25965 25939 D03C84A221FFD7230002227F /* GPUDepthStencilStateDescriptor.idl */, 25966 D09AFB0622D417B300C4538C /* GPUErrorFilter.idl */,25967 25940 D026F480220A2B7000AC5F49 /* GPUExtent3D.idl */, 25968 25941 D08AA02D220D0B9C0058C502 /* GPULoadOp.idl */, 25969 25942 D0CCA94922299F97006979B6 /* GPUOrigin3D.h */, 25970 25943 D0CCA94A22299F97006979B6 /* GPUOrigin3D.idl */, 25971 D09AFB1722D6694E00C4538C /* GPUOutOfMemoryError.idl */,25972 25944 D02C26922181416D00D818E4 /* GPURequestAdapterOptions.idl */, 25973 25945 D0ADB26322309D7600A22935 /* GPUSamplerDescriptor.idl */, … … 25978 25950 D0EACFAE219E30FD000FA75C /* GPUTextureFormat.idl */, 25979 25951 D026F483220A472F00AC5F49 /* GPUTextureUsage.idl */, 25980 D09AFB0C22D55E9000C4538C /* GPUValidationError.idl */,25981 25952 D0D8649621BA18F4003C983C /* GPUVertexAttributeDescriptor.idl */, 25982 25953 D0D8649821BA19A7003C983C /* GPUVertexBufferDescriptor.idl */, … … 26025 25996 D00F595221701D8C000D71DB /* WebGPUDevice.h */, 26026 25997 D00F595421701D8C000D71DB /* WebGPUDevice.idl */, 26027 D09AFB0122D02E5300C4538C /* WebGPUDeviceErrorScopes.cpp */,26028 D09AFAFF22D02E5300C4538C /* WebGPUDeviceErrorScopes.h */,26029 D09AFB0322D40CC500C4538C /* WebGPUDeviceErrorScopes.idl */,26030 25998 D0C419F02183EB31009EC1DE /* WebGPUPipelineDescriptorBase.h */, 26031 25999 D0C419F12183EB31009EC1DE /* WebGPUPipelineDescriptorBase.idl */, … … 28433 28401 7C1843FE1C8B7283002EB973 /* Autofill.h in Headers */, 28434 28402 7C1E97281A9F9834007BF0FB /* AutoFillButtonElement.h in Headers */, 28435 5CCC270922D5483A00964FA0 /* AutofillElements.h in Headers */,28436 28403 C9D467051E60C465008195FB /* AutoplayEvent.h in Headers */, 28437 28404 45830D4E1679B4F800ACF8C3 /* AutoscrollController.h in Headers */, … … 30078 30045 A77979290D6B9E64003851B9 /* JSImageData.h in Headers */, 30079 30046 7C193C011F5E11050088F3E6 /* JSImageSmoothingQuality.h in Headers */, 30047 5CCC270922D5483A00964FA0 /* AutofillElements.h in Headers */, 30080 30048 A86629D309DA2B48009633A6 /* JSInputEvent.h in Headers */, 30081 30049 9175CE5E21E281ED00DF2C28 /* JSInspectorAuditAccessibilityObject.h in Headers */, -
trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h
r247366 r247442 95 95 macro(GPUComputePipeline) \ 96 96 macro(GPUDevice) \ 97 macro(GPUOutOfMemoryError) \98 97 macro(GPUPipelineLayout) \ 99 98 macro(GPUProgrammablePassEncoder) \ … … 108 107 macro(GPUTextureUsage) \ 109 108 macro(GPUTextureView) \ 110 macro(GPUValidationError) \111 109 macro(HTMLAttachmentElement) \ 112 110 macro(HTMLAudioElement) \ -
trunk/Source/WebCore/platform/graphics/gpu/GPUBuffer.h
r247397 r247442 30 30 #include "DeferrableTask.h" 31 31 #include "GPUBufferUsage.h" 32 #include "GPUObjectBase.h"33 32 #include <wtf/Function.h> 34 33 #include <wtf/OptionSet.h> … … 53 52 struct GPUBufferDescriptor; 54 53 55 enum class GPUBufferMappedOption;56 57 54 #if USE(METAL) 58 55 using PlatformBuffer = MTLBuffer; … … 62 59 using PlatformBufferSmartPtr = RetainPtr<PlatformBuffer>; 63 60 64 class GPUBuffer : public GPUObjectBase{61 class GPUBuffer : public RefCounted<GPUBuffer> { 65 62 public: 66 63 enum class State { … … 72 69 ~GPUBuffer(); 73 70 74 static RefPtr<GPUBuffer> tryCreate(Ref<GPUDevice>&&, const GPUBufferDescriptor&, GPUBufferMappedOption, Ref<GPUErrorScopes>&&);71 static RefPtr<GPUBuffer> tryCreate(Ref<GPUDevice>&&, const GPUBufferDescriptor&, bool isMappedOnCreation); 75 72 76 73 PlatformBuffer *platformBuffer() const { return m_platformBuffer.get(); } … … 111 108 }; 112 109 113 GPUBuffer(PlatformBufferSmartPtr&&, Ref<GPUDevice>&&, size_t, OptionSet<GPUBufferUsage::Flags>, GPUBufferMappedOption, Ref<GPUErrorScopes>&&);114 static bool validateBufferUsage( GPUDevice&, OptionSet<GPUBufferUsage::Flags>, GPUErrorScopes&);110 GPUBuffer(PlatformBufferSmartPtr&&, Ref<GPUDevice>&&, size_t, OptionSet<GPUBufferUsage::Flags>, bool); 111 static bool validateBufferUsage(const GPUDevice&, OptionSet<GPUBufferUsage::Flags>); 115 112 116 113 JSC::ArrayBuffer* stagingBufferForRead(); -
trunk/Source/WebCore/platform/graphics/gpu/GPUBufferDescriptor.h
r247397 r247442 37 37 }; 38 38 39 enum class GPUBufferMappedOption {40 IsMapped,41 NotMapped42 };43 44 39 } // namespace WebCore 45 40 -
trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.cpp
r247397 r247442 36 36 #include "GPUComputePipeline.h" 37 37 #include "GPUComputePipelineDescriptor.h" 38 #include "GPUErrorScopes.h"39 38 #include "GPUPipelineLayout.h" 40 39 #include "GPUPipelineLayoutDescriptor.h" … … 48 47 #include "GPUTexture.h" 49 48 #include "GPUTextureDescriptor.h" 50 #include <algorithm>51 49 #include <wtf/Optional.h> 52 50 53 51 namespace WebCore { 54 52 55 RefPtr<GPUBuffer> GPUDevice::tryCreateBuffer(const GPUBufferDescriptor& descriptor, GPUBufferMappedOption isMapped, Ref<GPUErrorScopes>&& errorScopes)53 RefPtr<GPUBuffer> GPUDevice::tryCreateBuffer(const GPUBufferDescriptor& descriptor, bool isMappedOnCreation) 56 54 { 57 return GPUBuffer::tryCreate(makeRef(*this), descriptor, isMapped , WTFMove(errorScopes));55 return GPUBuffer::tryCreate(makeRef(*this), descriptor, isMappedOnCreation); 58 56 } 59 57 -
trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.h
r247397 r247442 30 30 #include "GPUQueue.h" 31 31 #include "GPUSwapChain.h" 32 #include <wtf/Function.h>33 #include <wtf/Optional.h>34 32 #include <wtf/RefCounted.h> 35 33 #include <wtf/RetainPtr.h> … … 44 42 class GPUCommandBuffer; 45 43 class GPUComputePipeline; 46 class GPUErrorScopes;47 44 class GPUPipelineLayout; 48 45 class GPURenderPipeline; … … 61 58 struct GPUSwapChainDescriptor; 62 59 struct GPUTextureDescriptor; 63 64 enum class GPUBufferMappedOption; 65 60 66 61 using PlatformDevice = MTLDevice; 67 62 using PlatformDeviceSmartPtr = RetainPtr<MTLDevice>; … … 71 66 static RefPtr<GPUDevice> tryCreate(const Optional<GPURequestAdapterOptions>&); 72 67 73 RefPtr<GPUBuffer> tryCreateBuffer(const GPUBufferDescriptor&, GPUBufferMappedOption, Ref<GPUErrorScopes>&&);68 RefPtr<GPUBuffer> tryCreateBuffer(const GPUBufferDescriptor&, bool isMappedOnCreation = false); 74 69 RefPtr<GPUTexture> tryCreateTexture(const GPUTextureDescriptor&) const; 75 70 RefPtr<GPUSampler> tryCreateSampler(const GPUSamplerDescriptor&) const; -
trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPUBufferMetal.mm
r247397 r247442 43 43 44 44 45 bool GPUBuffer::validateBufferUsage( GPUDevice& device, OptionSet<GPUBufferUsage::Flags> usage, GPUErrorScopes& errorScopes)45 bool GPUBuffer::validateBufferUsage(const GPUDevice& device, OptionSet<GPUBufferUsage::Flags> usage) 46 46 { 47 47 if (!device.platformDevice()) { … … 51 51 52 52 if (usage.containsAll({ GPUBufferUsage::Flags::MapWrite, GPUBufferUsage::Flags::MapRead })) { 53 errorScopes.generateError("GPUBuffer::tryCreate(): Buffer cannot have both MAP_READ and MAP_WRITE usage!");53 LOG(WebGPU, "GPUBuffer::tryCreate(): Buffer cannot have both MAP_READ and MAP_WRITE usage!"); 54 54 return false; 55 55 } … … 63 63 } 64 64 65 RefPtr<GPUBuffer> GPUBuffer::tryCreate(Ref<GPUDevice>&& device, const GPUBufferDescriptor& descriptor, GPUBufferMappedOption isMapped, Ref<GPUErrorScopes>&& errorScopes)65 RefPtr<GPUBuffer> GPUBuffer::tryCreate(Ref<GPUDevice>&& device, const GPUBufferDescriptor& descriptor, bool isMappedOnCreation) 66 66 { 67 67 // MTLBuffer size (NSUInteger) is 32 bits on some platforms. 68 68 NSUInteger size = 0; 69 69 if (!WTF::convertSafely(descriptor.size, size)) { 70 errorScopes->generateError("", GPUErrorFilter::OutOfMemory);70 LOG(WebGPU, "GPUBuffer::tryCreate(): Buffer size is too large!"); 71 71 return nullptr; 72 72 } 73 73 74 74 auto usage = OptionSet<GPUBufferUsage::Flags>::fromRaw(descriptor.usage); 75 if (!validateBufferUsage(device.get(), usage , errorScopes))75 if (!validateBufferUsage(device.get(), usage)) 76 76 return nullptr; 77 77 … … 79 79 // copyBufferToBuffer calls require 4-byte alignment. "Unmapping" a mapped-on-creation GPUBuffer 80 80 // that is otherwise unmappable requires such a copy to upload data. 81 if (isMapped == GPUBufferMappedOption::IsMapped81 if (isMappedOnCreation 82 82 && !usage.containsAny({ GPUBufferUsage::Flags::MapWrite, GPUBufferUsage::Flags::MapRead }) 83 83 && descriptor.size % 4) { … … 103 103 104 104 if (!mtlBuffer) { 105 errorScopes->generateError("", GPUErrorFilter::OutOfMemory); 106 return nullptr; 107 } 108 109 return adoptRef(*new GPUBuffer(WTFMove(mtlBuffer), WTFMove(device), size, usage, isMapped, WTFMove(errorScopes))); 110 } 111 112 GPUBuffer::GPUBuffer(RetainPtr<MTLBuffer>&& buffer, Ref<GPUDevice>&& device, size_t size, OptionSet<GPUBufferUsage::Flags> usage, GPUBufferMappedOption isMapped, Ref<GPUErrorScopes>&& errorScopes) 113 : GPUObjectBase(WTFMove(errorScopes)) 114 , m_platformBuffer(WTFMove(buffer)) 105 LOG(WebGPU, "GPUBuffer::tryCreate(): Unable to create MTLBuffer!"); 106 return nullptr; 107 } 108 109 return adoptRef(*new GPUBuffer(WTFMove(mtlBuffer), WTFMove(device), size, usage, isMappedOnCreation)); 110 } 111 112 GPUBuffer::GPUBuffer(RetainPtr<MTLBuffer>&& buffer, Ref<GPUDevice>&& device, size_t size, OptionSet<GPUBufferUsage::Flags> usage, bool isMapped) 113 : m_platformBuffer(WTFMove(buffer)) 115 114 , m_device(WTFMove(device)) 116 115 , m_byteLength(size) 117 116 , m_usage(usage) 118 , m_isMappedFromCreation(isMapped == GPUBufferMappedOption::IsMapped)117 , m_isMappedFromCreation(isMapped) 119 118 { 120 119 } -
trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPUQueueMetal.mm
r247397 r247442 97 97 } 98 98 99 if (m_presentTask.hasPendingTask() || !m_device || !m_device->swapChain())99 if (m_presentTask.hasPendingTask() || !m_device->swapChain()) 100 100 return; 101 101
Note:
See TracChangeset
for help on using the changeset viewer.