[WebGPU] Implement texture views
Created attachment 398970 [details] WIP
<rdar://problem/54533652>
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 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 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.
From the spec: > optional GPUTextureViewDescriptor descriptor = {} This doesn't make sense to me.
Created attachment 399714 [details] Rebased
mipLevelCount: If 0, defaults to texture.mipLevelCount − baseMipLevel. arrayLayerCount: If 0, defaults to texture.size.depth − baseArrayLayer.
> If texture.size.depth is greater than 1 and arrayLayerCount is 0 This seems kind of silly
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