Changeset 243636 in webkit
- Timestamp:
- Mar 28, 2019, 7:19:37 PM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 23 edited
-
ChangeLog (modified) (1 diff)
-
Modules/webgpu/GPUBindGroupLayoutBinding.h (modified) (1 diff)
-
Modules/webgpu/WHLSL/Metal/WHLSLVertexBufferIndexCalculator.cpp (modified) (1 diff)
-
Modules/webgpu/WHLSL/Metal/WHLSLVertexBufferIndexCalculator.h (modified) (1 diff)
-
Modules/webgpu/WebGPUBindGroupBinding.h (modified) (1 diff)
-
Modules/webgpu/WebGPUBindGroupDescriptor.cpp (modified) (4 diffs)
-
Modules/webgpu/WebGPUBuffer.cpp (modified) (1 diff)
-
Modules/webgpu/WebGPUBuffer.h (modified) (1 diff)
-
Modules/webgpu/WebGPUBufferBinding.h (modified) (1 diff)
-
Modules/webgpu/WebGPURenderPassEncoder.cpp (modified) (3 diffs)
-
Modules/webgpu/WebGPURenderPassEncoder.h (modified) (1 diff)
-
platform/graphics/gpu/GPUBindGroupBinding.h (modified) (1 diff)
-
platform/graphics/gpu/GPUBindGroupLayout.h (modified) (1 diff)
-
platform/graphics/gpu/GPUBufferBinding.h (modified) (1 diff)
-
platform/graphics/gpu/GPUExtent3D.h (modified) (1 diff)
-
platform/graphics/gpu/GPULimits.h (modified) (1 diff)
-
platform/graphics/gpu/GPURenderPassEncoder.h (modified) (1 diff)
-
platform/graphics/gpu/GPUTextureDescriptor.h (modified) (1 diff)
-
platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm (modified) (2 diffs)
-
platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm (modified) (2 diffs)
-
platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm (modified) (2 diffs)
-
platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm (modified) (1 diff)
-
platform/graphics/gpu/cocoa/GPUTextureMetal.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r243635 r243636 1 2019-03-28 Justin Fan <justin_fan@apple.com> 2 3 [Web GPU] Replace 'unsigned long' with 'unsigned' when implementing u32 variables 4 https://bugs.webkit.org/show_bug.cgi?id=194618 5 <rdar://problem/48055796> 6 7 Reviewed by Myles C. Maxfield. 8 9 WebIDL for "unsigned" on 64-bit is "unsigned long". Update Web GPU to match. 10 11 No new tests; no change in behavior. 12 13 * Modules/webgpu/GPUBindGroupLayoutBinding.h: 14 * Modules/webgpu/WHLSL/Metal/WHLSLVertexBufferIndexCalculator.cpp: 15 (WebCore::WHLSL::Metal::calculateVertexBufferIndex): 16 * Modules/webgpu/WHLSL/Metal/WHLSLVertexBufferIndexCalculator.h: 17 * Modules/webgpu/WebGPUBindGroupBinding.h: 18 * Modules/webgpu/WebGPUBindGroupDescriptor.cpp: 19 (WebCore::validateBufferBindingType): 20 (WebCore::WebGPUBindGroupDescriptor::tryCreateGPUBindGroupDescriptor const): 21 * Modules/webgpu/WebGPUBuffer.cpp: 22 (WebCore::WebGPUBuffer::setSubData): 23 * Modules/webgpu/WebGPUBuffer.h: 24 * Modules/webgpu/WebGPUBufferBinding.h: 25 * Modules/webgpu/WebGPURenderPassEncoder.cpp: 26 (WebCore::WebGPURenderPassEncoder::setVertexBuffers): 27 (WebCore::WebGPURenderPassEncoder::draw): 28 * Modules/webgpu/WebGPURenderPassEncoder.h: 29 * platform/graphics/gpu/GPUBindGroupBinding.h: 30 * platform/graphics/gpu/GPUBindGroupLayout.h: 31 * platform/graphics/gpu/GPUBufferBinding.h: 32 * platform/graphics/gpu/GPUExtent3D.h: 33 * platform/graphics/gpu/GPULimits.h: 34 * platform/graphics/gpu/GPURenderPassEncoder.h: 35 * platform/graphics/gpu/GPUTextureDescriptor.h: 36 * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm: 37 (WebCore::GPUBindGroupLayout::tryCreate): 38 * platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm: 39 (WebCore::GPUBindGroup::tryCreate): 40 * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm: 41 (WebCore::GPURenderPassEncoder::setVertexBuffers): 42 (WebCore::GPURenderPassEncoder::draw): 43 * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: 44 (WebCore::trySetInputStateForPipelineDescriptor): 45 * platform/graphics/gpu/cocoa/GPUTextureMetal.mm: 46 (WebCore::storageModeForPixelFormatAndSampleCount): 47 1 48 2019-03-28 Ryosuke Niwa <rniwa@webkit.org> 2 49 -
trunk/Source/WebCore/Modules/webgpu/GPUBindGroupLayoutBinding.h
r242972 r243636 42 42 43 43 struct GPUBindGroupLayoutBinding { 44 unsigned longbinding;44 unsigned binding; 45 45 GPUShaderStageFlags visibility; 46 46 GPUBindingType type; -
trunk/Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLVertexBufferIndexCalculator.cpp
r242571 r243636 35 35 namespace Metal { 36 36 37 unsigned long calculateVertexBufferIndex(unsigned longindex)37 unsigned calculateVertexBufferIndex(unsigned index) 38 38 { 39 39 // Reserve the first few MTLBuffer slots for argument buffers for GPUBindGroups. -
trunk/Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLVertexBufferIndexCalculator.h
r242571 r243636 34 34 namespace Metal { 35 35 36 unsigned long calculateVertexBufferIndex(unsigned long);36 unsigned calculateVertexBufferIndex(unsigned); 37 37 38 38 } -
trunk/Source/WebCore/Modules/webgpu/WebGPUBindGroupBinding.h
r242615 r243636 38 38 39 39 struct WebGPUBindGroupBinding { 40 unsigned longbinding;40 unsigned binding; 41 41 WebGPUBindingResource resource; 42 42 }; -
trunk/Source/WebCore/Modules/webgpu/WebGPUBindGroupDescriptor.cpp
r243563 r243636 45 45 case GPUBindingType::UniformBuffer: 46 46 if (!buffer->isUniform()) { 47 LOG(WebGPU, "%s: GPUBuffer resource for binding % lu does not have UNIFORM usage!", functionName, binding.binding);47 LOG(WebGPU, "%s: GPUBuffer resource for binding %u does not have UNIFORM usage!", functionName, binding.binding); 48 48 return false; 49 49 } … … 51 51 case GPUBindingType::StorageBuffer: 52 52 if (!buffer->isStorage()) { 53 LOG(WebGPU, "%s: GPUBuffer resource for binding % lu does not have STORAGE usage!", functionName, binding.binding);53 LOG(WebGPU, "%s: GPUBuffer resource for binding %u does not have STORAGE usage!", functionName, binding.binding); 54 54 return false; 55 55 } 56 56 return true; 57 57 default: 58 LOG(WebGPU, "%s: Layout binding % lu is not a buffer-type resource!", functionName, binding.binding);58 LOG(WebGPU, "%s: Layout binding %u is not a buffer-type resource!", functionName, binding.binding); 59 59 return false; 60 60 } … … 83 83 auto iterator = layoutMap.find(binding.binding); 84 84 if (iterator == layoutMap.end()) { 85 LOG(WebGPU, "%s: GPUBindGroupLayoutBinding % lu not found in GPUBindGroupLayout!", functionName, binding.binding);85 LOG(WebGPU, "%s: GPUBindGroupLayoutBinding %u not found in GPUBindGroupLayout!", functionName, binding.binding); 86 86 return WTF::nullopt; 87 87 } … … 120 120 auto bindingResource = WTF::visit(bindingResourceVisitor, binding.resource); 121 121 if (!bindingResource) { 122 LOG(WebGPU, "%s: Invalid resource for binding % lu!", functionName, layoutBinding.binding);122 LOG(WebGPU, "%s: Invalid resource for binding %u!", functionName, layoutBinding.binding); 123 123 return WTF::nullopt; 124 124 } -
trunk/Source/WebCore/Modules/webgpu/WebGPUBuffer.cpp
r242164 r243636 43 43 } 44 44 45 void WebGPUBuffer::setSubData(unsigned long longoffset, const JSC::ArrayBuffer& data)45 void WebGPUBuffer::setSubData(unsigned long offset, const JSC::ArrayBuffer& data) 46 46 { 47 47 if (!m_buffer) -
trunk/Source/WebCore/Modules/webgpu/WebGPUBuffer.h
r243563 r243636 49 49 const GPUBuffer* buffer() const { return m_buffer.get(); } 50 50 51 void setSubData(unsigned long long, const JSC::ArrayBuffer&);51 void setSubData(unsigned long, const JSC::ArrayBuffer&); 52 52 using BufferMappingPromise = DOMPromiseDeferred<IDLInterface<JSC::ArrayBuffer>>; 53 53 void mapReadAsync(BufferMappingPromise&&); -
trunk/Source/WebCore/Modules/webgpu/WebGPUBufferBinding.h
r242164 r243636 35 35 struct WebGPUBufferBinding { 36 36 RefPtr<WebGPUBuffer> buffer; 37 unsigned long longoffset;38 unsigned long longsize;37 unsigned long offset; 38 unsigned long size; 39 39 }; 40 40 -
trunk/Source/WebCore/Modules/webgpu/WebGPURenderPassEncoder.cpp
r243627 r243636 61 61 } 62 62 63 void WebGPURenderPassEncoder::setVertexBuffers(unsigned longstartSlot, Vector<RefPtr<WebGPUBuffer>>&& buffers, Vector<unsigned long long>&& offsets)63 void WebGPURenderPassEncoder::setVertexBuffers(unsigned startSlot, Vector<RefPtr<WebGPUBuffer>>&& buffers, Vector<unsigned long long>&& offsets) 64 64 { 65 65 #if !LOG_DISABLED … … 75 75 } 76 76 if (startSlot + buffers.size() > maxVertexBuffers) { 77 LOG(WebGPU, "%s: Invalid startSlot % lu for %lu buffers!", functionName, startSlot, buffers.size());77 LOG(WebGPU, "%s: Invalid startSlot %u for %lu buffers!", functionName, startSlot, buffers.size()); 78 78 return; 79 79 } … … 99 99 } 100 100 101 void WebGPURenderPassEncoder::draw(unsigned long vertexCount, unsigned long instanceCount, unsigned long firstVertex, unsigned longfirstInstance)101 void WebGPURenderPassEncoder::draw(unsigned vertexCount, unsigned instanceCount, unsigned firstVertex, unsigned firstInstance) 102 102 { 103 103 if (!m_passEncoder) { -
trunk/Source/WebCore/Modules/webgpu/WebGPURenderPassEncoder.h
r243627 r243636 44 44 45 45 void setPipeline(const WebGPURenderPipeline&); 46 void setVertexBuffers(unsigned long, Vector<RefPtr<WebGPUBuffer>>&&, Vector<unsigned long long>&&);47 void draw(unsigned long vertexCount, unsigned long instanceCount, unsigned long firstVertex, unsigned longfirstInstance);46 void setVertexBuffers(unsigned, Vector<RefPtr<WebGPUBuffer>>&&, Vector<unsigned long long>&&); 47 void draw(unsigned vertexCount, unsigned instanceCount, unsigned firstVertex, unsigned firstInstance); 48 48 49 49 private: -
trunk/Source/WebCore/platform/graphics/gpu/GPUBindGroupBinding.h
r243563 r243636 38 38 39 39 struct GPUBindGroupBinding { 40 unsigned longbinding;40 unsigned binding; 41 41 GPUBindingResource resource; 42 42 }; -
trunk/Source/WebCore/platform/graphics/gpu/GPUBindGroupLayout.h
r242766 r243636 48 48 static RefPtr<GPUBindGroupLayout> tryCreate(const GPUDevice&, const GPUBindGroupLayoutDescriptor&); 49 49 50 using BindingsMapType = HashMap<unsigned long long, GPUBindGroupLayoutBinding, WTF::IntHash<unsigned long long>, WTF::UnsignedWithZeroKeyHashTraits<unsigned longlong>>;50 using BindingsMapType = HashMap<unsigned long, GPUBindGroupLayoutBinding, WTF::IntHash<unsigned long>, WTF::UnsignedWithZeroKeyHashTraits<unsigned long>>; 51 51 const BindingsMapType& bindingsMap() const { return m_bindingsMap; } 52 52 #if USE(METAL) -
trunk/Source/WebCore/platform/graphics/gpu/GPUBufferBinding.h
r242164 r243636 35 35 struct GPUBufferBinding { 36 36 Ref<GPUBuffer> buffer; 37 unsigned long longoffset;38 unsigned long longsize;37 unsigned long offset; 38 unsigned long size; 39 39 }; 40 40 -
trunk/Source/WebCore/platform/graphics/gpu/GPUExtent3D.h
r241048 r243636 31 31 32 32 struct GPUExtent3D { 33 unsigned longwidth;34 unsigned longheight;35 unsigned longdepth;33 unsigned width; 34 unsigned height; 35 unsigned depth; 36 36 }; 37 37 -
trunk/Source/WebCore/platform/graphics/gpu/GPULimits.h
r240898 r243636 30 30 namespace WebCore { 31 31 32 const unsigned longmaxVertexBuffers = 16;32 const unsigned maxVertexBuffers = 16; 33 33 34 34 } // namespace WebCore -
trunk/Source/WebCore/platform/graphics/gpu/GPURenderPassEncoder.h
r243627 r243636 53 53 54 54 void setPipeline(Ref<const GPURenderPipeline>&&); 55 void setVertexBuffers(unsigned long, Vector<Ref<GPUBuffer>>&&, Vector<unsigned long long>&&);56 void draw(unsigned long vertexCount, unsigned long instanceCount, unsigned long firstVertex, unsigned longfirstInstance);55 void setVertexBuffers(unsigned, Vector<Ref<GPUBuffer>>&&, Vector<unsigned long long>&&); 56 void draw(unsigned vertexCount, unsigned instanceCount, unsigned firstVertex, unsigned firstInstance); 57 57 58 58 private: -
trunk/Source/WebCore/platform/graphics/gpu/GPUTextureDescriptor.h
r242972 r243636 42 42 struct GPUTextureDescriptor { 43 43 GPUExtent3D size; 44 unsigned longarrayLayerCount;45 unsigned longmipLevelCount;46 unsigned longsampleCount;44 unsigned arrayLayerCount; 45 unsigned mipLevelCount; 46 unsigned sampleCount; 47 47 GPUTextureDimension dimension; 48 48 GPUTextureFormat format; -
trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm
r242972 r243636 90 90 for (const auto& binding : descriptor.bindings) { 91 91 if (!bindingsMap.add(binding.binding, binding)) { 92 LOG(WebGPU, "GPUBindGroupLayout::tryCreate(): Duplicate binding % lu found in GPUBindGroupLayoutDescriptor!", binding.binding);92 LOG(WebGPU, "GPUBindGroupLayout::tryCreate(): Duplicate binding %u found in GPUBindGroupLayoutDescriptor!", binding.binding); 93 93 return nullptr; 94 94 } … … 100 100 END_BLOCK_OBJC_EXCEPTIONS; 101 101 if (!mtlArgument) { 102 LOG(WebGPU, "GPUBindGroupLayout::tryCreate(): Unable to create MTLArgumentDescriptor for binding % lu!", binding.binding);102 LOG(WebGPU, "GPUBindGroupLayout::tryCreate(): Unable to create MTLArgumentDescriptor for binding %u!", binding.binding); 103 103 return nullptr; 104 104 } -
trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm
r243627 r243636 161 161 auto layoutIterator = layoutBindingsMap.find(index); 162 162 if (layoutIterator == layoutBindingsMap.end()) { 163 LOG(WebGPU, "%s: GPUBindGroupBinding % lu not found in GPUBindGroupLayout!", functionName, index);163 LOG(WebGPU, "%s: GPUBindGroupBinding %u not found in GPUBindGroupLayout!", functionName, index); 164 164 return nullptr; 165 165 } … … 173 173 174 174 if (isForVertex && !vertexEncoder) { 175 LOG(WebGPU, "%s: No vertex argument encoder found for binding % lu!", functionName, index);175 LOG(WebGPU, "%s: No vertex argument encoder found for binding %u!", functionName, index); 176 176 return nullptr; 177 177 } 178 178 if (isForFragment && !fragmentEncoder) { 179 LOG(WebGPU, "%s: No fragment argument encoder found for binding % lu!", functionName, index);179 LOG(WebGPU, "%s: No fragment argument encoder found for binding %u!", functionName, index); 180 180 return nullptr; 181 181 } 182 182 if (isForCompute && !computeEncoder) { 183 LOG(WebGPU, "%s: No compute argument encoder found for binding % lu!", functionName, index);183 LOG(WebGPU, "%s: No compute argument encoder found for binding %u!", functionName, index); 184 184 return nullptr; 185 185 } -
trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm
r243627 r243636 205 205 } 206 206 207 void GPURenderPassEncoder::setVertexBuffers(unsigned longindex, Vector<Ref<GPUBuffer>>&& buffers, Vector<unsigned long long>&& offsets)207 void GPURenderPassEncoder::setVertexBuffers(unsigned index, Vector<Ref<GPUBuffer>>&& buffers, Vector<unsigned long long>&& offsets) 208 208 { 209 209 if (!m_platformRenderPassEncoder) { … … 246 246 } 247 247 248 void GPURenderPassEncoder::draw(unsigned long vertexCount, unsigned long instanceCount, unsigned long firstVertex, unsigned longfirstInstance)248 void GPURenderPassEncoder::draw(unsigned vertexCount, unsigned instanceCount, unsigned firstVertex, unsigned firstInstance) 249 249 { 250 250 if (!m_platformRenderPassEncoder) { -
trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm
r243627 r243636 332 332 // Maximum number of vertex attributes to be supported by Web GPU. 333 333 if (location >= 16) { 334 LOG(WebGPU, "%s: Invalid shaderLocation % lu for vertex attribute!", functionName, location);334 LOG(WebGPU, "%s: Invalid shaderLocation %u for vertex attribute!", functionName, location); 335 335 return false; 336 336 } 337 337 if (attributes[i].inputSlot >= maxVertexBuffers) { 338 LOG(WebGPU, "%s: Invalid inputSlot % lu for vertex attribute %lu!", functionName, attributes[i].inputSlot, location);338 LOG(WebGPU, "%s: Invalid inputSlot %u for vertex attribute %u!", functionName, attributes[i].inputSlot, location); 339 339 return false; 340 340 } -
trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPUTextureMetal.mm
r242575 r243636 84 84 85 85 #if !PLATFORM(MAC) 86 static MTLStorageMode storageModeForPixelFormatAndSampleCount(MTLPixelFormat format, unsigned longsamples)86 static MTLStorageMode storageModeForPixelFormatAndSampleCount(MTLPixelFormat format, unsigned samples) 87 87 { 88 88 // Depth, Stencil, DepthStencil, and Multisample textures must be allocated with the MTLStorageModePrivate resource option.
Note:
See TracChangeset
for help on using the changeset viewer.