aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_linking_helpers.c
diff options
context:
space:
mode:
authorConnor Abbott <[email protected]>2019-05-17 14:56:45 +0200
committerConnor Abbott <[email protected]>2019-07-08 14:14:53 +0200
commitf3e2c65041f274901018bbb5018e75b2f8ee4d8b (patch)
treea6d7ecf4cdb1a68649a23d5a8aa17bc707290b60 /src/compiler/nir/nir_linking_helpers.c
parentdd81d8808d30459592a1fff2673e768951426364 (diff)
nir: Return correct size in nir_assign_io_var_locations()
It was double-counting cases where multiple variables were assigned to the same slot, and not handling the case where the last variable is a compact variable. Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_linking_helpers.c')
-rw-r--r--src/compiler/nir/nir_linking_helpers.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/compiler/nir/nir_linking_helpers.c b/src/compiler/nir/nir_linking_helpers.c
index b85690983d5..28d2774cae2 100644
--- a/src/compiler/nir/nir_linking_helpers.c
+++ b/src/compiler/nir/nir_linking_helpers.c
@@ -1064,7 +1064,6 @@ nir_assign_io_var_locations(struct exec_list *var_list, unsigned *size,
if (processed) {
unsigned driver_location = assigned_locations[var->data.location];
var->data.driver_location = driver_location;
- *size += glsl_count_attribute_slots(type, false);
/* An array may be packed such that is crosses multiple other arrays
* or variables, we need to make sure we have allocated the elements
@@ -1096,6 +1095,9 @@ nir_assign_io_var_locations(struct exec_list *var_list, unsigned *size,
location += var_size;
}
- *size += location;
+ if (last_partial)
+ location++;
+
+ *size = location;
}