Bug 169535

Summary: WebGPU Backend
Product: WebKit Reporter: Dean Jackson <dino>
Component: New BugsAssignee: Dean Jackson <dino>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, commit-queue, esprehn+autocc, graouts, gyuyoung.kim, jonlee, kondapallykalyan, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 167952    
Attachments:
Description Flags
Patch none

Description Dean Jackson 2017-03-12 19:34:08 PDT
WebGPU Backend
Comment 1 Radar WebKit Bug Importer 2017-03-12 19:34:52 PDT
<rdar://problem/31002364>
Comment 2 Dean Jackson 2017-03-12 19:40:40 PDT
Created attachment 304216 [details]
Patch
Comment 3 Jon Lee 2017-03-12 19:59:49 PDT
Comment on attachment 304216 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=304216&action=review

> Source/WebCore/platform/graphics/cocoa/GPUBufferMetal.mm:45
> +    m_buffer = (MTLBuffer *)[device->platformDevice() newBufferWithBytes:data->baseAddress() length:data->byteLength() options:MTLResourceOptionCPUCacheModeDefault];

adoptNS()?

> Source/WebCore/platform/graphics/cocoa/GPUCommandQueueMetal.mm:45
> +    m_commandQueue = (MTLCommandQueue *)[device->platformDevice() newCommandQueue];

adoptNS()?

> Source/WebCore/platform/graphics/cocoa/GPUDepthStencilDescriptorMetal.mm:42
> +    m_depthStencilDescriptor = (MTLDepthStencilDescriptor *)[MTLDepthStencilDescriptor new];

adoptNS()?

> Source/WebCore/platform/graphics/cocoa/GPUDepthStencilStateMetal.mm:46
> +    m_depthStencilState = (MTLDepthStencilState *)[device->platformDevice() newDepthStencilStateWithDescriptor:descriptor->platformDepthStencilDescriptor()];

adoptNS()?

> Source/WebCore/platform/graphics/cocoa/GPUFunctionMetal.mm:44
> +    m_function = (MTLFunction *)[library->platformLibrary() newFunctionWithName:name];

adoptNS()?

> Source/WebCore/platform/graphics/cocoa/GPULibraryMetal.mm:46
> +    m_library = (MTLLibrary *)[device->platformDevice() newLibraryWithSource:sourceCode options:nil error:&error];

adoptNS()?

> Source/WebCore/platform/graphics/cocoa/GPURenderPassColorAttachmentDescriptorMetal.mm:52
> +    MTLRenderPassColorAttachmentDescriptor *colorAttachmentDescriptor = static_cast<MTLRenderPassColorAttachmentDescriptor*>(m_renderPassAttachmentDescriptor.get());

space: static_cast<MTLRenderPassColorAttachmentDescriptor *>

> Source/WebCore/platform/graphics/cocoa/GPURenderPassColorAttachmentDescriptorMetal.mm:72
> +    return static_cast<MTLRenderPassColorAttachmentDescriptor*>(platformRenderPassAttachmentDescriptor());

space: static_cast<MTLRenderPassColorAttachmentDescriptor *>

> Source/WebCore/platform/graphics/cocoa/GPURenderPassDepthAttachmentDescriptorMetal.mm:52
> +    MTLRenderPassDepthAttachmentDescriptor *depthAttachmentDescriptor = static_cast<MTLRenderPassDepthAttachmentDescriptor*>(m_renderPassAttachmentDescriptor.get());

space: static_cast<MTLRenderPassDepthAttachmentDescriptor *>

> Source/WebCore/platform/graphics/cocoa/GPURenderPassDepthAttachmentDescriptorMetal.mm:67
> +    return static_cast<MTLRenderPassDepthAttachmentDescriptor*>(platformRenderPassAttachmentDescriptor());

space: static_cast<MTLRenderPassDepthAttachmentDescriptor *>

> Source/WebCore/platform/graphics/cocoa/GPURenderPassDescriptorMetal.mm:43
> +    m_renderPassDescriptor = (MTLRenderPassDescriptor *)[MTLRenderPassDescriptor new];

adoptNS()?

> Source/WebCore/platform/graphics/cocoa/GPURenderPipelineDescriptorMetal.mm:43
> +    m_renderPipelineDescriptor = (MTLRenderPipelineDescriptor *)[MTLRenderPipelineDescriptor new];

adoptNS()?

> Source/WebCore/platform/graphics/cocoa/GPURenderPipelineStateMetal.mm:46
> +    m_renderPipelineState = (MTLRenderPipelineState *)[device->platformDevice() newRenderPipelineStateWithDescriptor:descriptor->platformRenderPipelineDescriptor() error:nil];

adoptNS()?

> Source/WebCore/platform/graphics/cocoa/GPUTextureMetal.mm:47
> +    m_texture = (MTLTexture *)[device->platformDevice() newTextureWithDescriptor:descriptor->platformTextureDescriptor()];

adoptNS()?
Comment 4 Jon Lee 2017-03-12 20:26:50 PDT
Comment on attachment 304216 [details]
Patch

Confirmed with Dean out-of-band that adoptNS() was needed. Will check in patch with adoptNS() wrapped in the places I marked.
Comment 5 Jon Lee 2017-03-12 20:41:35 PDT
Committed r213780.
Comment 6 Jon Lee 2017-03-13 00:11:29 PDT
*** Bug 169367 has been marked as a duplicate of this bug. ***
Comment 7 Jon Lee 2017-03-13 00:11:57 PDT
*** Bug 169368 has been marked as a duplicate of this bug. ***
Comment 8 Jon Lee 2017-03-13 00:12:00 PDT
*** Bug 169370 has been marked as a duplicate of this bug. ***
Comment 9 Jon Lee 2017-03-13 00:12:03 PDT
*** Bug 169372 has been marked as a duplicate of this bug. ***