From: Zebediah Figura Subject: Re: [PATCH vkd3d 5/5] tests: Test arithmetic int operations without constant operands. Message-Id: Date: Thu, 30 Jun 2022 23:43:22 -0500 In-Reply-To: <20220629145555.871548-5-gmascellani@codeweavers.com> References: <20220629145555.871548-1-gmascellani@codeweavers.com> <20220629145555.871548-5-gmascellani@codeweavers.com> On 6/29/22 09:55, Giovanni Mascellani wrote: > diff --git a/tests/arithmetic-int-uniform.shader_test b/tests/arithmetic-int-uniform.shader_test > new file mode 100644 > index 00000000..9bd7f2ac > --- /dev/null > +++ b/tests/arithmetic-int-uniform.shader_test > @@ -0,0 +1,28 @@ > +[require] > +shader model >= 4.0 Passing "uniform int" requires sm4 (well, sort of), but the actual operations should be possible with sm1. Perhaps pass the inputs as floats and then cast them to int variables before performing arithmetic? > + > +[pixel shader] > +uniform int x, y; > + > +float4 main() : SV_TARGET > +{ > + return float4(x + y, x - y, x * y, x / y); > +} > + > +[test] > +uniform 0 int4 5 15 0 0 > +todo draw quad > +probe all rgba (20.0, -10.0, 75.0, 0.0) > + > +[pixel shader] > +uniform int x, y; > + > +float4 main() : SV_TARGET > +{ > + return float4(x % y, +x, -x, y / x); > +} > + > +[test] > +uniform 0 int4 5 15 0 0 > +todo draw quad > +probe all rgba (5.0, 5.0, -5.0, 3.0)