Quick answer: SPIR-V Cross output where vertex attributes and fragment outputs share locations? Cross-stage validators flag collision - declare explicit, non-overlapping locations.

Vertex location 0 = position; fragment output location 0 = color. Some backends reject the collision; others silently corrupt.

Use distinct location ranges

Vertex inputs: 0-15. Fragment outputs: 0-7 (still distinct register). Declare per-stage; no overlap.

Verify with spirv-val

spirv-val --target-env vulkan1.1 shader.spv

Catches cross-stage conflicts at validation time.

Use shared headers

Header defines location constants. Both stages include; mismatches become impossible.

“Locations are stage-local but conventionally shared. Cross-stage conflicts are easy to introduce; spirv-val catches them.”

Add spirv-val to your shader CI. The validator is fast; the bug class disappears.

Related reading