[Mesa-dev] [PATCH] [RFC] r600g: enable SB backend by default

Christian König deathsimple at vodafone.de
Fri Aug 23 02:48:35 PDT 2013


Am 22.08.2013 18:20, schrieb Vadim Girlin:
> Signed-off-by: Vadim Girlin <vadimgirlin at gmail.com>

Sounds good if it's stable enough.

Reviewed-by: Christian König <christian.koenig at amd.com>

> ---
>   src/gallium/drivers/r600/r600_asm.c    | 3 ++-
>   src/gallium/drivers/r600/r600_pipe.c   | 4 ++--
>   src/gallium/drivers/r600/r600_pipe.h   | 2 +-
>   src/gallium/drivers/r600/r600_shader.c | 2 +-
>   4 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/src/gallium/drivers/r600/r600_asm.c b/src/gallium/drivers/r600/r600_asm.c
> index b8eedae..a0492a6 100644
> --- a/src/gallium/drivers/r600/r600_asm.c
> +++ b/src/gallium/drivers/r600/r600_asm.c
> @@ -2281,7 +2281,8 @@ void *r600_create_vertex_fetch_shader(struct pipe_context *ctx,
>   	uint32_t *bytecode;
>   	int i, j, r, fs_size;
>   	struct r600_fetch_shader *shader;
> -	unsigned sb_disasm = rctx->screen->debug_flags & (DBG_SB_DISASM | DBG_SB);
> +	unsigned no_sb = rctx->screen->debug_flags & DBG_NO_SB;
> +	unsigned sb_disasm = !no_sb || (rctx->screen->debug_flags & DBG_SB_DISASM);
>   
>   	assert(count < 32);
>   
> diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c
> index 2be5910..edd50f0 100644
> --- a/src/gallium/drivers/r600/r600_pipe.c
> +++ b/src/gallium/drivers/r600/r600_pipe.c
> @@ -67,8 +67,8 @@ static const struct debug_named_value debug_options[] = {
>   	{ "noinvalrange", DBG_NO_DISCARD_RANGE, "Disable handling of INVALIDATE_RANGE map flags" },
>   
>   	/* shader backend */
> -	{ "sb", DBG_SB, "Enable optimization of graphics shaders" },
> -	{ "sbcl", DBG_SB_CS, "Enable optimization of compute shaders" },
> +	{ "nosb", DBG_NO_SB, "Disable sb backend for graphics shaders" },
> +	{ "sbcl", DBG_SB_CS, "Enable sb backend for compute shaders" },
>   	{ "sbdry", DBG_SB_DRY_RUN, "Don't use optimized bytecode (just print the dumps)" },
>   	{ "sbstat", DBG_SB_STAT, "Print optimization statistics for shaders" },
>   	{ "sbdump", DBG_SB_DUMP, "Print IR dumps after some optimization passes" },
> diff --git a/src/gallium/drivers/r600/r600_pipe.h b/src/gallium/drivers/r600/r600_pipe.h
> index 21d68c9..398ac89 100644
> --- a/src/gallium/drivers/r600/r600_pipe.h
> +++ b/src/gallium/drivers/r600/r600_pipe.h
> @@ -249,7 +249,7 @@ typedef boolean (*r600g_dma_blit_t)(struct pipe_context *ctx,
>   #define DBG_NO_ASYNC_DMA	(1 << 19)
>   #define DBG_NO_DISCARD_RANGE	(1 << 20)
>   /* shader backend */
> -#define DBG_SB			(1 << 21)
> +#define DBG_NO_SB		(1 << 21)
>   #define DBG_SB_CS		(1 << 22)
>   #define DBG_SB_DRY_RUN	(1 << 23)
>   #define DBG_SB_STAT		(1 << 24)
> diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
> index fb766c4..1563430 100644
> --- a/src/gallium/drivers/r600/r600_shader.c
> +++ b/src/gallium/drivers/r600/r600_shader.c
> @@ -140,7 +140,7 @@ int r600_pipe_shader_create(struct pipe_context *ctx,
>   	int r, i;
>   	uint32_t *ptr;
>   	bool dump = r600_can_dump_shader(rctx->screen, tgsi_get_processor_type(sel->tokens));
> -	unsigned use_sb = rctx->screen->debug_flags & DBG_SB;
> +	unsigned use_sb = !(rctx->screen->debug_flags & DBG_NO_SB);
>   	unsigned sb_disasm = use_sb || (rctx->screen->debug_flags & DBG_SB_DISASM);
>   
>   	shader->shader.bc.isa = rctx->isa;



More information about the mesa-dev mailing list