nir: Share get_io_offset handling in nir_lower_io.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 12 Jul 2016 09:16:30 +0000 (02:16 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Sat, 16 Jul 2016 00:17:09 +0000 (17:17 -0700)
commit349fe79c9bc9bd20b877f0425763509208179b47
treef3fedcc7564af5da9891f6ec7e0b59fef3012696
parent7171a9a87d001d4958a8fb14a78c8235ba4e7e26
nir: Share get_io_offset handling in nir_lower_io.

The load/store/atomic cases all duplicated the get_io_offset code, with
a few tiny differences: stores didn't bother checking for per-vertex
inputs, because they can't be stored to, and atomics didn't check at
all, since shared variables aren't per-vertex.

However, it's harmless to check, and allows us to share more code.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/nir/nir_lower_io.c