mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 13:58:04 +02:00
panfrost/midgard: Report tls_size
Pipe through the number of bytes of spilled memory used from the compiler into the main driver, where it will be used to allocate the Thread Local Storage buffer. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
This commit is contained in:
parent
f1dcaa0df6
commit
f0d0061b18
4 changed files with 13 additions and 0 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue