[Mesa-dev] [PATCH] radeonsi/nir: fix fs output index

Nicolai Hähnle nhaehnle at gmail.com
Mon Jan 22 12:45:45 UTC 2018


On 22.01.2018 04:57, Timothy Arceri wrote:
> Fixes the following piglit tests:
> 
> arb_blend_func_extended-fbo-extended-blend
> arb_blend_func_extended-fbo-extended-blend-explicit
> arb_blend_func_extended-fbo-extended-blend-explicit_gles3
> arb_blend_func_extended-fbo-extended-blend-pattern
> arb_blend_func_extended-fbo-extended-blend-pattern_gles2
> arb_blend_func_extended-fbo-extended-blend-pattern_gles3
> arb_blend_func_extended-fbo-extended-blend_gles3
> ext_framebuffer_multisample/alpha-to-coverage-dual-src-blend
> ext_framebuffer_multisample/alpha-to-one-dual-src-blend
> ---
>   src/gallium/drivers/radeonsi/si_shader_nir.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c
> index 5b941da949..81cf503d60 100644
> --- a/src/gallium/drivers/radeonsi/si_shader_nir.c
> +++ b/src/gallium/drivers/radeonsi/si_shader_nir.c
> @@ -378,6 +378,10 @@ void si_nir_scan_shader(const struct nir_shader *nir,
>   		if (nir->info.stage == MESA_SHADER_FRAGMENT) {
>   			tgsi_get_gl_frag_result_semantic(variable->data.location,
>   				&semantic_name, &semantic_index);
> +
> +			if (variable->data.index > 0) {
> +				semantic_index++;

Just to understand this correctly, variable->data.index == 1 indicates 
the second source in a dual source blend, and index values > 1 do not 
occur, right?

Could you please add a comment /* Adjust for dual source blending */ or 
similar?

With that:

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


> +			}
>   		} else {
>   			tgsi_get_gl_varying_semantic(variable->data.location, true,
>   						     &semantic_name, &semantic_index);
> 


-- 
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.


More information about the mesa-dev mailing list