Bug 169535 - WebGPU Backend
Summary: WebGPU Backend
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dean Jackson
URL:
Keywords: InRadar
: 169367 169368 169370 169372 (view as bug list)
Depends on:
Blocks: 167952
  Show dependency treegraph
 
Reported: 2017-03-12 19:34 PDT by Dean Jackson
Modified: 2017-03-13 00:12 PDT (History)
8 users (show)

See Also:


Attachments
Patch (206.78 KB, patch)
2017-03-12 19:40 PDT, Dean Jackson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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. ***