[PATCH vkd3d v3 07/12] vkd3d-shader/hlsl: Add dimension types for textures to enum hlsl_sampler_dim.

Zebediah Figura (she/her) zfigura at codeweavers.com
Fri Dec 17 17:29:28 CST 2021


On 12/17/21 13:12, Francisco Casas wrote:
> diff --git a/libs/vkd3d-shader/hlsl_sm4.c b/libs/vkd3d-shader/hlsl_sm4.c
> index be35d125..cefe173d 100644
> --- a/libs/vkd3d-shader/hlsl_sm4.c
> +++ b/libs/vkd3d-shader/hlsl_sm4.c
> @@ -1291,7 +1291,7 @@ static void write_sm4_ld(struct hlsl_ctx *ctx, struct vkd3d_bytecode_buffer *buf
>           case HLSL_SAMPLER_DIM_CUBE:
>               break;
>   
> -        case HLSL_SAMPLER_DIM_GENERIC:
> +        default:
>               assert(0);
>       }
>   

I prefer to err on the side of avoiding 'default', to force one to 
explicitly deal with adding new cases to an enum.

In this case especially it seems especially incorrect, since at least 
some of the new enum values are valid cases and should be handled.



More information about the wine-devel mailing list