summaryrefslogtreecommitdiff
path: root/src/panfrost/midgard
diff options
context:
space:
mode:
authorIcecream95 <ixn@disroot.org>2020-12-22 23:08:21 +1300
committerMarge Bot <eric+marge@anholt.net>2021-01-01 02:58:49 +0000
commit3448a42bf5b352d2fa3db02249d2c107c2dcc103 (patch)
treeb4c0246a0e82f8f566d9295fb8385ac3eb0fd423 /src/panfrost/midgard
parent97929b1aaf4d0bbb9214cd7a31ee938c78f7e8bc (diff)
pan/mdg: Add load_kernel_input support
Similar to uniform loads, except that the offset is in bytes instead of vec4 units. Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8264>
Diffstat (limited to 'src/panfrost/midgard')
-rw-r--r--src/panfrost/midgard/midgard_compile.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c
index ead025a1e26..accb5bc9331 100644
--- a/src/panfrost/midgard/midgard_compile.c
+++ b/src/panfrost/midgard/midgard_compile.c
@@ -1499,18 +1499,20 @@ emit_intrinsic(compiler_context *ctx, nir_intrinsic_instr *instr)
case nir_intrinsic_load_global:
case nir_intrinsic_load_shared:
case nir_intrinsic_load_input:
+ case nir_intrinsic_load_kernel_input:
case nir_intrinsic_load_interpolated_input: {
bool is_uniform = instr->intrinsic == nir_intrinsic_load_uniform;
bool is_ubo = instr->intrinsic == nir_intrinsic_load_ubo;
bool is_global = instr->intrinsic == nir_intrinsic_load_global;
bool is_shared = instr->intrinsic == nir_intrinsic_load_shared;
bool is_flat = instr->intrinsic == nir_intrinsic_load_input;
+ bool is_kernel = instr->intrinsic == nir_intrinsic_load_kernel_input;
bool is_interp = instr->intrinsic == nir_intrinsic_load_interpolated_input;
/* Get the base type of the intrinsic */
/* TODO: Infer type? Does it matter? */
nir_alu_type t =
- (is_ubo || is_global || is_shared) ? nir_type_uint :
+ (is_ubo || is_global || is_shared || is_kernel) ? nir_type_uint :
(is_interp) ? nir_type_float :
nir_intrinsic_dest_type(instr);
@@ -1537,6 +1539,8 @@ emit_intrinsic(compiler_context *ctx, nir_intrinsic_instr *instr)
if (is_uniform && !ctx->is_blend) {
emit_ubo_read(ctx, &instr->instr, reg, (ctx->sysvals.sysval_count + offset) * 16, indirect_offset, 4, 0);
+ } else if (is_kernel) {
+ emit_ubo_read(ctx, &instr->instr, reg, (ctx->sysvals.sysval_count * 16) + offset, indirect_offset, 0, 0);
} else if (is_ubo) {
nir_src index = instr->src[0];