diff options
author | Boris Brezillon <boris.brezillon@collabora.com> | 2020-10-18 21:11:49 +0200 |
---|---|---|
committer | Boris Brezillon <boris.brezillon@collabora.com> | 2020-10-26 19:11:20 +0100 |
commit | 1c8b8e3c82e2aa7bbbc9aae3f7b4982eee869ab6 (patch) | |
tree | 2aa1b23b2baa59f4b6f96e5c01ab07be41b951a9 /src | |
parent | 55c0dd943e9ab3eb117509394f958f716e95532e (diff) |
pan/bi: Add support for load_point_coord
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/7314>
Diffstat (limited to 'src')
-rw-r--r-- | src/panfrost/bifrost/bifrost_compile.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index 5a8b0da7075..a55321ecbc9 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -585,6 +585,28 @@ bi_emit_front_face(bi_context *ctx, nir_intrinsic_instr *instr) } static void +bi_emit_point_coord(bi_context *ctx, nir_intrinsic_instr *instr) +{ + bi_instruction ins = { + .type = BI_LOAD_VAR, + .vector_channels = 2, + .dest = pan_dest_index(&instr->dest), + .dest_type = nir_type_float32, + .format = nir_type_float32, + .src = { + BIR_INDEX_CONSTANT, + BIR_INDEX_ZERO, + }, + .src_types = { + nir_type_uint32, + }, + .constant.u64 = 20, + }; + + bi_emit(ctx, ins); +} + +static void emit_intrinsic(bi_context *ctx, nir_intrinsic_instr *instr) { @@ -664,6 +686,10 @@ emit_intrinsic(bi_context *ctx, nir_intrinsic_instr *instr) bi_emit_front_face(ctx, instr); break; + case nir_intrinsic_load_point_coord: + bi_emit_point_coord(ctx, instr); + break; + default: unreachable("Unknown intrinsic"); break; |