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)