summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-06-27 15:33:07 -0700
committerAlyssa Rosenzweig <[email protected]>2019-07-01 07:42:55 -0700
commitbbc050b82e7a64848078f993b229a79161c1e95e (patch)
tree9db7bc3c047301f5ff1489b6f13f87c612f31441 /src
parentc9b164f9b59d5f201b2c50838a03d9d3d8bda1a6 (diff)
panfrost/midgard: Use the appropriate ld_attr type
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/panfrost/midgard/midgard_compile.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gallium/drivers/panfrost/midgard/midgard_compile.c b/src/gallium/drivers/panfrost/midgard/midgard_compile.c
index 13f4ed9e283..edf7eb0b16a 100644
--- a/src/gallium/drivers/panfrost/midgard/midgard_compile.c
+++ b/src/gallium/drivers/panfrost/midgard/midgard_compile.c
@@ -1237,6 +1237,10 @@ emit_intrinsic(compiler_context *ctx, nir_intrinsic_instr *instr)
bool is_uniform = instr->intrinsic == nir_intrinsic_load_uniform;
bool is_ubo = instr->intrinsic == nir_intrinsic_load_ubo;
+ /* Get the base type of the intrinsic */
+ nir_alu_type t = nir_intrinsic_type(instr);
+ t = nir_alu_type_get_base_type(t);
+
if (!is_ubo) {
offset = nir_intrinsic_base(instr);
}
@@ -1287,6 +1291,22 @@ emit_intrinsic(compiler_context *ctx, nir_intrinsic_instr *instr)
midgard_instruction ins = m_ld_attr_32(reg, offset);
ins.load_store.unknown = 0x1E1E; /* XXX: What is this? */
ins.load_store.mask = mask_of(nr_comp);
+
+ /* Use the type appropriate load */
+ switch (t) {
+ case nir_type_int:
+ case nir_type_uint:
+ case nir_type_bool:
+ ins.load_store.op = midgard_op_ld_attr_32i;
+ break;
+ case nir_type_float:
+ ins.load_store.op = midgard_op_ld_attr_32;
+ break;
+ default:
+ unreachable("Attempted to load unknown type");
+ break;
+ }
+
emit_mir_instruction(ctx, ins);
} else {
DBG("Unknown load\n");