summaryrefslogtreecommitdiffstats
path: root/src/panfrost/midgard
diff options
context:
space:
mode:
Diffstat (limited to 'src/panfrost/midgard')
-rw-r--r--src/panfrost/midgard/compiler.h3
-rw-r--r--src/panfrost/midgard/midgard_compile.c1
-rw-r--r--src/panfrost/midgard/midgard_compile.h4
-rw-r--r--src/panfrost/midgard/midgard_schedule.c5
4 files changed, 13 insertions, 0 deletions
diff --git a/src/panfrost/midgard/compiler.h b/src/panfrost/midgard/compiler.h
index 91ca185d628..2ea0cc6ce60 100644
--- a/src/panfrost/midgard/compiler.h
+++ b/src/panfrost/midgard/compiler.h
@@ -194,6 +194,9 @@ typedef struct compiler_context {
/* Tracking for blend constant patching */
int blend_constant_offset;
+ /* Number of bytes used for Thread Local Storage */
+ unsigned tls_size;
+
/* Current NIR function */
nir_function *func;
diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c
index 0f586c051db..822cc6a0542 100644
--- a/src/panfrost/midgard/midgard_compile.c
+++ b/src/panfrost/midgard/midgard_compile.c
@@ -2706,6 +2706,7 @@ midgard_compile_shader_nir(nir_shader *nir, midgard_program *program, bool is_bl
program->uniform_cutoff = ctx->uniform_cutoff;
program->blend_patch_offset = ctx->blend_constant_offset;
+ program->tls_size = ctx->tls_size;
if (midgard_debug & MIDGARD_DBG_SHADERS)
disassemble_midgard(program->compiled.data, program->compiled.size);
diff --git a/src/panfrost/midgard/midgard_compile.h b/src/panfrost/midgard/midgard_compile.h
index 147494b8e8a..c5ce9b7331f 100644
--- a/src/panfrost/midgard/midgard_compile.h
+++ b/src/panfrost/midgard/midgard_compile.h
@@ -83,6 +83,10 @@ typedef struct {
int blend_patch_offset;
+ /* The number of bytes to allocate per-thread for Thread Local Storage
+ * (register spilling), or zero if no spilling is used */
+ unsigned tls_size;
+
/* IN: For a fragment shader with a lowered alpha test, the ref value */
float alpha_ref;
} midgard_program;
diff --git a/src/panfrost/midgard/midgard_schedule.c b/src/panfrost/midgard/midgard_schedule.c
index 152da8de237..862b9306c15 100644
--- a/src/panfrost/midgard/midgard_schedule.c
+++ b/src/panfrost/midgard/midgard_schedule.c
@@ -788,5 +788,10 @@ schedule_program(compiler_context *ctx)
assert(0);
}
+ /* Report spilling information. spill_count is in 128-bit slots (vec4 x
+ * fp32), but tls_size is in bytes, so multiply by 16 */
+
+ ctx->tls_size = spill_count * 16;
+
install_registers(ctx, g);
}