aboutsummaryrefslogtreecommitdiffstats
path: root/src/panfrost/midgard/midgard_emit.c
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-04-27 19:23:17 -0400
committerMarge Bot <[email protected]>2020-04-29 15:35:54 +0000
commitbb0e85fca472ed57bd01ba13a18f55bce42ab73a (patch)
tree2231fe7a991b1c1dc7901ee6a1a02a5e1b1af23f /src/panfrost/midgard/midgard_emit.c
parent08af4c788d3e9b4eb4fcb7477dce0ca7930f974a (diff)
pan/mdg: Move sampler_type emission to pack time
Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4793>
Diffstat (limited to 'src/panfrost/midgard/midgard_emit.c')
-rw-r--r--src/panfrost/midgard/midgard_emit.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/panfrost/midgard/midgard_emit.c b/src/panfrost/midgard/midgard_emit.c
index 02e6291a67a..6f6a395b430 100644
--- a/src/panfrost/midgard/midgard_emit.c
+++ b/src/panfrost/midgard/midgard_emit.c
@@ -397,6 +397,21 @@ mir_ldst_imm_shift(midgard_load_store_op op)
return 1;
}
+static enum mali_sampler_type
+midgard_sampler_type(nir_alu_type t) {
+ switch (nir_alu_type_get_base_type(t))
+ {
+ case nir_type_float:
+ return MALI_SAMPLER_FLOAT;
+ case nir_type_int:
+ return MALI_SAMPLER_SIGNED;
+ case nir_type_uint:
+ return MALI_SAMPLER_UNSIGNED;
+ default:
+ unreachable("Unknown sampler type");
+ }
+}
+
/* After everything is scheduled, emit whole bundles at a time */
void
@@ -482,6 +497,7 @@ emit_binary_bundle(compiler_context *ctx,
ins->texture.out_full = (osz == 32);
ins->texture.in_reg_full = (isz == 32);
+ ins->texture.sampler_type = midgard_sampler_type(ins->dest_type);
ctx->texture_op_count--;