aboutsummaryrefslogtreecommitdiffstats
path: root/src/broadcom/compiler/vir_register_allocate.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2019-04-11 13:27:22 -0700
committerEric Anholt <[email protected]>2019-04-12 15:58:28 -0700
commit89b7df552badea9560765dff337232bca213781f (patch)
tree692f38897863b3e17aa317fb61622fb2377b9be3 /src/broadcom/compiler/vir_register_allocate.c
parentb88ef3bd76a1fad3c2a99ea19df62f7be8c57961 (diff)
v3d: Add and use a define for the number of channels in a QPU invocation.
A shader invocation always executes 16 channels together, so we often end up multiplying things by this magic 16 number. Give it a name.
Diffstat (limited to 'src/broadcom/compiler/vir_register_allocate.c')
-rw-r--r--src/broadcom/compiler/vir_register_allocate.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/broadcom/compiler/vir_register_allocate.c b/src/broadcom/compiler/vir_register_allocate.c
index a55b23f74ed..1ffb37f1a38 100644
--- a/src/broadcom/compiler/vir_register_allocate.c
+++ b/src/broadcom/compiler/vir_register_allocate.c
@@ -205,7 +205,7 @@ v3d_spill_reg(struct v3d_compile *c, int spill_temp)
if (!is_uniform) {
uint32_t spill_offset = c->spill_size;
- c->spill_size += 16 * sizeof(uint32_t);
+ c->spill_size += V3D_CHANNELS * sizeof(uint32_t);
if (spill_offset == 0)
v3d_setup_spill_base(c);
@@ -624,7 +624,8 @@ v3d_register_allocate(struct v3d_compile *c, bool *spilled)
* conformance tests to make sure that spilling works.
*/
int force_register_spills = 0;
- if (c->spill_size < 16 * sizeof(uint32_t) * force_register_spills) {
+ if (c->spill_size <
+ V3D_CHANNELS * sizeof(uint32_t) * force_register_spills) {
int node = v3d_choose_spill_node(c, g, temp_to_node);
if (node != -1) {
v3d_spill_reg(c, map[node].temp);