diff options
author | Boris Brezillon <boris.brezillon@collabora.com> | 2020-11-06 14:08:33 +0100 |
---|---|---|
committer | Boris Brezillon <boris.brezillon@collabora.com> | 2020-11-09 20:36:50 +0100 |
commit | 5cd1d8c1ed9b5d9da83900074e983c3e4e0aa3ff (patch) | |
tree | 41140b2eb26d7509ae9b33558f6d160c2d68f749 | |
parent | 255f7842c7c9c8fc521db2982d8869c6b5058eac (diff) |
pan/bi: Add support for load_vertex_id
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7472>
-rw-r--r-- | src/panfrost/bifrost/bifrost_compile.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index 48146cd3435..e73bdda9fc9 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -742,6 +742,20 @@ bi_emit_point_coord(bi_context *ctx, nir_intrinsic_instr *instr) } static void +bi_emit_vertex_id(bi_context *ctx, nir_intrinsic_instr *instr) +{ + bi_instruction mov = { + .type = BI_MOV, + .dest = pan_dest_index(&instr->dest), + .dest_type = nir_type_int32, + .src = { BIR_INDEX_REGISTER | 61 }, + .src_types = { nir_type_int32 }, + }; + + bi_emit(ctx, mov); +} + +static void emit_intrinsic(bi_context *ctx, nir_intrinsic_instr *instr) { @@ -832,6 +846,10 @@ emit_intrinsic(bi_context *ctx, nir_intrinsic_instr *instr) bi_emit_point_coord(ctx, instr); break; + case nir_intrinsic_load_vertex_id: + bi_emit_vertex_id(ctx, instr); + break; + default: unreachable("Unknown intrinsic"); break; |