metal: Remove MTLTextureUsagePixelFormatView from IOSurface textures
Unlike the other texture usages, MTLTextureUsagePixelFormatView is
unnecessary for any potential use of the IOSurface backed WGPUTextures.
MTLTextureUsagePixelFormatView is only needed for interpreting combined
depth-stencil textures as depth or stencil which doesn't apply here.
Bug: 388872587
Change-Id: I53f9ff4b443dc66ecb770f8283e334fb47083d41
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/223274
Auto-Submit: Sunny Sachanandani <sunnyps@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/dawn/native/metal/SharedTextureMemoryMTL.mm b/src/dawn/native/metal/SharedTextureMemoryMTL.mm
index fd791e7..ac2d013 100644
--- a/src/dawn/native/metal/SharedTextureMemoryMTL.mm
+++ b/src/dawn/native/metal/SharedTextureMemoryMTL.mm
@@ -40,13 +40,12 @@
namespace dawn::native::metal {
namespace {
-// NOTE: When creating MTLTextures, we pass all Metal texture usages. See
-// discussion in https://bugs.chromium.org/p/dawn/issues/detail?id=2152#c14 and
-// following comments for both (a) why this is necessary and (b) why it is not
-// harmful to performance.
-const MTLTextureUsage kMetalTextureUsage = MTLTextureUsageShaderWrite | MTLTextureUsageShaderRead |
- MTLTextureUsagePixelFormatView |
- MTLTextureUsageRenderTarget;
+// NOTE: When creating MTLTextures, we pass all relevant Metal texture usages.
+// See discussion in https://bugs.chromium.org/p/dawn/issues/detail?id=2152#c14
+// and following comments for both (a) why this is necessary and (b) why it is
+// not harmful to performance.
+const MTLTextureUsage kMetalTextureUsage =
+ MTLTextureUsageShaderWrite | MTLTextureUsageShaderRead | MTLTextureUsageRenderTarget;
ResultOrError<wgpu::TextureFormat> GetFormatEquivalentToIOSurfaceFormat(uint32_t format) {
switch (format) {