diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-08-02 17:10:18 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-08-12 12:42:59 -0700 |
commit | 63e240dd0573968a3602424da3b963ba82d5cf6b (patch) | |
tree | 19e2f42e4a1e4cece473c81a64eca687670b46db /src | |
parent | e7ac46be7aaa81bf060d415085a0278c819f4b2a (diff) |
pan/midgard: Clamp sysval component count
We don't want to load a 128-bit sysval when 64-bits will do. Fixes RA
failures with SSBO indirect writes.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/panfrost/midgard/compiler.h | 2 | ||||
-rw-r--r-- | src/panfrost/midgard/midgard_compile.c | 12 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/panfrost/midgard/compiler.h b/src/panfrost/midgard/compiler.h index 899b4c60074..38bf1ecfaca 100644 --- a/src/panfrost/midgard/compiler.h +++ b/src/panfrost/midgard/compiler.h @@ -537,7 +537,7 @@ emit_ubo_read( unsigned index); void -emit_sysval_read(compiler_context *ctx, nir_instr *instr, signed dest_override); +emit_sysval_read(compiler_context *ctx, nir_instr *instr, signed dest_override, unsigned nr_components); void midgard_emit_derivatives(compiler_context *ctx, nir_alu_instr *instr); diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c index fb3921effbc..72ed1ef064c 100644 --- a/src/panfrost/midgard/midgard_compile.c +++ b/src/panfrost/midgard/midgard_compile.c @@ -1219,7 +1219,8 @@ emit_varying_read( } void -emit_sysval_read(compiler_context *ctx, nir_instr *instr, signed dest_override) +emit_sysval_read(compiler_context *ctx, nir_instr *instr, signed dest_override, + unsigned nr_components) { unsigned dest = 0; @@ -1234,7 +1235,10 @@ emit_sysval_read(compiler_context *ctx, nir_instr *instr, signed dest_override) unsigned uniform = ((uintptr_t) val) - 1; /* Emit the read itself -- this is never indirect */ - emit_ubo_read(ctx, dest, uniform, NULL, 0); + midgard_instruction *ins = + emit_ubo_read(ctx, dest, uniform, NULL, 0); + + ins->mask = mask_of(nr_components); } static void @@ -1440,7 +1444,7 @@ emit_intrinsic(compiler_context *ctx, nir_intrinsic_instr *instr) case nir_intrinsic_load_viewport_scale: case nir_intrinsic_load_viewport_offset: - emit_sysval_read(ctx, &instr->instr, -1); + emit_sysval_read(ctx, &instr->instr, -1, 3); break; default: @@ -1667,7 +1671,7 @@ emit_tex(compiler_context *ctx, nir_tex_instr *instr) emit_texop_native(ctx, instr, TEXTURE_OP_TEXEL_FETCH); break; case nir_texop_txs: - emit_sysval_read(ctx, &instr->instr, -1); + emit_sysval_read(ctx, &instr->instr, -1, 4); break; default: unreachable("Unhanlded texture op"); |