summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>2020-12-07 19:14:49 -0500
committerMarge Bot <eric+marge@anholt.net>2020-12-31 14:39:01 +0000
commitfeecf0a3d819e4f231538e85d1fbc097b189b21d (patch)
treef3abc861e8fe0e2bfa5d672d28ef1e4d2d4791d9
parent4de806a803baecfe81f506479c0a84896e1fabf1 (diff)
pan/bi: Implement bi_emit_ld_tile via the builder
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135>
-rw-r--r--src/panfrost/bifrost/bifrost_compile.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c
index 2c43077ada2..531af4c1edd 100644
--- a/src/panfrost/bifrost/bifrost_compile.c
+++ b/src/panfrost/bifrost/bifrost_compile.c
@@ -121,6 +121,30 @@ bi_load_old(enum bi_class T, nir_intrinsic_instr *instr, unsigned offset_idx)
}
static void
+bi_emit_ld_tile(bi_builder *b, nir_intrinsic_instr *instr)
+{
+ assert(b->shader->is_blend);
+
+ /* We want to load the current pixel.
+ * FIXME: The sample to load is currently hardcoded to 0. This should
+ * be addressed for multi-sample FBs.
+ */
+ struct bifrost_pixel_indices pix = {
+ .y = BIFROST_CURRENT_PIXEL,
+ };
+
+ uint32_t indices = 0;
+ memcpy(&indices, &pix, sizeof(indices));
+
+ bi_ld_tile_to(b, bi_dest_index(&instr->dest), bi_imm_u32(indices),
+ bi_register(60), /* coverage bitmap, TODO ra */
+ /* Only keep the conversion part of the blend descriptor. */
+ bi_imm_u32(b->shader->blend_desc >> 32),
+ (instr->num_components - 1));
+
+}
+
+static void
bi_emit_ld_output(bi_context *ctx, nir_intrinsic_instr *instr)
{
assert(ctx->is_blend);