[Mesa-dev] [PATCH 1/2] radv/ac: switch an if to switch

Edward O'Callaghan funfunctor at folklore1984.net
Mon Jan 16 22:50:53 UTC 2017


Patches 1 & 2 are,
Reviewed-by: Edward O'Callaghan <funfunctor at folklore1984.net>

On 01/17/2017 09:47 AM, Dave Airlie wrote:
> From: Dave Airlie <airlied at redhat.com>
> 
> makes it easier to add other shader stages.
> 
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  src/amd/common/ac_nir_to_llvm.c | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
> index 3173aa5..6d98fde 100644
> --- a/src/amd/common/ac_nir_to_llvm.c
> +++ b/src/amd/common/ac_nir_to_llvm.c
> @@ -4626,11 +4626,16 @@ void ac_compile_nir_shader(LLVMTargetMachineRef tm,
>  	/* +3 for scratch wave offset and VCC */
>  	config->num_sgprs = MAX2(config->num_sgprs,
>  	                         shader_info->num_input_sgprs + 3);
> -	if (nir->stage == MESA_SHADER_COMPUTE) {
> +
> +	switch (nir->stage) {
> +	case MESA_SHADER_COMPUTE:
>  		for (int i = 0; i < 3; ++i)
>  			shader_info->cs.block_size[i] = nir->info->cs.local_size[i];
> -	}
> -
> -	if (nir->stage == MESA_SHADER_FRAGMENT)
> +		break;
> +	case MESA_SHADER_FRAGMENT:
>  		shader_info->fs.early_fragment_test = nir->info->fs.early_fragment_tests;
> +		break;
> +	default:
> +		break;
> +	}
>  }
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170117/b662907d/attachment-0001.sig>


More information about the mesa-dev mailing list