nir: add bit_size parameter to system values with multiple allowed bit sizes

v2: add assert to verify we have at least one valid bit_size
v3: fix use of load_front_face in nir_lower_two_sided_color and tgsi_to_nir

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:
Karol Herbst
2018-12-04 16:40:30 +01:00
parent 4125211e9c
commit 0a793c78a3
5 changed files with 19 additions and 9 deletions

View File

@@ -261,8 +261,8 @@ convert_block(nir_block *block, nir_builder *b)
if (sysval == NULL) {
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;
sysval = nir_load_system_value(b, sysval_op, 0,
load_deref->dest.ssa.bit_size);
}
nir_ssa_def_rewrite_uses(&load_deref->dest.ssa, nir_src_for_ssa(sysval));