diff options
author | Iago Toral Quiroga <[email protected]> | 2019-10-03 17:08:47 +0200 |
---|---|---|
committer | Iago Toral Quiroga <[email protected]> | 2019-12-16 08:42:37 +0100 |
commit | 4f5fbd6490a52726d851263ad26c0a595e7cc4d0 (patch) | |
tree | 783ebc80f16164100551d62ee99c5ac9b248d4da /src/broadcom/compiler | |
parent | 8a81ac2eed5304d9d31539d461060f2bcae5c828 (diff) |
v3d: implement geometry shader instancing
v2:
- Remove unused field uses_iid from v3d_gs_prog_data (Alejandro)
Reviewed-by: Alejandro PiƱeiro <[email protected]>
Diffstat (limited to 'src/broadcom/compiler')
-rw-r--r-- | src/broadcom/compiler/nir_to_vir.c | 4 | ||||
-rw-r--r-- | src/broadcom/compiler/v3d_compiler.h | 4 | ||||
-rw-r--r-- | src/broadcom/compiler/vir.c | 1 |
3 files changed, 9 insertions, 0 deletions
diff --git a/src/broadcom/compiler/nir_to_vir.c b/src/broadcom/compiler/nir_to_vir.c index d7bef12fef9..d49640bf623 100644 --- a/src/broadcom/compiler/nir_to_vir.c +++ b/src/broadcom/compiler/nir_to_vir.c @@ -2327,6 +2327,10 @@ ntq_emit_intrinsic(struct v3d_compile *c, nir_intrinsic_instr *instr) break; } + case nir_intrinsic_load_invocation_id: + ntq_store_dest(c, &instr->dest, 0, vir_IID(c)); + break; + default: fprintf(stderr, "Unknown intrinsic: "); nir_print_instr(&instr->instr, stderr); diff --git a/src/broadcom/compiler/v3d_compiler.h b/src/broadcom/compiler/v3d_compiler.h index 9b08e4a270e..a5b4748aaf0 100644 --- a/src/broadcom/compiler/v3d_compiler.h +++ b/src/broadcom/compiler/v3d_compiler.h @@ -718,6 +718,9 @@ struct v3d_gs_prog_data { /* Output primitive type */ uint8_t out_prim_type; + + /* Number of GS invocations */ + uint8_t num_invocations; }; struct v3d_fs_prog_data { @@ -1037,6 +1040,7 @@ VIR_A_ALU2(LDVPMG_IN) VIR_A_ALU2(LDVPMG_OUT) VIR_A_ALU0(TMUWT) +VIR_A_ALU0(IID) VIR_A_ALU0(FXCD) VIR_A_ALU0(XCD) VIR_A_ALU0(FYCD) diff --git a/src/broadcom/compiler/vir.c b/src/broadcom/compiler/vir.c index dc966bc80ca..4f88b86a5d2 100644 --- a/src/broadcom/compiler/vir.c +++ b/src/broadcom/compiler/vir.c @@ -681,6 +681,7 @@ v3d_gs_set_prog_data(struct v3d_compile *c, prog_data->vpm_output_size = align(c->vpm_output_size, 8) / 8; prog_data->out_prim_type = c->s->info.gs.output_primitive; + prog_data->num_invocations = c->s->info.gs.invocations; } static void |