From c535e041bdecc8c4636ba4810c010ab17fe084fb Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Fri, 22 Apr 2022 16:19:02 -0700 Subject: [PATCH] gpu: correct default TextureView.Descriptor.format value According to kangz `WGPUTextureFormat_Undefined` is the correct default value for `TextureView.Descriptor.format`. According to the spec, the default should be the associated _Texture_'s descriptor.format, but it seems Dawn internally handles this when set to `Undefined` - we will take the same approach. https://matrix.to/#/!MFogdGJfnZLrDmgkBN:matrix.org/$eVPXZMzewxJMZ_25K5jVV2N6SVriMUovkfXZI62Kq-k?via=matrix.org&via=mozilla.org&via=zinz.dev Helps hexops/mach#182 Signed-off-by: Stephen Gutekanst --- gpu/src/TextureView.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gpu/src/TextureView.zig b/gpu/src/TextureView.zig index a4d735f7..28bbc40f 100644 --- a/gpu/src/TextureView.zig +++ b/gpu/src/TextureView.zig @@ -27,7 +27,7 @@ pub inline fn setLabel(texture_view: TextureView, label: [:0]const u8) void { pub const Descriptor = struct { label: ?[*:0]const u8 = null, - format: Texture.Format, + format: Texture.Format = .none, dimension: TextureView.Dimension, base_mip_level: u32 = 0, mip_level_count: u32,