diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-08-02 17:09:54 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-08-12 12:42:59 -0700 |
commit | e7ac46be7aaa81bf060d415085a0278c819f4b2a (patch) | |
tree | 85262192a3e301b10f8c349a0c89728c20089536 /src/panfrost/midgard | |
parent | fa68740187cfd6938bd5a64f295efe19915856b6 (diff) |
pan/midgard: Pass uploaded midgard_instruction through
We want to edit it after emission in some cases.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/panfrost/midgard')
-rw-r--r-- | src/panfrost/midgard/compiler.h | 8 | ||||
-rw-r--r-- | src/panfrost/midgard/midgard_compile.c | 4 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/panfrost/midgard/compiler.h b/src/panfrost/midgard/compiler.h index c466ad6a3ab..899b4c60074 100644 --- a/src/panfrost/midgard/compiler.h +++ b/src/panfrost/midgard/compiler.h @@ -278,10 +278,12 @@ mir_upload_ins(struct midgard_instruction ins) return heap; } -static inline void +static inline midgard_instruction * emit_mir_instruction(struct compiler_context *ctx, struct midgard_instruction ins) { - list_addtail(&(mir_upload_ins(ins))->link, &ctx->current_block->instructions); + midgard_instruction *u = mir_upload_ins(ins); + list_addtail(&u->link, &ctx->current_block->instructions); + return u; } static inline struct midgard_instruction * @@ -526,7 +528,7 @@ void mir_create_pipeline_registers(compiler_context *ctx); void midgard_promote_uniforms(compiler_context *ctx, unsigned promoted_count); -void +midgard_instruction * emit_ubo_read( compiler_context *ctx, unsigned dest, diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c index c0eedb8e1f0..fb3921effbc 100644 --- a/src/panfrost/midgard/midgard_compile.c +++ b/src/panfrost/midgard/midgard_compile.c @@ -1139,7 +1139,7 @@ emit_alu(compiler_context *ctx, nir_alu_instr *instr) /* Uniforms and UBOs use a shared code path, as uniforms are just (slightly * optimized) versions of UBO #0 */ -void +midgard_instruction * emit_ubo_read( compiler_context *ctx, unsigned dest, @@ -1164,7 +1164,7 @@ emit_ubo_read( ins.load_store.arg_1 = index; - emit_mir_instruction(ctx, ins); + return emit_mir_instruction(ctx, ins); } static void |