[PATCH vkd3d 3/5] vkd3d-shader: Print offending values for more error messages.

Matteo Bruni matteo.mystral at gmail.com
Thu Mar 4 03:54:51 CST 2021


On Tue, Mar 2, 2021 at 10:35 PM Zebediah Figura <zfigura at codeweavers.com> wrote:
>
> Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
> ---
>  libs/vkd3d-shader/hlsl.y | 97 ++++++++++++++++++++++++++++++----------
>  1 file changed, 74 insertions(+), 23 deletions(-)

I'm hijacking this one just to refer to the existing code.

> @@ -1438,7 +1459,8 @@ static struct list *declare_vars(struct hlsl_ctx *ctx, struct hlsl_type *basic_t
>                  if (size < type->dimx * type->dimy)
>                  {
>                      hlsl_error(ctx, v->loc, VKD3D_SHADER_ERROR_HLSL_WRONG_PARAMETER_COUNT,
> -                            "Wrong number of parameters in numeric initializer.");
> +                            "Expected %u components in numeric initializer, but got %u.",
> +                            type->dimx * type->dimy, size);
>                      free_parse_initializer(&v->initializer);
>                      vkd3d_free(v);
>                      continue;

It would be interesting to know (or probably, remember) why this is
complaining if the initializer is smaller than required but not if
it's larger. Native _43 seems to report an error in both cases, maybe
older compilers didn't? Or maybe it's just wrong...



More information about the wine-devel mailing list