summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_program.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2016-08-04 17:31:02 -0700
committerEric Anholt <[email protected]>2016-08-19 13:11:36 -0700
commit5adee83806f764d60c629027dc0ee38cef3cb87a (patch)
treefbdee78f4e7c54c1f2be5adde17ac88fddfb0c26 /src/gallium/drivers/vc4/vc4_program.c
parentf8fecc396abf00bb6e3e31087875c834981fa699 (diff)
vc4: Switch store_output to using nir_lower_io_to_scalar / component.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_program.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_program.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c
index 454202753a5..5acb7a75919 100644
--- a/src/gallium/drivers/vc4/vc4_program.c
+++ b/src/gallium/drivers/vc4/vc4_program.c
@@ -1652,6 +1652,7 @@ ntq_emit_intrinsic(struct vc4_compile *c, nir_intrinsic_instr *instr)
i));
}
} else {
+ offset = offset * 4 + nir_intrinsic_component(instr);
assert(instr->num_components == 1);
c->outputs[offset] =
qir_MOV(c, ntq_get_src(c, instr->src[0], 0));
@@ -2063,17 +2064,24 @@ vc4_shader_ntq(struct vc4_context *vc4, enum qstage stage,
if (c->vs_key && c->vs_key->clamp_color)
NIR_PASS_V(c->s, nir_lower_clamp_color_outputs);
- if (stage == QSTAGE_FRAG) {
- NIR_PASS_V(c->s, nir_lower_clip_fs, c->key->ucp_enables);
- } else {
- NIR_PASS_V(c->s, nir_lower_clip_vs, c->key->ucp_enables);
+ if (c->key->ucp_enables) {
+ if (stage == QSTAGE_FRAG) {
+ NIR_PASS_V(c->s, nir_lower_clip_fs, c->key->ucp_enables);
+ } else {
+ NIR_PASS_V(c->s, nir_lower_clip_vs, c->key->ucp_enables);
+ NIR_PASS_V(c->s, nir_lower_io_to_scalar,
+ nir_var_shader_out);
+ }
}
/* FS input scalarizing must happen after nir_lower_two_sided_color,
- * which only handles a vec4 at a time.
+ * which only handles a vec4 at a time. Similarly, VS output
+ * scalarizing must happen after nir_lower_clip_vs.
*/
if (c->stage == QSTAGE_FRAG)
NIR_PASS_V(c->s, nir_lower_io_to_scalar, nir_var_shader_in);
+ else
+ NIR_PASS_V(c->s, nir_lower_io_to_scalar, nir_var_shader_out);
NIR_PASS_V(c->s, vc4_nir_lower_io, c);
NIR_PASS_V(c->s, vc4_nir_lower_txf_ms, c);