lima: add precompile debug flag

This flag will be used by run from mesa-shader-db to trigger shader
compilation with default settings.

Tested-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9583>
This commit is contained in:
Vasily Khoruzhick
2021-03-13 22:17:18 -08:00
committed by Marge Bot
parent 7c2c60ad67
commit d2ca8be998
3 changed files with 20 additions and 13 deletions

View File

@@ -368,6 +368,7 @@ lima_create_fs_state(struct pipe_context *pctx,
so->base.type = PIPE_SHADER_IR_NIR;
so->base.ir.nir = nir;
if (lima_debug & LIMA_DEBUG_PRECOMPILE) {
/* Trigger initial compilation with default settings */
struct lima_fs_key key = {
.shader_state = so,
@@ -377,6 +378,7 @@ lima_create_fs_state(struct pipe_context *pctx,
key.tex[i].swizzle[j] = j;
}
lima_get_compiled_fs(ctx, &key);
}
return so;
}
@@ -568,11 +570,13 @@ lima_create_vs_state(struct pipe_context *pctx,
so->base.type = PIPE_SHADER_IR_NIR;
so->base.ir.nir = nir;
if (lima_debug & LIMA_DEBUG_PRECOMPILE) {
/* Trigger initial compilation with default settings */
struct lima_vs_key key = {
.shader_state = so,
};
lima_get_compiled_vs(ctx, &key);
}
return so;
}

View File

@@ -568,6 +568,8 @@ static const struct debug_named_value lima_debug_options[] = {
"disable growable heap buffer" },
{ "singlejob", LIMA_DEBUG_SINGLE_JOB,
"disable multi job optimization" },
{ "precompile", LIMA_DEBUG_PRECOMPILE,
"Precompile shaders for shader-db" },
{ NULL }
};

View File

@@ -42,6 +42,7 @@
#define LIMA_DEBUG_NO_TILING (1 << 6)
#define LIMA_DEBUG_NO_GROW_HEAP (1 << 7)
#define LIMA_DEBUG_SINGLE_JOB (1 << 8)
#define LIMA_DEBUG_PRECOMPILE (1 << 9)
extern uint32_t lima_debug;
extern int lima_ctx_num_plb;