Changeset 268603 in webkit
- Timestamp:
- Oct 16, 2020 12:32:39 PM (4 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 1 added
- 18 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r268600 r268603 1 2020-10-16 Don Olmstead <don.olmstead@sony.com> 2 3 [WebGPU] Centralize Platform Defines 4 https://bugs.webkit.org/show_bug.cgi?id=217725 5 6 Reviewed by Myles C. Maxfield. 7 8 Centralize all the Metal forward declarations and GPU platform type definitions 9 into GPUPlatformTypesMetal.h. Each platform implementing WebGPU will have its own 10 version of the file which contains the same definitions. This file is then 11 referenced by GPUPlatformTypes.h. 12 13 This is in preparation for adding a Dawn based implementation which requires 14 more substantial definitions than the Metal backend. 15 16 No new tests. No change in behavior. 17 18 * WebCore.xcodeproj/project.pbxproj: 19 * platform/graphics/gpu/GPUBindGroup.h: 20 * platform/graphics/gpu/GPUBindGroupAllocator.h: 21 * platform/graphics/gpu/GPUBindGroupLayout.h: 22 * platform/graphics/gpu/GPUBuffer.h: 23 (WebCore::GPUBuffer::platformBuffer const): 24 * platform/graphics/gpu/GPUCommandBuffer.h: 25 * platform/graphics/gpu/GPUComputePassEncoder.h: 26 * platform/graphics/gpu/GPUComputePipeline.h: 27 * platform/graphics/gpu/GPUDevice.h: 28 * platform/graphics/gpu/GPUPlatformTypes.h: Added. 29 * platform/graphics/gpu/GPUProgrammablePassEncoder.h: 30 * platform/graphics/gpu/GPUQueue.h: 31 * platform/graphics/gpu/GPURenderPassEncoder.h: 32 * platform/graphics/gpu/GPURenderPipeline.h: 33 * platform/graphics/gpu/GPUSampler.h: 34 * platform/graphics/gpu/GPUShaderModule.h: 35 * platform/graphics/gpu/GPUSwapChain.h: 36 * platform/graphics/gpu/GPUTexture.h: 37 * platform/graphics/gpu/cocoa/GPUPlatformTypesMetal.h: Added. 38 1 39 2020-10-16 Chris Dumez <cdumez@apple.com> 2 40 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r268578 r268603 12161 12161 A37A42E22527B49D00F75AFF /* EXTTextureCompressionRGTC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EXTTextureCompressionRGTC.h; sourceTree = "<group>"; }; 12162 12162 A37A42E32527B49E00F75AFF /* EXTTextureCompressionRGTC.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = EXTTextureCompressionRGTC.idl; sourceTree = "<group>"; }; 12163 A38A87A32538BEE70037A472 /* GPUPlatformTypesMetal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUPlatformTypesMetal.h; sourceTree = "<group>"; }; 12164 A3C3DC5D253A19920061F32A /* GPUPlatformTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUPlatformTypes.h; sourceTree = "<group>"; }; 12163 12165 A3AF9D81203252EE006CAD06 /* UserAgentCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UserAgentCocoa.mm; sourceTree = "<group>"; }; 12164 12166 A3AF9D8220325324006CAD06 /* UserAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserAgent.h; sourceTree = "<group>"; }; … … 19673 19675 D003288621C9A4E500622AA6 /* GPUPipelineLayout.h */, 19674 19676 D003288421C9A20D00622AA6 /* GPUPipelineLayoutDescriptor.h */, 19677 A3C3DC5D253A19920061F32A /* GPUPlatformTypes.h */, 19675 19678 D003914122248D400098998C /* GPUProgrammablePassEncoder.cpp */, 19676 19679 D03211CF21AC954E00763CF2 /* GPUProgrammablePassEncoder.h */, … … 27862 27865 1C86CA4E22AA23C9001BF961 /* GPUPipelineMetalConvertLayout.cpp */, 27863 27866 1C86CA4F22AA23C9001BF961 /* GPUPipelineMetalConvertLayout.h */, 27867 A38A87A32538BEE70037A472 /* GPUPlatformTypesMetal.h */, 27864 27868 D087CE3B21ACA94200BDE174 /* GPUProgrammablePassEncoderMetal.mm */, 27865 27869 D087CE3921ACA94200BDE174 /* GPUQueueMetal.mm */, -
trunk/Source/WebCore/platform/graphics/gpu/GPUBindGroup.h
r267777 r268603 30 30 #include "GPUBindGroupAllocator.h" 31 31 #include "GPUBuffer.h" 32 #include "GPUPlatformTypes.h" 32 33 #include "GPUTexture.h" 33 34 #include <utility> … … 35 36 #include <wtf/RefCounted.h> 36 37 #include <wtf/RefPtr.h> 37 38 #if USE(METAL)39 #include <objc/NSObjCRuntime.h>40 #include <wtf/RetainPtr.h>41 #endif42 43 #if USE(METAL)44 OBJC_PROTOCOL(MTLBuffer);45 #endif46 38 47 39 namespace WebCore { -
trunk/Source/WebCore/platform/graphics/gpu/GPUBindGroupAllocator.h
r267777 r268603 28 28 #if ENABLE(WEBGPU) 29 29 30 #include "GPUBuffer.h" 31 #include "GPUPlatformTypes.h" 30 32 #include <wtf/Optional.h> 31 33 #include <wtf/Ref.h> 32 34 #include <wtf/RefCounted.h> 33 34 #if USE(METAL)35 #include <objc/NSObjCRuntime.h>36 #include <wtf/RetainPtr.h>37 #endif38 39 #if USE(METAL)40 OBJC_PROTOCOL(MTLArgumentEncoder);41 OBJC_PROTOCOL(MTLBuffer);42 #endif43 35 44 36 namespace WebCore { -
trunk/Source/WebCore/platform/graphics/gpu/GPUBindGroupLayout.h
r267777 r268603 29 29 30 30 #include "GPUBindGroupLayoutDescriptor.h" 31 #include "GPUPlatformTypes.h" 31 32 #include <wtf/HashMap.h> 32 33 #include <wtf/RefCounted.h> 33 34 #include <wtf/RefPtr.h> 34 35 #include <wtf/Variant.h> 35 36 #if USE(METAL)37 #include <wtf/RetainPtr.h>38 #endif39 40 #if USE(METAL)41 OBJC_PROTOCOL(MTLArgumentEncoder);42 OBJC_PROTOCOL(MTLBuffer);43 #endif // USE(METAL)44 36 45 37 namespace WebCore { -
trunk/Source/WebCore/platform/graphics/gpu/GPUBuffer.h
r267777 r268603 30 30 #include "DeferrableTask.h" 31 31 #include "GPUBufferUsage.h" 32 #include "GPUPlatformTypes.h" 32 33 #include <wtf/Function.h> 33 34 #include <wtf/OptionSet.h> … … 35 36 #include <wtf/RefCounted.h> 36 37 #include <wtf/Vector.h> 37 38 #if USE(METAL)39 #include <wtf/RetainPtr.h>40 #endif41 42 #if USE(METAL)43 OBJC_PROTOCOL(MTLBuffer);44 OBJC_PROTOCOL(MTLCommandBuffer);45 #endif46 38 47 39 namespace JSC { … … 58 50 enum class GPUBufferMappedOption; 59 51 60 #if USE(METAL)61 using PlatformBuffer = MTLBuffer;62 using PlatformBufferSmartPtr = RetainPtr<MTLBuffer>;63 #endif64 65 52 class GPUBuffer : public RefCounted<GPUBuffer> { 66 53 public: … … 75 62 static RefPtr<GPUBuffer> tryCreate(GPUDevice&, const GPUBufferDescriptor&, GPUBufferMappedOption, GPUErrorScopes&); 76 63 77 PlatformBuffer *platformBuffer() const { return m_platformBuffer.get(); }64 PlatformBuffer* platformBuffer() const { return m_platformBuffer.get(); } 78 65 size_t byteLength() const { return m_byteLength; } 79 66 bool isCopySource() const { return m_usage.contains(GPUBufferUsage::Flags::CopySource); } -
trunk/Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.h
r267777 r268603 30 30 #include "GPUBuffer.h" 31 31 #include "GPUOrigin3D.h" 32 #include "GPUPlatformTypes.h" 32 33 #include "GPUTexture.h" 33 34 #include <wtf/HashSet.h> 34 35 #include <wtf/RefCounted.h> 35 36 #include <wtf/RefPtr.h> 36 37 #if USE(METAL)38 #include <wtf/RetainPtr.h>39 #endif40 41 #if USE(METAL)42 OBJC_PROTOCOL(MTLBlitCommandEncoder);43 OBJC_PROTOCOL(MTLCommandBuffer);44 #endif45 37 46 38 namespace WebCore { … … 49 41 50 42 struct GPUExtent3D; 51 52 #if USE(METAL)53 using PlatformCommandBuffer = MTLCommandBuffer;54 using PlatformCommandBufferSmartPtr = RetainPtr<MTLCommandBuffer>;55 #endif56 43 57 44 struct GPUBufferCopyViewBase { -
trunk/Source/WebCore/platform/graphics/gpu/GPUComputePassEncoder.h
r267777 r268603 33 33 #include <wtf/RefPtr.h> 34 34 35 #if USE(METAL)36 #include <wtf/RetainPtr.h>37 #endif38 39 #if USE(METAL)40 OBJC_PROTOCOL(MTLComputeCommandEncoder);41 #endif42 43 35 namespace WebCore { 44 45 #if USE(METAL)46 using PlatformComputePassEncoder = MTLComputeCommandEncoder;47 using PlatformComputePassEncoderSmartPtr = RetainPtr<MTLComputeCommandEncoder>;48 #endif49 36 50 37 class GPUComputePassEncoder : public GPUProgrammablePassEncoder { -
trunk/Source/WebCore/platform/graphics/gpu/GPUComputePipeline.h
r267777 r268603 29 29 30 30 #include "GPUPipeline.h" 31 #include "GPUPlatformTypes.h" 31 32 #include "GPUProgrammableStageDescriptor.h" 32 33 #include <wtf/RefCounted.h> … … 35 36 #if ENABLE(WHLSL_COMPILER) 36 37 #include "WHLSLPrepare.h" 37 #endif38 39 #if USE(METAL)40 #include <wtf/RetainPtr.h>41 #endif42 43 #if USE(METAL)44 OBJC_PROTOCOL(MTLComputePipelineState);45 38 #endif 46 39 … … 52 45 53 46 struct GPUComputePipelineDescriptor; 54 55 #if USE(METAL)56 using PlatformComputePipeline = MTLComputePipelineState;57 using PlatformComputePipelineSmartPtr = RetainPtr<MTLComputePipelineState>;58 #endif59 47 60 48 class GPUComputePipeline final : public GPUPipeline { -
trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.h
r267777 r268603 30 30 #include "GPUBindGroupAllocator.h" 31 31 #include "GPUErrorScopes.h" 32 #include "GPUPlatformTypes.h" 32 33 #include "GPUQueue.h" 33 34 #include "GPUSwapChain.h" … … 38 39 #include <wtf/RefPtr.h> 39 40 #include <wtf/WeakPtr.h> 40 41 #if USE(METAL)42 #include <wtf/RetainPtr.h>43 #endif44 45 #if USE(METAL)46 OBJC_PROTOCOL(MTLDevice);47 #endif48 41 49 42 namespace WebCore { … … 74 67 75 68 enum class GPUBufferMappedOption; 76 77 #if USE(METAL)78 using PlatformDevice = MTLDevice;79 using PlatformDeviceSmartPtr = RetainPtr<MTLDevice>;80 #endif81 69 82 70 class GPUDevice : public RefCounted<GPUDevice>, public CanMakeWeakPtr<GPUDevice> { -
trunk/Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h
r268602 r268603 1 1 /* 2 * Copyright (C) 20 19 Apple Inc. All rights reserved.2 * Copyright (C) 2020 Sony Interactive Entertainment Inc. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 26 26 #pragma once 27 27 28 #if ENABLE(WEBGPU)29 30 #include <wtf/RefCounted.h>31 #include <wtf/RefPtr.h>32 33 28 #if USE(METAL) 34 #include <wtf/RetainPtr.h> 29 #include "GPUPlatformTypesMetal.h" 30 #else 31 #error "Unsupported platform for WebGPU" 35 32 #endif 36 37 #if USE(METAL)38 OBJC_PROTOCOL(MTLSamplerState);39 #endif40 41 namespace WebCore {42 43 class GPUDevice;44 45 struct GPUSamplerDescriptor;46 47 #if USE(METAL)48 using PlatformSampler = MTLSamplerState;49 using PlatformSamplerSmartPtr = RetainPtr<MTLSamplerState>;50 #endif51 52 class GPUSampler : public RefCounted<GPUSampler> {53 public:54 static RefPtr<GPUSampler> tryCreate(const GPUDevice&, const GPUSamplerDescriptor&);55 56 PlatformSampler* platformSampler() const { return m_platformSampler.get(); }57 58 private:59 GPUSampler(PlatformSamplerSmartPtr&&);60 61 PlatformSamplerSmartPtr m_platformSampler;62 };63 64 } // namespace WebCore65 66 #endif // ENABLE(WEBGPU) -
trunk/Source/WebCore/platform/graphics/gpu/GPUProgrammablePassEncoder.h
r267777 r268603 30 30 #include "GPUBindGroupBinding.h" 31 31 #include "GPUCommandBuffer.h" 32 #include "GPUPlatformTypes.h" 32 33 #include <wtf/RefCounted.h> 33 34 #if USE(METAL)35 #include <objc/NSObjCRuntime.h>36 #endif37 38 #if USE(METAL)39 OBJC_PROTOCOL(MTLBuffer);40 OBJC_PROTOCOL(MTLCommandEncoder);41 OBJC_PROTOCOL(MTLResource);42 #endif43 34 44 35 namespace WebCore { … … 46 37 class GPUBindGroup; 47 38 class GPURenderPipeline; 48 49 #if USE(METAL)50 using PlatformProgrammablePassEncoder = MTLCommandEncoder;51 #endif52 39 53 40 class GPUProgrammablePassEncoder : public RefCounted<GPUProgrammablePassEncoder> { -
trunk/Source/WebCore/platform/graphics/gpu/GPUQueue.h
r267777 r268603 29 29 30 30 #include "DeferrableTask.h" 31 #include "GPUPlatformTypes.h" 31 32 #include <wtf/RefCounted.h> 32 33 #include <wtf/RefPtr.h> … … 34 35 #include <wtf/WeakPtr.h> 35 36 36 #if USE(METAL)37 #include <wtf/RetainPtr.h>38 #endif39 40 #if USE(METAL)41 OBJC_PROTOCOL(MTLCommandQueue);42 #endif43 44 37 namespace WebCore { 45 46 #if USE(METAL)47 using PlatformQueue = MTLCommandQueue;48 using PlatformQueueSmartPtr = RetainPtr<MTLCommandQueue>;49 #endif50 38 51 39 class GPUCommandBuffer; -
trunk/Source/WebCore/platform/graphics/gpu/GPURenderPassEncoder.h
r267777 r268603 28 28 #if ENABLE(WEBGPU) 29 29 30 #include "GPUPlatformTypes.h" 30 31 #include "GPUProgrammablePassEncoder.h" 31 32 #include "GPURenderPipeline.h" 32 33 33 #include <wtf/RefCounted.h> 34 34 #include <wtf/RefPtr.h> 35 35 #include <wtf/Vector.h> 36 37 #if USE(METAL)38 #include <wtf/RetainPtr.h>39 #endif40 41 #if USE(METAL)42 OBJC_PROTOCOL(MTLRenderCommandEncoder);43 #endif44 36 45 37 namespace WebCore { … … 50 42 struct GPUColor; 51 43 struct GPURenderPassDescriptor; 52 53 #if USE(METAL)54 using PlatformRenderPassEncoder = MTLRenderCommandEncoder;55 using PlatformRenderPassEncoderSmartPtr = RetainPtr<MTLRenderCommandEncoder>;56 #endif57 44 58 45 class GPURenderPassEncoder : public GPUProgrammablePassEncoder { -
trunk/Source/WebCore/platform/graphics/gpu/GPURenderPipeline.h
r267777 r268603 29 29 30 30 #include "GPUPipeline.h" 31 #include "GPUPlatformTypes.h" 31 32 #include "GPUProgrammableStageDescriptor.h" 32 33 #include "GPURenderPipelineDescriptor.h" … … 35 36 #include <wtf/RefPtr.h> 36 37 37 #if USE(METAL)38 #include <wtf/RetainPtr.h>39 #endif40 41 #if USE(METAL)42 OBJC_PROTOCOL(MTLDepthStencilState);43 OBJC_PROTOCOL(MTLRenderPipelineState);44 #endif45 46 38 namespace WebCore { 47 39 48 40 class GPUDevice; 49 41 class GPUErrorScopes; 50 51 #if USE(METAL)52 using PlatformRenderPipeline = MTLRenderPipelineState;53 using PlatformRenderPipelineSmartPtr = RetainPtr<MTLRenderPipelineState>;54 #endif55 42 56 43 class GPURenderPipeline final : public GPUPipeline { -
trunk/Source/WebCore/platform/graphics/gpu/GPUSampler.h
r267777 r268603 28 28 #if ENABLE(WEBGPU) 29 29 30 #include "GPUPlatformTypes.h" 30 31 #include <wtf/RefCounted.h> 31 32 #include <wtf/RefPtr.h> 32 33 #if USE(METAL)34 #include <wtf/RetainPtr.h>35 #endif36 37 #if USE(METAL)38 OBJC_PROTOCOL(MTLSamplerState);39 #endif40 33 41 34 namespace WebCore { … … 44 37 45 38 struct GPUSamplerDescriptor; 46 47 #if USE(METAL)48 using PlatformSampler = MTLSamplerState;49 using PlatformSamplerSmartPtr = RetainPtr<MTLSamplerState>;50 #endif51 39 52 40 class GPUSampler : public RefCounted<GPUSampler> { -
trunk/Source/WebCore/platform/graphics/gpu/GPUShaderModule.h
r267777 r268603 28 28 #if ENABLE(WEBGPU) 29 29 30 #include "GPUPlatformTypes.h" 30 31 #include "WHLSLPrepare.h" 31 32 #include <wtf/RefCounted.h> 32 33 #include <wtf/RefPtr.h> 33 34 #if USE(METAL)35 #include <wtf/RetainPtr.h>36 #endif37 38 #if USE(METAL)39 OBJC_PROTOCOL(MTLLibrary);40 #endif41 34 42 35 namespace WebCore { … … 45 38 46 39 struct GPUShaderModuleDescriptor; 47 48 #if USE(METAL)49 using PlatformShaderModule = MTLLibrary;50 using PlatformShaderModuleSmartPtr = RetainPtr<MTLLibrary>;51 #endif52 40 53 41 class GPUShaderModule : public RefCounted<GPUShaderModule> { -
trunk/Source/WebCore/platform/graphics/gpu/GPUSwapChain.h
r267777 r268603 28 28 #if ENABLE(WEBGPU) 29 29 30 #include "GPUPlatformTypes.h" 30 31 #include "GPUTexture.h" 31 32 #include "PlatformLayer.h" … … 42 43 #endif 43 44 44 #if USE(METAL)45 #include <wtf/RetainPtr.h>46 #endif47 48 #if USE(METAL)49 OBJC_CLASS CAMetalDrawable;50 OBJC_CLASS WebGPULayer;51 #endif52 53 45 namespace WebCore { 54 46 … … 58 50 59 51 enum class GPUTextureFormat; 60 61 #if USE(METAL)62 using PlatformDrawableSmartPtr = RetainPtr<CAMetalDrawable>;63 using PlatformSwapLayerSmartPtr = RetainPtr<WebGPULayer>;64 #endif65 52 66 53 class GPUSwapChain : public RefCounted<GPUSwapChain> { -
trunk/Source/WebCore/platform/graphics/gpu/GPUTexture.h
r267777 r268603 28 28 #if ENABLE(WEBGPU) 29 29 30 #include "GPUPlatformTypes.h" 30 31 #include "GPUTextureUsage.h" 31 32 #include <wtf/OptionSet.h> 32 33 #include <wtf/RefCounted.h> 33 34 #include <wtf/RefPtr.h> 34 35 #if USE(METAL)36 #include <wtf/RetainPtr.h>37 #endif38 39 #if USE(METAL)40 OBJC_PROTOCOL(MTLTexture);41 #endif42 35 43 36 namespace WebCore { … … 47 40 48 41 struct GPUTextureDescriptor; 49 50 #if USE(METAL)51 using PlatformTexture = MTLTexture;52 using PlatformTextureSmartPtr = RetainPtr<MTLTexture>;53 #endif54 42 55 43 class GPUTexture : public RefCounted<GPUTexture> {
Note: See TracChangeset
for help on using the changeset viewer.