diff --git a/src/dawn/native/webgpu_absl_format.cpp b/src/dawn/native/webgpu_absl_format.cpp index 2550f4b1f5..8eddf467bb 100644 --- a/src/dawn/native/webgpu_absl_format.cpp +++ b/src/dawn/native/webgpu_absl_format.cpp @@ -181,16 +181,16 @@ absl::FormatConvertResult AbslFormatConv bool needsComma = false; for (ColorAttachmentIndex i : IterateBitSet(value->GetColorAttachmentsMask())) { + if (needsComma) { + s->Append(", "); + } + while (nextColorIndex < i) { s->Append(absl::StrFormat("%s, ", wgpu::TextureFormat::Undefined)); nextColorIndex++; needsComma = false; } - if (needsComma) { - s->Append(", "); - } - s->Append(absl::StrFormat("%s", value->GetColorAttachmentFormat(i))); nextColorIndex++;