[Mesa-dev] [PATCH 4/8] radeonsi: fix dummy export in shaders

Michel Dänzer michel at daenzer.net
Mon Jul 30 05:17:12 PDT 2012


On Mon, 2012-07-30 at 12:31 +0200, Christian König wrote: 
> Signed-off-by: Christian König <deathsimple at vodafone.de>
> ---
>  src/gallium/drivers/radeonsi/radeonsi_shader.c |   17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/src/gallium/drivers/radeonsi/radeonsi_shader.c b/src/gallium/drivers/radeonsi/radeonsi_shader.c
> index 66050d3..67a5465 100644
> --- a/src/gallium/drivers/radeonsi/radeonsi_shader.c
> +++ b/src/gallium/drivers/radeonsi/radeonsi_shader.c
> @@ -475,6 +475,23 @@ static void si_llvm_emit_epilogue(struct lp_build_tgsi_context * bld_base)
>  		}
>  	}
>  
> +	if (!last_args[0]) {
> +		/* Specify which components to enable */
> +		last_args[0] = lp_build_const_int32(base->gallivm, 0x0);
> +
> +		/* Specify the target we are exporting */
> +		last_args[3] = lp_build_const_int32(base->gallivm, V_008DFC_SQ_EXP_MRT);
> +
> +		/* Set COMPR flag to zero to export data as 32-bit */
> +		last_args[4] = uint->zero;
> +
> +		/* dummy bits */
> +		last_args[5]= uint->zero;
> +		last_args[6]= uint->zero;
> +		last_args[7]= uint->zero;
> +		last_args[8]= uint->zero;
> +	}

I'd add

               assert(si_shader_ctx->type == TGSI_PROCESSOR_FRAGMENT);

in the new block, as the vertex shader is required to export at least
one position.

Either way though, the series is

Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>


-- 
Earthling Michel Dänzer           |                   http://www.amd.com
Libre software enthusiast         |          Debian, X and DRI developer


More information about the mesa-dev mailing list