[Mesa-dev] [PATCH 6/6] radeonsi: fix issues with monolithic shaders

Nicolai Hähnle nhaehnle at gmail.com
Mon Feb 20 16:28:56 UTC 2017


For the series:

Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>


On 19.02.2017 17:27, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
>
> R600_DEBUG=mono has had no effect since:
>
>     commit 1fabb297177069e95ec1bb7053acb32f8ec3e092
>     Author: Marek Olšák <marek.olsak at amd.com>
>     Date:   Tue Feb 14 22:08:32 2017 +0100
>
>     radeonsi: have separate LS and ES main shader parts in the shader selector
>
> Also, this assertion was failing:
>     si_state_shaders.c:1307: si_shader_select_with_key: Assertion
>     `!shader->is_optimized' failed.
> ---
>  src/gallium/drivers/radeonsi/si_state_shaders.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c
> index 727ff33..12ea20b 100644
> --- a/src/gallium/drivers/radeonsi/si_state_shaders.c
> +++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
> @@ -1235,20 +1235,21 @@ again:
>  		return -ENOMEM;
>  	}
>  	shader->selector = sel;
>  	shader->key = *key;
>  	shader->compiler_ctx_state = *compiler_state;
>
>  	/* Compile the main shader part if it doesn't exist. This can happen
>  	 * if the initial guess was wrong. */
>  	struct si_shader **mainp = si_get_main_shader_part(sel, key);
>  	bool is_pure_monolithic =
> +		sscreen->use_monolithic_shaders ||
>  		memcmp(&key->mono, &zeroed.mono, sizeof(key->mono)) != 0;
>
>  	if (!*mainp && !is_pure_monolithic) {
>  		struct si_shader *main_part = CALLOC_STRUCT(si_shader);
>
>  		if (!main_part) {
>  			FREE(shader);
>  			pipe_mutex_unlock(sel->mutex);
>  			return -ENOMEM; /* skip the draw call */
>  		}
> @@ -1268,21 +1269,21 @@ again:
>  		*mainp = main_part;
>  	}
>
>  	/* Monolithic-only shaders don't make a distinction between optimized
>  	 * and unoptimized. */
>  	shader->is_monolithic =
>  		is_pure_monolithic ||
>  		memcmp(&key->opt, &zeroed.opt, sizeof(key->opt)) != 0;
>
>  	shader->is_optimized =
> -		!sscreen->use_monolithic_shaders &&
> +		!is_pure_monolithic &&
>  		memcmp(&key->opt, &zeroed.opt, sizeof(key->opt)) != 0;
>  	if (shader->is_optimized)
>  		util_queue_fence_init(&shader->optimized_ready);
>
>  	if (!sel->last_variant) {
>  		sel->first_variant = shader;
>  		sel->last_variant = shader;
>  	} else {
>  		sel->last_variant->next_variant = shader;
>  		sel->last_variant = shader;
>



More information about the mesa-dev mailing list