[Mesa-dev] [PATCH 2/2] radeonsi: add RADEON_REPLACE_SHADERS debug option

Marek Olšák maraeo at gmail.com
Fri Dec 18 16:34:24 PST 2015


On Thu, Dec 17, 2015 at 11:01 PM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>
> This option allows replacing a single shader by a pre-compiled ELF object
> as generated by LLVM's llc, for example. This can be useful for debugging a
> deterministically occuring error in shaders (and has in fact helped find
> the causes of https://bugs.freedesktop.org/show_bug.cgi?id=93264).
> ---
>  src/gallium/drivers/radeon/r600_pipe_common.h |  1 +
>  src/gallium/drivers/radeonsi/si_debug.c       | 94 +++++++++++++++++++++++++++
>  src/gallium/drivers/radeonsi/si_pipe.c        |  3 +
>  src/gallium/drivers/radeonsi/si_pipe.h        |  1 +
>  src/gallium/drivers/radeonsi/si_shader.c      | 18 +++--
>  5 files changed, 112 insertions(+), 5 deletions(-)
>
> diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h
> index c3933b1d..556c7cc 100644
> --- a/src/gallium/drivers/radeon/r600_pipe_common.h
> +++ b/src/gallium/drivers/radeon/r600_pipe_common.h
> @@ -87,6 +87,7 @@
>  #define DBG_NO_DCC             (1llu << 43)
>  #define DBG_NO_DCC_CLEAR       (1llu << 44)
>  #define DBG_NO_RB_PLUS         (1llu << 45)
> +#define DBG_REPLACE_SHADERS    (1llu << 46)

There is no need for DBG_REPLACE_SHADERS. These DBG flags should only
be used by the R600_DEBUG environment variable.

si_replace_shader already checks RADEON_REPLACE_SHADERS, so the DBG
flag is redundant. If you are concerned about the overhead of
debug_get_option, you can add DEBUG_GET_ONCE_xxx_OPTION. (but I don't
think it would make any difference)

Marek


More information about the mesa-dev mailing list