mesa/shaderapi: add an optional shader override mechanism

MESA_SHADER_READ_PATH is handy but it's not usable in
all cases.

This commit allows to implement an alternative mechanism
without assuming too much about how it's done, nor where/how
the shaders are stored.

When this is enabled MESA_SHADER_DUMP_PATH,
MESA_SHADER_CAPTURE_PATH and MESA_GLSL env var handling is
disabled.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11621>
This commit is contained in:
Pierre-Eric Pelloux-Prayer
2021-05-27 16:06:15 +02:00
parent 5582c52a05
commit 11528b621c
4 changed files with 78 additions and 2 deletions

View File

@@ -502,3 +502,9 @@ option(
choices : ['auto', 'panfrost', 'intel', 'freedreno'],
description: 'List of Perfetto datasources to build. If this is set to `auto`, datasources that can not be build are skipped. Default: [`auto`]'
)
option(
'custom-shader-replacement',
type : 'string',
value : '',
description : 'Enable a custom shader replacement mechanism. Note that enabling this option requires adding/generating a shader_replacement.h file that can be included (see shaderapi.c).'
)