Bug 211691 - [WebGPU] Implement texture views
Summary: [WebGPU] Implement texture views
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Myles C. Maxfield
URL:
Keywords: InRadar
Depends on: 211882
Blocks:
  Show dependency treegraph
 
Reported: 2020-05-10 02:40 PDT by Myles C. Maxfield
Modified: 2020-05-20 12:34 PDT (History)
12 users (show)

See Also:


Attachments
WIP (32.30 KB, patch)
2020-05-10 02:42 PDT, Myles C. Maxfield
no flags Details | Formatted Diff | Diff
Rebased (30.80 KB, patch)
2020-05-19 00:15 PDT, Myles C. Maxfield
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Myles C. Maxfield 2020-05-10 02:40:20 PDT
[WebGPU] Implement texture views
Comment 1 Myles C. Maxfield 2020-05-10 02:42:17 PDT
Created attachment 398970 [details]
WIP
Comment 2 Myles C. Maxfield 2020-05-10 02:42:20 PDT
<rdar://problem/54533652>
Comment 3 Myles C. Maxfield 2020-05-10 02:42:47 PDT
Comment on attachment 398970 [details]
WIP

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

> Source/WebCore/ChangeLog:11
> +        - Figure out what to do about GPUTextureAspect

Also delete createDefaultView(), and make sure default values work.
Comment 4 Myles C. Maxfield 2020-05-10 02:44:42 PDT
Comment on attachment 398970 [details]
WIP

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

>> Source/WebCore/ChangeLog:11
>> +        - Figure out what to do about GPUTextureAspect
> 
> Also delete createDefaultView(), and make sure default values work.

Also also: Write all the stuff in this patch in the spec: https://gpuweb.github.io/gpuweb/#textureview-createview
Comment 5 Myles C. Maxfield 2020-05-10 19:55:52 PDT
Comment on attachment 398970 [details]
WIP

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

> Source/WebCore/platform/graphics/gpu/cocoa/GPUTextureMetal.mm:360
> +    texture = adoptNS([m_platformTexture newTextureViewWithPixelFormat:metalPixelFormat textureType:textureType.value() levels:levels.value() slices:slices.value()]);

If the view is the same as the underlying texture, we can avoid this call.
Comment 6 Myles C. Maxfield 2020-05-18 23:49:51 PDT
From the spec:

> optional GPUTextureViewDescriptor descriptor = {}

This doesn't make sense to me.
Comment 7 Myles C. Maxfield 2020-05-19 00:15:48 PDT
Created attachment 399714 [details]
Rebased
Comment 8 Myles C. Maxfield 2020-05-19 00:17:26 PDT
mipLevelCount: If 0, defaults to texture.mipLevelCount − baseMipLevel.
arrayLayerCount: If 0, defaults to texture.size.depth − baseArrayLayer.
Comment 9 Myles C. Maxfield 2020-05-19 00:18:26 PDT
> If texture.size.depth is greater than 1 and arrayLayerCount is 0

This seems kind of silly
Comment 10 Myles C. Maxfield 2020-05-20 12:34:28 PDT
Comment on attachment 399714 [details]
Rebased

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

> Source/WebCore/platform/graphics/gpu/cocoa/GPUTextureMetal.mm:308
> +            return parentSampleCount == 1 ? MTLTextureType2DArray : MTLTextureType2DMultisampleArray;

MTLTextureType2DMultisampleArray doesn't exist on iOS