aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-03-06 09:44:19 -0500
committerMarge Bot <[email protected]>2020-03-07 00:37:39 +0000
commit48910e83889a0736f61aca7c4b196d7c6420db9a (patch)
tree12f560fa4b1fb076c31908f4ac5aaa0a01227329
parentd86659ca57ebe9d1752e33ed6ffe1e1b70c5f50d (diff)
pan/bi: Implement store_vary for vertex shaders
As far as I/O goes, these four should hold us over for a while. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4097>
-rw-r--r--src/panfrost/bifrost/bifrost_compile.c32
1 files changed, 29 insertions, 3 deletions
diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c
index a22d6420117..c48a3d37d4d 100644
--- a/src/panfrost/bifrost/bifrost_compile.c
+++ b/src/panfrost/bifrost/bifrost_compile.c
@@ -141,6 +141,31 @@ bi_emit_ld_attr(bi_context *ctx, nir_intrinsic_instr *instr)
}
static void
+bi_emit_st_vary(bi_context *ctx, nir_intrinsic_instr *instr)
+{
+ nir_src *offset = nir_get_io_offset_src(instr);
+ assert(nir_src_is_const(*offset)); /* no indirects */
+
+ bi_instruction address = {
+ .type = BI_LOAD_VAR_ADDRESS,
+ .load = bi_direct_load_for_instr(instr),
+ .dest_type = nir_intrinsic_type(instr),
+ .dest = bi_make_temp(ctx)
+ };
+
+ bi_instruction st = {
+ .type = BI_STORE_VAR,
+ .src = {
+ address.dest,
+ bir_src_index(&instr->src[0])
+ }
+ };
+
+ bi_emit(ctx, address);
+ bi_emit(ctx, st);
+}
+
+static void
emit_intrinsic(bi_context *ctx, nir_intrinsic_instr *instr)
{
@@ -162,9 +187,10 @@ emit_intrinsic(bi_context *ctx, nir_intrinsic_instr *instr)
case nir_intrinsic_store_output:
if (ctx->stage == MESA_SHADER_FRAGMENT)
bi_emit_frag_out(ctx, instr);
- else {
- /* TODO */
- }
+ else if (ctx->stage == MESA_SHADER_VERTEX)
+ bi_emit_st_vary(ctx, instr);
+ else
+ unreachable("Unsupported shader stage");
break;
default:
/* todo */