aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorKristian H. Kristensen <[email protected]>2019-04-18 10:40:45 -0700
committerKristian H. Kristensen <[email protected]>2019-04-18 11:46:13 -0700
commit9c82a55efc4835af0ec7a6e1afc8e5ba00178c17 (patch)
tree8cabab9cb438262cea56931ac41d539fdb4527ed /src/gallium
parent6aa211b3169e86271caf1251d8fb7f88f3e42ebd (diff)
freedreno/a6xx: Add helper for incrementing regid
Increments the regid by specified amount unless regid is is r63.x (invalid). Signed-off-by: Kristian H. Kristensen <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/freedreno/a6xx/fd6_program.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_program.c b/src/gallium/drivers/freedreno/a6xx/fd6_program.c
index d44ecf42577..44c9e8a689b 100644
--- a/src/gallium/drivers/freedreno/a6xx/fd6_program.c
+++ b/src/gallium/drivers/freedreno/a6xx/fd6_program.c
@@ -287,6 +287,15 @@ setup_stages(struct fd6_program_state *state, struct stage *s, bool binning_pass
}
}
+static inline uint32_t
+next_regid(uint32_t reg, uint32_t increment)
+{
+ if (reg == regid(63,0))
+ return regid(63,0);
+ else
+ return reg + increment;
+}
+
static void
setup_stateobj(struct fd_ringbuffer *ring,
struct fd6_program_state *state, bool binning_pass)
@@ -327,7 +336,7 @@ setup_stateobj(struct fd_ringbuffer *ring,
samp_mask_regid = ir3_find_sysval_regid(s[FS].v, SYSTEM_VALUE_SAMPLE_MASK_IN);
face_regid = ir3_find_sysval_regid(s[FS].v, SYSTEM_VALUE_FRONT_FACE);
coord_regid = ir3_find_sysval_regid(s[FS].v, SYSTEM_VALUE_FRAG_COORD);
- zwcoord_regid = (coord_regid == regid(63,0)) ? regid(63,0) : (coord_regid + 2);
+ zwcoord_regid = next_regid(coord_regid, 2);
vcoord_regid = ir3_find_sysval_regid(s[FS].v, SYSTEM_VALUE_VARYING_COORD);
posz_regid = ir3_find_output_regid(s[FS].v, FRAG_RESULT_DEPTH);