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:

committed by
Marge Bot

parent
7c2c60ad67
commit
d2ca8be998
@@ -368,6 +368,7 @@ lima_create_fs_state(struct pipe_context *pctx,
|
|||||||
so->base.type = PIPE_SHADER_IR_NIR;
|
so->base.type = PIPE_SHADER_IR_NIR;
|
||||||
so->base.ir.nir = nir;
|
so->base.ir.nir = nir;
|
||||||
|
|
||||||
|
if (lima_debug & LIMA_DEBUG_PRECOMPILE) {
|
||||||
/* Trigger initial compilation with default settings */
|
/* Trigger initial compilation with default settings */
|
||||||
struct lima_fs_key key = {
|
struct lima_fs_key key = {
|
||||||
.shader_state = so,
|
.shader_state = so,
|
||||||
@@ -377,6 +378,7 @@ lima_create_fs_state(struct pipe_context *pctx,
|
|||||||
key.tex[i].swizzle[j] = j;
|
key.tex[i].swizzle[j] = j;
|
||||||
}
|
}
|
||||||
lima_get_compiled_fs(ctx, &key);
|
lima_get_compiled_fs(ctx, &key);
|
||||||
|
}
|
||||||
|
|
||||||
return so;
|
return so;
|
||||||
}
|
}
|
||||||
@@ -568,11 +570,13 @@ lima_create_vs_state(struct pipe_context *pctx,
|
|||||||
so->base.type = PIPE_SHADER_IR_NIR;
|
so->base.type = PIPE_SHADER_IR_NIR;
|
||||||
so->base.ir.nir = nir;
|
so->base.ir.nir = nir;
|
||||||
|
|
||||||
|
if (lima_debug & LIMA_DEBUG_PRECOMPILE) {
|
||||||
/* Trigger initial compilation with default settings */
|
/* Trigger initial compilation with default settings */
|
||||||
struct lima_vs_key key = {
|
struct lima_vs_key key = {
|
||||||
.shader_state = so,
|
.shader_state = so,
|
||||||
};
|
};
|
||||||
lima_get_compiled_vs(ctx, &key);
|
lima_get_compiled_vs(ctx, &key);
|
||||||
|
}
|
||||||
|
|
||||||
return so;
|
return so;
|
||||||
}
|
}
|
||||||
|
@@ -568,6 +568,8 @@ static const struct debug_named_value lima_debug_options[] = {
|
|||||||
"disable growable heap buffer" },
|
"disable growable heap buffer" },
|
||||||
{ "singlejob", LIMA_DEBUG_SINGLE_JOB,
|
{ "singlejob", LIMA_DEBUG_SINGLE_JOB,
|
||||||
"disable multi job optimization" },
|
"disable multi job optimization" },
|
||||||
|
{ "precompile", LIMA_DEBUG_PRECOMPILE,
|
||||||
|
"Precompile shaders for shader-db" },
|
||||||
{ NULL }
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -42,6 +42,7 @@
|
|||||||
#define LIMA_DEBUG_NO_TILING (1 << 6)
|
#define LIMA_DEBUG_NO_TILING (1 << 6)
|
||||||
#define LIMA_DEBUG_NO_GROW_HEAP (1 << 7)
|
#define LIMA_DEBUG_NO_GROW_HEAP (1 << 7)
|
||||||
#define LIMA_DEBUG_SINGLE_JOB (1 << 8)
|
#define LIMA_DEBUG_SINGLE_JOB (1 << 8)
|
||||||
|
#define LIMA_DEBUG_PRECOMPILE (1 << 9)
|
||||||
|
|
||||||
extern uint32_t lima_debug;
|
extern uint32_t lima_debug;
|
||||||
extern int lima_ctx_num_plb;
|
extern int lima_ctx_num_plb;
|
||||||
|
Reference in New Issue
Block a user