nir/system_values: Use the bit size from the load_deref
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 19 Oct 2018 15:51:47 +0000 (10:51 -0500)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 26 Oct 2018 16:45:29 +0000 (11:45 -0500)
This isn't a great solution for bit-sizes but we don't have a
particularly convenient way to get a bit size from the system value enum
and this keeps the lowering pass from changing it.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/compiler/nir/nir_lower_system_values.c

index 2820dcd1b3ce83139a0cdbbb780c469ad2e871e9..bde7eb11801a4243e27493226a27e84d20dc4523 100644 (file)
@@ -203,6 +203,7 @@ convert_block(nir_block *block, nir_builder *b)
          nir_intrinsic_op sysval_op =
             nir_intrinsic_from_system_value(var->data.location);
          sysval = nir_load_system_value(b, sysval_op, 0);
+         sysval->bit_size = load_deref->dest.ssa.bit_size;
       }
 
       nir_ssa_def_rewrite_uses(&load_deref->dest.ssa, nir_src_for_ssa(sysval));