gfx-rs / wgpu

A cross-platform, safe, pure-Rust graphics API.
https://wgpu.rs
Apache License 2.0
11.51k stars 858 forks source link

regression: Incompatible color attachments #5904

Open sagudev opened 4 days ago

sagudev commented 4 days ago

While updating servo from 1e784c9c0af7a785b62e3b6840ed012a7477520f to f25e07b984ab391628d9568296d5970981d79d8b in https://github.com/servo/servo/pull/32665, there was one unexpected FAIL result: webgpu:api,operation,texture_view,format_reinterpretation:render_and_resolve_attachment:* (src of the test: https://github.com/gpuweb/cts/blob/9c8e5ba09314be2cec8a5cbd69b7b2f0fec7f89f/src/webgpu/api/operation/texture_view/format_reinterpretation.spec.ts#L191C9-L191C38)

Description On f25e07b984ab391628d9568296d5970981d79d8b there is unexpected validation error:

Validation { source: ContextError { string: "RenderPass::end", cause: RenderPassError { scope: SetPipelineRender, inner: RenderCommand(IncompatiblePipelineTargets(IncompatibleColorAttachment { indices: [0], expected: [Some(Rgba8Unorm)], actual: [Some(Rgba8UnormSrgb)], res: ResourceErrorIdent { type: "RenderPipeline", label: "" } })) }, label_key: "label", label: "" }, description: "Validation Error\n\nCaused by:\n    In RenderPass::end\n    In a set_pipeline command\n    Render pipeline targets are incompatible with render pass\n    Incompatible color attachments at indices [0]: the RenderPass uses textures with formats [Some(Rgba8Unorm)] but the RenderPipeline with '' label uses attachments with formats [Some(Rgba8UnormSrgb)]\n" }

but 1e784c9c0af7a785b62e3b6840ed012a7477520f worked fine.

Repro steps I was able to reproduce what CTS does by tracing wgpu functions that are called by servo; repro is available here: https://github.com/sagudev/wgpu-problem/tree/render_and_resolve_attachment

EDIT: This is caused by 0a76c0fa84e5e8c10c62f0a19fb54b65c0a4f6e2

sagudev commented 4 days ago

This is caused by https://github.com/gfx-rs/wgpu/pull/5884, CC @Wumpf