Zebediah Figura : tests: Import trigonometry tests from Wine.
Alexandre Julliard
julliard at winehq.org
Fri Oct 2 14:49:22 CDT 2020
Module: vkd3d
Branch: master
Commit: c3ac07efa75a03bc45fa930189d27b7beb4d7d7d
URL: https://source.winehq.org/git/vkd3d.git/?a=commit;h=c3ac07efa75a03bc45fa930189d27b7beb4d7d7d
Author: Zebediah Figura <zfigura at codeweavers.com>
Date: Thu Oct 1 23:09:44 2020 -0500
tests: Import trigonometry tests from Wine.
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
Makefile.am | 6 ++++--
tests/shader_runner_d3d12.c | 23 +++++++++++++++++++++++
tests/trigonometry.shader_test | 24 ++++++++++++++++++++++++
3 files changed, 51 insertions(+), 2 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 27bc00b..2e286bc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -61,7 +61,8 @@ vkd3d_shader_tests = \
tests/swizzle-4.shader_test \
tests/swizzle-5.shader_test \
tests/swizzle-6.shader_test \
- tests/swizzle-7.shader_test
+ tests/swizzle-7.shader_test \
+ tests/trigonometry.shader_test
vkd3d_test_headers = \
tests/d3d12_crosstest.h \
@@ -192,7 +193,8 @@ XFAIL_TESTS = \
tests/swizzle-4.shader_test \
tests/swizzle-5.shader_test \
tests/swizzle-6.shader_test \
- tests/swizzle-7.shader_test
+ tests/swizzle-7.shader_test \
+ tests/trigonometry.shader_test
endif
if BUILD_DEMOS
diff --git a/tests/shader_runner_d3d12.c b/tests/shader_runner_d3d12.c
index 709fc00..0e9694a 100644
--- a/tests/shader_runner_d3d12.c
+++ b/tests/shader_runner_d3d12.c
@@ -190,6 +190,29 @@ static void parse_test_directive(struct shader_context *context, const char *lin
release_resource_readback(&rb);
reset_command_list(context->c.list, context->c.allocator);
}
+ else if (match_string(line, "probe rgba", &line))
+ {
+ struct resource_readback rb;
+ unsigned int x, y, ulps;
+ struct vec4 v;
+ RECT rect;
+ int ret;
+
+ ret = sscanf(line, "( %u , %u ) ( %f , %f , %f , %f ) %u", &x, &y, &v.x, &v.y, &v.z, &v.w, &ulps);
+ if (ret < 6)
+ goto err;
+ if (ret < 7)
+ ulps = 0;
+
+ get_texture_readback_with_command_list(context->c.render_target, 0, &rb, context->c.queue, context->c.list);
+ rect.left = x;
+ rect.right = x + 1;
+ rect.top = y;
+ rect.bottom = y + 1;
+ check_readback_data_vec4(&rb, &rect, &v, ulps);
+ release_resource_readback(&rb);
+ reset_command_list(context->c.list, context->c.allocator);
+ }
else if (match_string(line, "uniform", &line))
{
unsigned int offset;
diff --git a/tests/trigonometry.shader_test b/tests/trigonometry.shader_test
new file mode 100644
index 0000000..07a280a
--- /dev/null
+++ b/tests/trigonometry.shader_test
@@ -0,0 +1,24 @@
+[pixel shader]
+float4 main(float4 pos : SV_POSITION) : SV_TARGET
+{
+ return float4(sin(pos.x - 0.5), cos(pos.x - 0.5), 0, 0);
+}
+
+[test]
+draw quad
+probe rgba ( 0, 0) ( 0.00000000, 1.00000000, 0.0, 0.0)
+probe rgba ( 1, 0) ( 0.84147098, 0.54030231, 0.0, 0.0) 1024
+probe rgba ( 2, 0) ( 0.90929743, -0.41614684, 0.0, 0.0) 1024
+probe rgba ( 3, 0) ( 0.14112001, -0.98999250, 0.0, 0.0) 1024
+probe rgba ( 4, 0) (-0.75680250, -0.65364362, 0.0, 0.0) 1024
+probe rgba ( 5, 0) (-0.95892427, 0.28366219, 0.0, 0.0) 1024
+probe rgba ( 6, 0) (-0.27941550, 0.96017029, 0.0, 0.0) 1024
+probe rgba ( 7, 0) ( 0.65698660, 0.75390225, 0.0, 0.0) 1024
+probe rgba ( 8, 0) ( 0.98935825, -0.14550003, 0.0, 0.0) 1024
+probe rgba ( 9, 0) ( 0.41211849, -0.91113026, 0.0, 0.0) 1024
+probe rgba (10, 0) (-0.54402111, -0.83907153, 0.0, 0.0) 1024
+probe rgba (11, 0) (-0.99999021, 0.00442570, 0.0, 0.0) 1024
+probe rgba (12, 0) (-0.53657292, 0.84385396, 0.0, 0.0) 1024
+probe rgba (13, 0) ( 0.42016704, 0.90744678, 0.0, 0.0) 1024
+probe rgba (14, 0) ( 0.99060736, 0.13673722, 0.0, 0.0) 1024
+probe rgba (15, 0) ( 0.65028784, -0.75968791, 0.0, 0.0) 1024
More information about the wine-cvs
mailing list