Changeset 247442 in webkit


Ignore:
Timestamp:
Jul 15, 2019 1:35:47 PM (5 years ago)
Author:
Ryan Haddad
Message:

Unreviewed, rolling out r247397, r247378, r247366.

Broke watchOS builds.

Reverted changesets:

"[WebGPU] Implement GPUError and error scopes"
https://bugs.webkit.org/show_bug.cgi?id=199655
https://trac.webkit.org/changeset/247366/webkit

"[WebGPU] Move error scopes out of GPUDevice for more portable error generation"
https://bugs.webkit.org/show_bug.cgi?id=199740
https://trac.webkit.org/changeset/247397/webkit

Location:
trunk
Files:
17 deleted
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r247441 r247442  
     12019-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
    1172019-07-15  Rob Buis  <rbuis@igalia.com>
    218
  • trunk/Source/WebCore/CMakeLists.txt

    r247366 r247442  
    481481    Modules/webgpu/GPUCompareFunction.idl
    482482    Modules/webgpu/GPUDepthStencilStateDescriptor.idl
    483     Modules/webgpu/GPUErrorFilter.idl
    484483    Modules/webgpu/GPUExtent3D.idl
    485484    Modules/webgpu/GPULoadOp.idl
    486485    Modules/webgpu/GPUOrigin3D.idl
    487     Modules/webgpu/GPUOutOfMemoryError.idl
    488486    Modules/webgpu/GPURequestAdapterOptions.idl
    489487    Modules/webgpu/GPUSamplerDescriptor.idl
     
    493491    Modules/webgpu/GPUTextureFormat.idl
    494492    Modules/webgpu/GPUTextureUsage.idl
    495     Modules/webgpu/GPUValidationError.idl
    496493    Modules/webgpu/GPUVertexAttributeDescriptor.idl
    497494    Modules/webgpu/GPUVertexBufferDescriptor.idl
     
    512509    Modules/webgpu/WebGPUComputePipelineDescriptor.idl
    513510    Modules/webgpu/WebGPUDevice.idl
    514     Modules/webgpu/WebGPUDeviceErrorScopes.idl
    515511    Modules/webgpu/WebGPUPipelineDescriptorBase.idl
    516512    Modules/webgpu/WebGPUPipelineLayout.idl
  • trunk/Source/WebCore/ChangeLog

    r247441 r247442  
     12019-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
    1172019-07-15  Rob Buis  <rbuis@igalia.com>
    218
  • trunk/Source/WebCore/DerivedSources-input.xcfilelist

    r247366 r247442  
    331331$(PROJECT_DIR)/Modules/webgpu/GPUCompareFunction.idl
    332332$(PROJECT_DIR)/Modules/webgpu/GPUDepthStencilStateDescriptor.idl
    333 $(PROJECT_DIR)/Modules/webgpu/GPUErrorFilter.idl
    334333$(PROJECT_DIR)/Modules/webgpu/GPUExtent3D.idl
    335334$(PROJECT_DIR)/Modules/webgpu/GPUInputStateDescriptor.idl
    336335$(PROJECT_DIR)/Modules/webgpu/GPULoadOp.idl
    337336$(PROJECT_DIR)/Modules/webgpu/GPUOrigin3D.idl
    338 $(PROJECT_DIR)/Modules/webgpu/GPUOutOfMemoryError.idl
    339337$(PROJECT_DIR)/Modules/webgpu/GPURequestAdapterOptions.idl
    340338$(PROJECT_DIR)/Modules/webgpu/GPUSamplerDescriptor.idl
     
    344342$(PROJECT_DIR)/Modules/webgpu/GPUTextureFormat.idl
    345343$(PROJECT_DIR)/Modules/webgpu/GPUTextureUsage.idl
    346 $(PROJECT_DIR)/Modules/webgpu/GPUValidationError.idl
    347344$(PROJECT_DIR)/Modules/webgpu/GPUVertexAttributeDescriptor.idl
    348345$(PROJECT_DIR)/Modules/webgpu/GPUVertexBufferDescriptor.idl
     
    365362$(PROJECT_DIR)/Modules/webgpu/WebGPUComputePipelineDescriptor.idl
    366363$(PROJECT_DIR)/Modules/webgpu/WebGPUDevice.idl
    367 $(PROJECT_DIR)/Modules/webgpu/WebGPUDeviceErrorScopes.idl
    368364$(PROJECT_DIR)/Modules/webgpu/WebGPUPipelineDescriptorBase.idl
    369365$(PROJECT_DIR)/Modules/webgpu/WebGPUPipelineLayout.idl
  • trunk/Source/WebCore/DerivedSources-output.xcfilelist

    r247366 r247442  
    610610$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUDepthStencilStateDescriptor.cpp
    611611$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUDepthStencilStateDescriptor.h
    612 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUErrorFilter.cpp
    613 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUErrorFilter.h
    614612$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUExtent3D.cpp
    615613$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUExtent3D.h
     
    620618$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUOrigin3D.cpp
    621619$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUOrigin3D.h
    622 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUOutOfMemoryError.cpp
    623 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUOutOfMemoryError.h
    624620$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPURequestAdapterOptions.cpp
    625621$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPURequestAdapterOptions.h
     
    636632$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUTextureUsage.cpp
    637633$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUTextureUsage.h
    638 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUValidationError.cpp
    639 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUValidationError.h
    640634$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUVertexAttributeDescriptor.cpp
    641635$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUVertexAttributeDescriptor.h
     
    19501944$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWebGPUDevice.cpp
    19511945$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWebGPUDevice.h
    1952 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWebGPUDeviceErrorScopes.cpp
    1953 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWebGPUDeviceErrorScopes.h
    19541946$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWebGPUPipelineDescriptorBase.cpp
    19551947$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSWebGPUPipelineDescriptorBase.h
  • trunk/Source/WebCore/DerivedSources.make

    r247366 r247442  
    387387    $(WebCore)/Modules/webgpu/GPUCompareFunction.idl \
    388388    $(WebCore)/Modules/webgpu/GPUDepthStencilStateDescriptor.idl \
    389     $(WebCore)/Modules/webgpu/GPUErrorFilter.idl \
    390389    $(WebCore)/Modules/webgpu/GPUExtent3D.idl \
    391390    $(WebCore)/Modules/webgpu/GPULoadOp.idl \
    392391    $(WebCore)/Modules/webgpu/GPUOrigin3D.idl \
    393     $(WebCore)/Modules/webgpu/GPUOutOfMemoryError.idl \
    394392    $(WebCore)/Modules/webgpu/GPURequestAdapterOptions.idl \
    395393    $(WebCore)/Modules/webgpu/GPUSamplerDescriptor.idl \
     
    399397    $(WebCore)/Modules/webgpu/GPUTextureFormat.idl \
    400398    $(WebCore)/Modules/webgpu/GPUTextureUsage.idl \
    401     $(WebCore)/Modules/webgpu/GPUValidationError.idl \
    402399    $(WebCore)/Modules/webgpu/GPUVertexAttributeDescriptor.idl \
    403400    $(WebCore)/Modules/webgpu/GPUVertexBufferDescriptor.idl \
     
    418415    $(WebCore)/Modules/webgpu/WebGPUComputePipelineDescriptor.idl \
    419416    $(WebCore)/Modules/webgpu/WebGPUDevice.idl \
    420         $(WebCore)/Modules/webgpu/WebGPUDeviceErrorScopes.idl \
    421417    $(WebCore)/Modules/webgpu/WebGPUQueue.idl \
    422418    $(WebCore)/Modules/webgpu/WebGPUPipelineDescriptorBase.idl \
  • trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.cpp

    r247366 r247442  
    2727#include "WHLSLCheckTextureReferences.h"
    2828
     29#include "WHLSLInferTypes.h"
     30
    2931#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"
    3732
    3833namespace WebCore {
  • trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp

    r247378 r247442  
    3131#include "WHLSLCallExpression.h"
    3232#include "WHLSLFunctionDefinition.h"
    33 #include "WHLSLProgram.h"
    3433#include "WHLSLVisitor.h"
    3534#include <wtf/HashSet.h>
  • trunk/Source/WebCore/Modules/webgpu/WebGPUDevice.cpp

    r247397 r247442  
    2929#if ENABLE(WEBGPU)
    3030
    31 #include "Exception.h"
    3231#include "GPUBindGroup.h"
    3332#include "GPUBindGroupBinding.h"
     
    4443#include "GPUTextureDescriptor.h"
    4544#include "JSDOMConvertBufferSource.h"
    46 #include "JSGPUOutOfMemoryError.h"
    47 #include "JSGPUValidationError.h"
    4845#include "JSWebGPUBuffer.h"
    4946#include "Logging.h"
     
    6764#include "WebGPUSwapChain.h"
    6865#include "WebGPUTexture.h"
    69 #include <wtf/Optional.h>
    70 #include <wtf/text/WTFString.h>
    7166
    7267namespace WebCore {
     
    8277    : m_adapter(WTFMove(adapter))
    8378    , m_device(WTFMove(device))
    84     , m_errorScopes(GPUErrorScopes::create())
    8579{
    8680}
     
    8882Ref<WebGPUBuffer> WebGPUDevice::createBuffer(const GPUBufferDescriptor& descriptor) const
    8983{
    90     auto buffer = m_device->tryCreateBuffer(descriptor, GPUBufferMappedOption::NotMapped, m_errorScopes.copyRef());
     84    auto buffer = m_device->tryCreateBuffer(descriptor);
    9185    return WebGPUBuffer::create(WTFMove(buffer));
    9286}
     
    9690    JSC::JSValue wrappedArrayBuffer = JSC::jsNull();
    9791
    98     auto buffer = m_device->tryCreateBuffer(descriptor, GPUBufferMappedOption::IsMapped, m_errorScopes.copyRef());
     92    auto buffer = m_device->tryCreateBuffer(descriptor, true);
    9993    if (buffer) {
    10094        auto arrayBuffer = buffer->mapOnCreation();
     
    187181}
    188182
    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     else
    196         promise.reject(Exception { OperationError, "GPUDevice::popErrorScope(): " + failMessage });
    197 }
    198 
    199183} // namespace WebCore
    200184
  • trunk/Source/WebCore/Modules/webgpu/WebGPUDevice.h

    r247397 r247442  
    2929
    3030#include "GPUDevice.h"
    31 #include "GPUErrorScopes.h"
    32 #include "JSDOMPromiseDeferred.h"
    3331#include "WebGPUAdapter.h"
    3432#include "WebGPUQueue.h"
     
    4644namespace WebCore {
    4745
    48 class GPUOutOfMemoryError;
    49 class GPUValidationError;
    5046class ScriptExecutionContext;
    5147class WebGPUBindGroup;
     
    7066struct WebGPURenderPipelineDescriptor;
    7167struct WebGPUShaderModuleDescriptor;
    72 
    73 enum class GPUErrorFilter;
    74 
    75 using ErrorIDLUnion = IDLUnion<IDLInterface<GPUOutOfMemoryError>, IDLInterface<GPUValidationError>>;
    76 using ErrorPromise = DOMPromiseDeferred<IDLNullable<ErrorIDLUnion>>;
    7768
    7869class WebGPUDevice : public RefCounted<WebGPUDevice> {
     
    10192    Ref<WebGPUQueue> getQueue() const;
    10293
    103     void pushErrorScope(GPUErrorFilter filter) { m_errorScopes->pushErrorScope(filter); }
    104     void popErrorScope(ErrorPromise&&);
    105 
    10694private:
    10795    WebGPUDevice(Ref<const WebGPUAdapter>&&, Ref<GPUDevice>&&);
     
    11098    Ref<GPUDevice> m_device;
    11199    mutable RefPtr<WebGPUQueue> m_queue;
    112 
    113     Ref<GPUErrorScopes> m_errorScopes;
    114100};
    115101
  • trunk/Source/WebCore/Sources.txt

    r247397 r247442  
    368368Modules/webgpu/WebGPUComputePipelineDescriptor.cpp
    369369Modules/webgpu/WebGPUDevice.cpp
    370 Modules/webgpu/WebGPUDeviceErrorScopes.cpp
    371370Modules/webgpu/WebGPUQueue.cpp
    372371Modules/webgpu/WebGPUPipelineLayout.cpp
     
    18291828
    18301829platform/graphics/gpu/GPUDevice.cpp
    1831 platform/graphics/gpu/GPUError.cpp
    1832 platform/graphics/gpu/GPUErrorScopes.cpp
    1833 platform/graphics/gpu/GPUValidationError.cpp
    18341830platform/graphics/gpu/GPUPipelineLayout.cpp
    18351831platform/graphics/gpu/GPUProgrammablePassEncoder.cpp
     
    27612757JSGPUCompareFunction.cpp
    27622758JSGPUDepthStencilStateDescriptor.cpp
    2763 JSGPUErrorFilter.cpp
    27642759JSGPUExtent3D.cpp
    27652760JSGPULoadOp.cpp
    27662761JSGPUOrigin3D.cpp
    2767 JSGPUOutOfMemoryError.cpp
    27682762JSGPURequestAdapterOptions.cpp
    27692763JSGPUSamplerDescriptor.cpp
     
    27732767JSGPUTextureFormat.cpp
    27742768JSGPUTextureUsage.cpp
    2775 JSGPUValidationError.cpp
    27762769JSGPUVertexAttributeDescriptor.cpp
    27772770JSGPUVertexBufferDescriptor.cpp
     
    33263319JSWebGPUComputePipelineDescriptor.cpp
    33273320JSWebGPUDevice.cpp
    3328 JSWebGPUDeviceErrorScopes.cpp
    33293321JSWebGPUQueue.cpp
    33303322JSWebGPUPipelineDescriptorBase.cpp
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r247397 r247442  
    1395513955                D03211CF21AC954E00763CF2 /* GPUProgrammablePassEncoder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUProgrammablePassEncoder.h; sourceTree = "<group>"; };
    1395613956                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>"; };
    1395913957                D036DD8D208FFC0C00F9F4B2 /* WebGLCompressedTextureASTC.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGLCompressedTextureASTC.idl; sourceTree = "<group>"; };
    1396013958                D03C849A21FFC6670002227F /* GPUDepthStencilStateDescriptor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUDepthStencilStateDescriptor.h; sourceTree = "<group>"; };
     
    1402114019                D093D227217951D400329217 /* GPUCanvasContext.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = GPUCanvasContext.idl; sourceTree = "<group>"; };
    1402214020                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>"; };
    1403714021                D0A20D542092A0A600E0C259 /* WebGLCompressedTextureASTC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebGLCompressedTextureASTC.h; sourceTree = "<group>"; };
    1403814022                D0A20D562092A0A600E0C259 /* WebGLCompressedTextureASTC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebGLCompressedTextureASTC.cpp; sourceTree = "<group>"; };
     
    1833718321                                312FF8BF21A4C2F100EB199D /* GPUDevice.cpp */,
    1833818322                                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 */,
    1834518323                                D026F47D220A2AC600AC5F49 /* GPUExtent3D.h */,
    1834618324                                D0F7559F2203BA1400118058 /* GPULimits.h */,
    1834718325                                D08AA02F220D0BD50058C502 /* GPULoadOp.h */,
    18348                                 D09AFB3722D7D5C600C4538C /* GPUObjectBase.h */,
    18349                                 D09AFB1922D6698A00C4538C /* GPUOutOfMemoryError.h */,
    1835018326                                312FF8C421A4C2F400EB199D /* GPUPipelineDescriptorBase.h */,
    1835118327                                D003288721C9A4E500622AA6 /* GPUPipelineLayout.cpp */,
     
    1837318349                                D026F485220A477200AC5F49 /* GPUTextureUsage.h */,
    1837418350                                D06EF552220BA26A0018724E /* GPUUtils.h */,
    18375                                 D09AFB0E22D55FF500C4538C /* GPUValidationError.cpp */,
    18376                                 D09AFB0D22D55F3B00C4538C /* GPUValidationError.h */,
    1837718351                                D0D8649B21BA1C2D003C983C /* GPUVertexAttributeDescriptor.h */,
    1837818352                                D0D8649C21BA1CE8003C983C /* GPUVertexBufferDescriptor.h */,
     
    2596425938                                D03C849E21FFCF000002227F /* GPUCompareFunction.idl */,
    2596525939                                D03C84A221FFD7230002227F /* GPUDepthStencilStateDescriptor.idl */,
    25966                                 D09AFB0622D417B300C4538C /* GPUErrorFilter.idl */,
    2596725940                                D026F480220A2B7000AC5F49 /* GPUExtent3D.idl */,
    2596825941                                D08AA02D220D0B9C0058C502 /* GPULoadOp.idl */,
    2596925942                                D0CCA94922299F97006979B6 /* GPUOrigin3D.h */,
    2597025943                                D0CCA94A22299F97006979B6 /* GPUOrigin3D.idl */,
    25971                                 D09AFB1722D6694E00C4538C /* GPUOutOfMemoryError.idl */,
    2597225944                                D02C26922181416D00D818E4 /* GPURequestAdapterOptions.idl */,
    2597325945                                D0ADB26322309D7600A22935 /* GPUSamplerDescriptor.idl */,
     
    2597825950                                D0EACFAE219E30FD000FA75C /* GPUTextureFormat.idl */,
    2597925951                                D026F483220A472F00AC5F49 /* GPUTextureUsage.idl */,
    25980                                 D09AFB0C22D55E9000C4538C /* GPUValidationError.idl */,
    2598125952                                D0D8649621BA18F4003C983C /* GPUVertexAttributeDescriptor.idl */,
    2598225953                                D0D8649821BA19A7003C983C /* GPUVertexBufferDescriptor.idl */,
     
    2602525996                                D00F595221701D8C000D71DB /* WebGPUDevice.h */,
    2602625997                                D00F595421701D8C000D71DB /* WebGPUDevice.idl */,
    26027                                 D09AFB0122D02E5300C4538C /* WebGPUDeviceErrorScopes.cpp */,
    26028                                 D09AFAFF22D02E5300C4538C /* WebGPUDeviceErrorScopes.h */,
    26029                                 D09AFB0322D40CC500C4538C /* WebGPUDeviceErrorScopes.idl */,
    2603025998                                D0C419F02183EB31009EC1DE /* WebGPUPipelineDescriptorBase.h */,
    2603125999                                D0C419F12183EB31009EC1DE /* WebGPUPipelineDescriptorBase.idl */,
     
    2843328401                                7C1843FE1C8B7283002EB973 /* Autofill.h in Headers */,
    2843428402                                7C1E97281A9F9834007BF0FB /* AutoFillButtonElement.h in Headers */,
    28435                                 5CCC270922D5483A00964FA0 /* AutofillElements.h in Headers */,
    2843628403                                C9D467051E60C465008195FB /* AutoplayEvent.h in Headers */,
    2843728404                                45830D4E1679B4F800ACF8C3 /* AutoscrollController.h in Headers */,
     
    3007830045                                A77979290D6B9E64003851B9 /* JSImageData.h in Headers */,
    3007930046                                7C193C011F5E11050088F3E6 /* JSImageSmoothingQuality.h in Headers */,
     30047                                5CCC270922D5483A00964FA0 /* AutofillElements.h in Headers */,
    3008030048                                A86629D309DA2B48009633A6 /* JSInputEvent.h in Headers */,
    3008130049                                9175CE5E21E281ED00DF2C28 /* JSInspectorAuditAccessibilityObject.h in Headers */,
  • trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h

    r247366 r247442  
    9595    macro(GPUComputePipeline) \
    9696    macro(GPUDevice) \
    97     macro(GPUOutOfMemoryError) \
    9897    macro(GPUPipelineLayout) \
    9998    macro(GPUProgrammablePassEncoder) \
     
    108107    macro(GPUTextureUsage) \
    109108    macro(GPUTextureView) \
    110     macro(GPUValidationError) \
    111109    macro(HTMLAttachmentElement) \
    112110    macro(HTMLAudioElement) \
  • trunk/Source/WebCore/platform/graphics/gpu/GPUBuffer.h

    r247397 r247442  
    3030#include "DeferrableTask.h"
    3131#include "GPUBufferUsage.h"
    32 #include "GPUObjectBase.h"
    3332#include <wtf/Function.h>
    3433#include <wtf/OptionSet.h>
     
    5352struct GPUBufferDescriptor;
    5453
    55 enum class GPUBufferMappedOption;
    56 
    5754#if USE(METAL)
    5855using PlatformBuffer = MTLBuffer;
     
    6259using PlatformBufferSmartPtr = RetainPtr<PlatformBuffer>;
    6360
    64 class GPUBuffer : public GPUObjectBase {
     61class GPUBuffer : public RefCounted<GPUBuffer> {
    6562public:
    6663    enum class State {
     
    7269    ~GPUBuffer();
    7370
    74     static RefPtr<GPUBuffer> tryCreate(Ref<GPUDevice>&&, const GPUBufferDescriptor&, GPUBufferMappedOption, Ref<GPUErrorScopes>&&);
     71    static RefPtr<GPUBuffer> tryCreate(Ref<GPUDevice>&&, const GPUBufferDescriptor&, bool isMappedOnCreation);
    7572
    7673    PlatformBuffer *platformBuffer() const { return m_platformBuffer.get(); }
     
    111108    };
    112109
    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>);
    115112
    116113    JSC::ArrayBuffer* stagingBufferForRead();
  • trunk/Source/WebCore/platform/graphics/gpu/GPUBufferDescriptor.h

    r247397 r247442  
    3737};
    3838
    39 enum class GPUBufferMappedOption {
    40     IsMapped,
    41     NotMapped
    42 };
    43 
    4439} // namespace WebCore
    4540
  • trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.cpp

    r247397 r247442  
    3636#include "GPUComputePipeline.h"
    3737#include "GPUComputePipelineDescriptor.h"
    38 #include "GPUErrorScopes.h"
    3938#include "GPUPipelineLayout.h"
    4039#include "GPUPipelineLayoutDescriptor.h"
     
    4847#include "GPUTexture.h"
    4948#include "GPUTextureDescriptor.h"
    50 #include <algorithm>
    5149#include <wtf/Optional.h>
    5250
    5351namespace WebCore {
    5452
    55 RefPtr<GPUBuffer> GPUDevice::tryCreateBuffer(const GPUBufferDescriptor& descriptor, GPUBufferMappedOption isMapped, Ref<GPUErrorScopes>&& errorScopes)
     53RefPtr<GPUBuffer> GPUDevice::tryCreateBuffer(const GPUBufferDescriptor& descriptor, bool isMappedOnCreation)
    5654{
    57     return GPUBuffer::tryCreate(makeRef(*this), descriptor, isMapped, WTFMove(errorScopes));
     55    return GPUBuffer::tryCreate(makeRef(*this), descriptor, isMappedOnCreation);
    5856}
    5957
  • trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.h

    r247397 r247442  
    3030#include "GPUQueue.h"
    3131#include "GPUSwapChain.h"
    32 #include <wtf/Function.h>
    33 #include <wtf/Optional.h>
    3432#include <wtf/RefCounted.h>
    3533#include <wtf/RetainPtr.h>
     
    4442class GPUCommandBuffer;
    4543class GPUComputePipeline;
    46 class GPUErrorScopes;
    4744class GPUPipelineLayout;
    4845class GPURenderPipeline;
     
    6158struct GPUSwapChainDescriptor;
    6259struct GPUTextureDescriptor;
    63 
    64 enum class GPUBufferMappedOption;
    65 
     60   
    6661using PlatformDevice = MTLDevice;
    6762using PlatformDeviceSmartPtr = RetainPtr<MTLDevice>;
     
    7166    static RefPtr<GPUDevice> tryCreate(const Optional<GPURequestAdapterOptions>&);
    7267
    73     RefPtr<GPUBuffer> tryCreateBuffer(const GPUBufferDescriptor&, GPUBufferMappedOption, Ref<GPUErrorScopes>&&);
     68    RefPtr<GPUBuffer> tryCreateBuffer(const GPUBufferDescriptor&, bool isMappedOnCreation = false);
    7469    RefPtr<GPUTexture> tryCreateTexture(const GPUTextureDescriptor&) const;
    7570    RefPtr<GPUSampler> tryCreateSampler(const GPUSamplerDescriptor&) const;
  • trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPUBufferMetal.mm

    r247397 r247442  
    4343
    4444
    45 bool GPUBuffer::validateBufferUsage(GPUDevice& device, OptionSet<GPUBufferUsage::Flags> usage, GPUErrorScopes& errorScopes)
     45bool GPUBuffer::validateBufferUsage(const GPUDevice& device, OptionSet<GPUBufferUsage::Flags> usage)
    4646{
    4747    if (!device.platformDevice()) {
     
    5151
    5252    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!");
    5454        return false;
    5555    }
     
    6363}
    6464
    65 RefPtr<GPUBuffer> GPUBuffer::tryCreate(Ref<GPUDevice>&& device, const GPUBufferDescriptor& descriptor, GPUBufferMappedOption isMapped, Ref<GPUErrorScopes>&& errorScopes)
     65RefPtr<GPUBuffer> GPUBuffer::tryCreate(Ref<GPUDevice>&& device, const GPUBufferDescriptor& descriptor, bool isMappedOnCreation)
    6666{
    6767    // MTLBuffer size (NSUInteger) is 32 bits on some platforms.
    6868    NSUInteger size = 0;
    6969    if (!WTF::convertSafely(descriptor.size, size)) {
    70         errorScopes->generateError("", GPUErrorFilter::OutOfMemory);
     70        LOG(WebGPU, "GPUBuffer::tryCreate(): Buffer size is too large!");
    7171        return nullptr;
    7272    }
    7373
    7474    auto usage = OptionSet<GPUBufferUsage::Flags>::fromRaw(descriptor.usage);
    75     if (!validateBufferUsage(device.get(), usage, errorScopes))
     75    if (!validateBufferUsage(device.get(), usage))
    7676        return nullptr;
    7777
     
    7979    // copyBufferToBuffer calls require 4-byte alignment. "Unmapping" a mapped-on-creation GPUBuffer
    8080    // that is otherwise unmappable requires such a copy to upload data.
    81     if (isMapped == GPUBufferMappedOption::IsMapped
     81    if (isMappedOnCreation
    8282        && !usage.containsAny({ GPUBufferUsage::Flags::MapWrite, GPUBufferUsage::Flags::MapRead })
    8383        && descriptor.size % 4) {
     
    103103
    104104    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
     112GPUBuffer::GPUBuffer(RetainPtr<MTLBuffer>&& buffer, Ref<GPUDevice>&& device, size_t size, OptionSet<GPUBufferUsage::Flags> usage, bool isMapped)
     113    : m_platformBuffer(WTFMove(buffer))
    115114    , m_device(WTFMove(device))
    116115    , m_byteLength(size)
    117116    , m_usage(usage)
    118     , m_isMappedFromCreation(isMapped == GPUBufferMappedOption::IsMapped)
     117    , m_isMappedFromCreation(isMapped)
    119118{
    120119}
  • trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPUQueueMetal.mm

    r247397 r247442  
    9797    }
    9898
    99     if (m_presentTask.hasPendingTask() || !m_device || !m_device->swapChain())
     99    if (m_presentTask.hasPendingTask() || !m_device->swapChain())
    100100        return;
    101101
Note: See TracChangeset for help on using the changeset viewer.