diff options
author | Iago Toral Quiroga <[email protected]> | 2019-06-06 09:41:33 +0200 |
---|---|---|
committer | Iago Toral Quiroga <[email protected]> | 2019-06-07 08:26:52 +0200 |
commit | 5e26e55e724f4eff28840cfb6922963069231902 (patch) | |
tree | a94afcf38d830e09f6abf3988ec364da51362f51 /src/broadcom/compiler/nir_to_vir.c | |
parent | 4e3297f7d4d87618bf896ac503e1f036a7b6befb (diff) |
v3d: add a helper to track variables that need point coordinates
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/broadcom/compiler/nir_to_vir.c')
-rw-r--r-- | src/broadcom/compiler/nir_to_vir.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/broadcom/compiler/nir_to_vir.c b/src/broadcom/compiler/nir_to_vir.c index 55e41e16b36..1e98e69efbc 100644 --- a/src/broadcom/compiler/nir_to_vir.c +++ b/src/broadcom/compiler/nir_to_vir.c @@ -1453,6 +1453,15 @@ ntq_setup_vpm_inputs(struct v3d_compile *c) } } +static bool +var_needs_point_coord(struct v3d_compile *c, nir_variable *var) +{ + return (var->data.location == VARYING_SLOT_PNTC || + (var->data.location >= VARYING_SLOT_VAR0 && + (c->fs_key->point_sprite_mask & + (1 << (var->data.location - VARYING_SLOT_VAR0))))); +} + static void ntq_setup_fs_inputs(struct v3d_compile *c) { @@ -1486,11 +1495,7 @@ ntq_setup_fs_inputs(struct v3d_compile *c) if (var->data.location == VARYING_SLOT_POS) { emit_fragcoord_input(c, loc); - } else if (var->data.location == VARYING_SLOT_PNTC || - (var->data.location >= VARYING_SLOT_VAR0 && - (c->fs_key->point_sprite_mask & - (1 << (var->data.location - - VARYING_SLOT_VAR0))))) { + } else if (var_needs_point_coord(c, var)) { c->inputs[loc * 4 + 0] = c->point_x; c->inputs[loc * 4 + 1] = c->point_y; } else { |