diff options
author | Rob Clark <[email protected]> | 2020-04-02 12:13:38 -0700 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-04-04 00:07:10 +0000 |
commit | c0d56efa31e37e9ec35cf0b65c578c513976ed32 (patch) | |
tree | 449eae0b2f6feb3d27d5f0a57b816495efaf159d /src/gallium/drivers/freedreno/ir3/ir3_gallium.c | |
parent | 37e052c8b0882904d80ab1721ccb1ebed727af9f (diff) |
freedreno/ir3: also precompile compute shaders for shaderdb
Similar as with draw shaders, nothing will trigger the final variant in
shader-db.
Signed-off-by: Rob Clark <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4423>
Diffstat (limited to 'src/gallium/drivers/freedreno/ir3/ir3_gallium.c')
-rw-r--r-- | src/gallium/drivers/freedreno/ir3/ir3_gallium.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_gallium.c b/src/gallium/drivers/freedreno/ir3/ir3_gallium.c index 9ad67d2ec9b..31dc82b1b6e 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_gallium.c +++ b/src/gallium/drivers/freedreno/ir3/ir3_gallium.c @@ -144,6 +144,7 @@ ir3_shader_create(struct ir3_compiler *compiler, if (nir->info.stage != MESA_SHADER_FRAGMENT) ir3_shader_variant(shader, key, true, debug); } + return shader; } @@ -170,6 +171,15 @@ ir3_shader_create_compute(struct ir3_compiler *compiler, struct ir3_shader *shader = ir3_shader_from_nir(compiler, nir); + if (fd_mesa_debug & FD_DBG_SHADERDB) { + /* if shader-db run, create a standard variant immediately + * (as otherwise nothing will trigger the shader to be + * actually compiled) + */ + static struct ir3_shader_key key; /* static is implicitly zeroed */ + ir3_shader_variant(shader, key, false, debug); + } + return shader; } |