Skip to content

nir: I/O vector access improvements

Faith Ekstrand requested to merge gfxstrand/mesa:nir/lower-io-compact into main

This MR does two things:

  1. On NVIDIA, we can indirect access anything, including within a vector and I'd like to avoid lowering to if-ladders if we can. The first 4 commits of this MR make it so that we can indirect on compact variables such as tess levels and clip/cull distances. The annoying bit is that this means changing the interface of the type_size callback to nir_lower_io() which involves touching a lot of drivers.
  2. We also need to get SPIR-V doing the right thing on TCS outputs. Right now, if the SPIR-V has a write to a single component of a vector, spirv_to_nir emits a load/insert/store pattern which is potentially racy. On NVIDIA, there are CTS tests which actually hit this race so I need this for passing CTS. We have a NIR pass which lowers writes of this form to an if-ladder with write-masks which is what we use for most drivers.
Edited by Faith Ekstrand

Merge request reports