summaryrefslogtreecommitdiffstats
path: root/src/broadcom
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2017-12-06 11:30:02 -0800
committerEric Anholt <[email protected]>2017-12-14 14:36:17 -0800
commit52f024b0523763799e71de0a327d5143df72a792 (patch)
treeeb920261e3cc789f94f3f00e447317d28007ed3c /src/broadcom
parent1ae48963f7648bb4e98faacfa3dd63906b26a518 (diff)
broadcom/vc5: Fix shader input/outputs for gallium's new NIR linking.
Diffstat (limited to 'src/broadcom')
-rw-r--r--src/broadcom/compiler/nir_to_vir.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/broadcom/compiler/nir_to_vir.c b/src/broadcom/compiler/nir_to_vir.c
index 7a31e242d11..6ec5db58a26 100644
--- a/src/broadcom/compiler/nir_to_vir.c
+++ b/src/broadcom/compiler/nir_to_vir.c
@@ -627,8 +627,9 @@ static void
emit_fragment_input(struct v3d_compile *c, int attr, nir_variable *var)
{
for (int i = 0; i < glsl_get_vector_elements(var->type); i++) {
- c->inputs[attr * 4 + i] =
- emit_fragment_varying(c, var, i);
+ int chan = var->data.location_frac + i;
+ c->inputs[attr * 4 + chan] =
+ emit_fragment_varying(c, var, chan);
}
}
@@ -1482,8 +1483,11 @@ ntq_setup_outputs(struct v3d_compile *c)
assert(array_len == 1);
(void)array_len;
- for (int i = 0; i < 4; i++)
- add_output(c, loc + i, var->data.location, i);
+ for (int i = 0; i < glsl_get_vector_elements(var->type); i++) {
+ add_output(c, loc + var->data.location_frac + i,
+ var->data.location,
+ var->data.location_frac + i);
+ }
if (c->s->info.stage == MESA_SHADER_FRAGMENT) {
switch (var->data.location) {