summaryrefslogtreecommitdiffstats
path: root/src/broadcom
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2018-12-28 11:30:52 -0800
committerEric Anholt <[email protected]>2018-12-30 08:05:11 -0800
commitad1e59cf8d05f07db9f8d4183b3179cef230edfa (patch)
tree1a9abc6e0869a642f7dead21ab2dea199e849661 /src/broadcom
parent20021e3473ae6fae7d850425e031523b1983d4e5 (diff)
v3d: Add support for gl_HelperInvocation.
We can just look at the MSF flags -- if they're unset, then we're definitely in a helper invocation. Fixes dEQP-GLES31.functional.shaders.helper_invocation.* with GLES3.1 enabled.
Diffstat (limited to 'src/broadcom')
-rw-r--r--src/broadcom/compiler/nir_to_vir.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/broadcom/compiler/nir_to_vir.c b/src/broadcom/compiler/nir_to_vir.c
index e01668c62c0..73fed4e816b 100644
--- a/src/broadcom/compiler/nir_to_vir.c
+++ b/src/broadcom/compiler/nir_to_vir.c
@@ -1596,6 +1596,14 @@ ntq_emit_intrinsic(struct v3d_compile *c, nir_intrinsic_instr *instr)
ntq_store_dest(c, &instr->dest, 0, vir_MSF(c));
break;
+ case nir_intrinsic_load_helper_invocation:
+ vir_PF(c, vir_MSF(c), V3D_QPU_PF_PUSHZ);
+ ntq_store_dest(c, &instr->dest, 0,
+ vir_MOV(c, vir_SEL(c, V3D_QPU_COND_IFA,
+ vir_uniform_ui(c, ~0),
+ vir_uniform_ui(c, 0))));
+ break;
+
case nir_intrinsic_load_front_face:
/* The register contains 0 (front) or 1 (back), and we need to
* turn it into a NIR bool where true means front.