mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-20 06:21:13 +01:00
Per VUID-RuntimeSpirv-None-04745, all accesses into a PushConstant-storage-class variable that are arrays must use dynamically uniform indices; this restriction also applies to vectors. Naga was emitting `OpAccessChain` with per-invocation (non-uniform) indices directly into push-constant vectors, which is undefined behavior under that rule -- observed on RADV as every invocation silently reading element 0 of the vector. Add a special case to `write_checked_load`, alongside the existing matCx2 ones, that loads the whole vector and uses `OpVectorExtractDynamic` instead, which isn't subject to the restriction. Fixes gfx-rs/wgpu#8612. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>