[PATCH vkd3d 2/5] tests: Add some tests for casting output arguments to functions.

Matteo Bruni matteo.mystral at gmail.com
Thu Feb 24 08:07:58 CST 2022


On Thu, Feb 17, 2022 at 5:17 PM Francisco Casas <fcasas at codeweavers.com> wrote:
>
> Hello,
>
> February 16, 2022 2:47 AM, "Zebediah Figura" <zfigura at codeweavers.com> wrote:
>
> > +
> > +% You can't cast an inout parameter, though.
> > +
> > +[pixel shader fail]
> > +
> > +void func(inout float4 a)
> > +{
> > + a += 0.1;
> > +}
> > +
> > +float4 main(uniform int4 i) : sv_target
> > +{
> > + int4 x = i;
> > + func((float4)x);
> > + return x;
> > +}
> > --
> > 2.34.1
>
> For some reason the shader actually compiles using ps_3_0 and lower.
> Maybe a [require] should be added? Or maybe, we should just allow it always.

Nice catch! On SM1, aside from some very specific cases, only floats
really exist. In particular, mathematical expressions only apply to
floats and, indeed, the native compiler generates a float uniform for
'i'. I guess the cast is implicitly dropped when compiling for e.g.
ps_2_0 so there is no error there.

I resent the patch without this test for the time being.



More information about the wine-devel mailing list