[Piglit] [PATCH 05/37] glean/tfragprog1: port COS tests to shader runner
Dylan Baker
dylan at pnwbakers.com
Thu Apr 28 21:38:27 UTC 2016
This ports both of the COS tests to shader runner.
Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
tests/all.py | 2 --
tests/glean/tfragprog1.cpp | 32 ----------------------
.../cos-clamped-values.shader_test | 22 +++++++++++++++
.../built-in-functions/cos.shader_test | 19 +++++++++++++
4 files changed, 41 insertions(+), 34 deletions(-)
create mode 100644 tests/spec/arb_fragment_program/built-in-functions/cos-clamped-values.shader_test
create mode 100644 tests/spec/arb_fragment_program/built-in-functions/cos.shader_test
diff --git a/tests/all.py b/tests/all.py
index 827e4e7..91dec52 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -376,8 +376,6 @@ glean_glsl_tests = ['Primary plus secondary color',
'texcoord varying']
glean_fp_tests = [
- 'COS test',
- 'COS test 2',
'DP3 test',
'DP3 test (2)',
'DP4 test',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index 878e7ac..85e8ecd 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -82,38 +82,6 @@ static GLfloat FogCoord = 50.0; /* Between FogStart and FogEnd */
// Alphabetical order, please
static const FragmentProgram Programs[] = {
{
- "COS test",
- "!!ARBfp1.0\n"
- "PARAM values = { 0.0, 3.14159, 0.5, 1.0 }; \n"
- "COS result.color.x, values.x; \n"
- "COS result.color.y, values.y; \n"
- "COS result.color.z, values.z; \n"
- "COS result.color.w, values.w; \n"
- "END \n",
- { CLAMP01(1.0),
- CLAMP01(-1.0),
- CLAMP01(0.8775),
- CLAMP01(0.5403)
- },
- DONT_CARE_Z
- },
- {
- "COS test 2",
- "!!ARBfp1.0\n"
- "PARAM values = { 6.78318, 7.28318, 6.28318, -5.78318 }; \n"
- "COS result.color.x, values.x; \n"
- "COS result.color.y, values.y; \n"
- "COS result.color.z, values.z; \n"
- "COS result.color.w, values.w; \n"
- "END \n",
- { CLAMP01(0.8775),
- CLAMP01(0.5403),
- CLAMP01(1.0),
- CLAMP01(0.8775)
- },
- DONT_CARE_Z
- },
- {
"DP3 test",
"!!ARBfp1.0\n"
"PARAM p1 = program.local[1]; \n"
diff --git a/tests/spec/arb_fragment_program/built-in-functions/cos-clamped-values.shader_test b/tests/spec/arb_fragment_program/built-in-functions/cos-clamped-values.shader_test
new file mode 100644
index 0000000..e6ea4d8
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/cos-clamped-values.shader_test
@@ -0,0 +1,22 @@
+# Variant of the COS test that uses values that are all clamped by the nature
+# of COS
+
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+COS result.color.x, p.x;
+COS result.color.y, p.y;
+COS result.color.z, p.z;
+COS result.color.w, p.w;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (6.78318, 7.28318, 6.28318, -5.78318)
+draw rect -1 -1 2 2
+probe all rgba 0.8775 0.5403 1.0 0.8775
diff --git a/tests/spec/arb_fragment_program/built-in-functions/cos.shader_test b/tests/spec/arb_fragment_program/built-in-functions/cos.shader_test
new file mode 100644
index 0000000..932b1ae
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/cos.shader_test
@@ -0,0 +1,19 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+COS result.color.x, p.x;
+COS result.color.y, p.y;
+COS result.color.z, p.z;
+COS result.color.w, p.w;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (0.0, 3.14159, 0.5, 1.0)
+draw rect -1 -1 2 2
+probe all rgba 1.0 0.0 0.8775 0.5403
--
2.8.0
More information about the Piglit
mailing list