mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
SPIR-V doesn't allow the `Flat`, `NoPerspective`, `Sample` or `Centroid` decorations on fragment shaders outputs, but the spirv frontend was applying default interpolation to all outputs unconditionally. This wasn't an issue for most shaders since they output floats and the default values for them don't interfere with SPIR-V semantics, but if the shader returned a uint or int the interpolation would be set to `Flat` which as stated above is disallowed. This commit fixes the issue by only running the default interpolation code when constructing the entry point and if the stage/IO allow it.