[Piglit] [PATCH v2 14/37] glean/tfragprog1: port LIT tests to shader_runner
Dylan Baker
dylan at pnwbakers.com
Tue Sep 6 19:20:52 UTC 2016
Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
tests/all.py | 3 ---
tests/glean/tfragprog1.cpp | 39 ---------------------------------------
tests/spec/arb_fragment_program/built-in-functions/lit-0-to-0.shader_test | 18 ++++++++++++++++++
tests/spec/arb_fragment_program/built-in-functions/lit-x-lt-0.shader_test | 19 +++++++++++++++++++
tests/spec/arb_fragment_program/built-in-functions/lit.shader_test | 17 +++++++++++++++++
5 files changed, 54 insertions(+), 42 deletions(-)
create mode 100644 tests/spec/arb_fragment_program/built-in-functions/lit-0-to-0.shader_test
create mode 100644 tests/spec/arb_fragment_program/built-in-functions/lit-x-lt-0.shader_test
create mode 100644 tests/spec/arb_fragment_program/built-in-functions/lit.shader_test
diff --git a/tests/all.py b/tests/all.py
index 1fb1dce..3b10361 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -376,9 +376,6 @@ glean_glsl_tests = ['Primary plus secondary color',
'texcoord varying']
glean_fp_tests = [
- 'LIT test 1',
- 'LIT test 2 (degenerate case: 0 ^ 0 -> 1)',
- 'LIT test 3 (case x < 0)',
'MAD test',
'MAX test',
'MIN test',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index 91f1171..f26f07f 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -81,45 +81,6 @@ static GLfloat FogCoord = 50.0; /* Between FogStart and FogEnd */
// These are the specific fragment programs which we'll test
// Alphabetical order, please
static const FragmentProgram Programs[] = {
- {
- "LIT test 1",
- "!!ARBfp1.0\n"
- "PARAM values = {0.65, 0.9, 0.0, 8.0}; \n"
- "LIT result.color, values; \n"
- "END \n",
- { 1.0,
- 0.65, // values.x
- 0.433, // roughly Pow(values.y, values.w)
- 1.0
- },
- DONT_CARE_Z
- },
- {
- "LIT test 2 (degenerate case: 0 ^ 0 -> 1)",
- "!!ARBfp1.0\n"
- "PARAM values = {0.65, 0.0, 0.0, 0.0}; \n"
- "LIT result.color, values; \n"
- "END \n",
- { 1.0,
- 0.65, // values.x
- 1.0, // 0^0
- 1.0
- },
- DONT_CARE_Z
- },
- {
- "LIT test 3 (case x < 0)",
- "!!ARBfp1.0\n"
- "PARAM values = {-0.5, 0.0, 0.0, 0.0}; \n"
- "LIT result.color, values; \n"
- "END \n",
- { 1.0,
- CLAMP01(-0.5), // values.x
- 0.0,
- 1.0
- },
- DONT_CARE_Z
- },
{
"LRP test",
"!!ARBfp1.0\n"
diff --git a/tests/spec/arb_fragment_program/built-in-functions/lit-0-to-0.shader_test b/tests/spec/arb_fragment_program/built-in-functions/lit-0-to-0.shader_test
new file mode 100644
index 0000000..acddb29
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/lit-0-to-0.shader_test
@@ -0,0 +1,18 @@
+# Covers the 0^0 = 1 case
+
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+LIT result.color, p;
+END
+
+[test]
+clear
+
+parameter local_fp 0 (0.65, 0.0, 0.0, 0.0)
+draw rect -1 -1 2 2
+# The 0.65 is p.x, and 0.433 is roughly pow(0.65, 0.9)
+probe all rgba 1.0 0.65 1.0 1.0
diff --git a/tests/spec/arb_fragment_program/built-in-functions/lit-x-lt-0.shader_test b/tests/spec/arb_fragment_program/built-in-functions/lit-x-lt-0.shader_test
new file mode 100644
index 0000000..99dc19f
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/lit-x-lt-0.shader_test
@@ -0,0 +1,19 @@
+# Covers the x < 0 case
+
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+LIT result.color, p;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (-0.5, 0.0, 0.0, 0.0)
+draw rect -1 -1 2 2
+# The 0.65 is p.x, and 0.433 is roughly pow(0.65, 0.9)
+probe all rgba 1.0 0.65 1.0 1.0
diff --git a/tests/spec/arb_fragment_program/built-in-functions/lit.shader_test b/tests/spec/arb_fragment_program/built-in-functions/lit.shader_test
new file mode 100644
index 0000000..e1d62d7
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/lit.shader_test
@@ -0,0 +1,17 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+LIT result.color, p;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (0.65, 0.9, 0.0, 8.0)
+draw rect -1 -1 2 2
+# The 0.65 is p.x, and 0.433 is roughly pow(0.65, 0.9)
+probe all rgba 1.0 0.65 1.0 1.0
--
git-series 0.8.10
More information about the Piglit
mailing list