[Piglit] [PATCH v2 20/37] glean/tfragprog1: port MUL tests to shader_runner
Dylan Baker
dylan at pnwbakers.com
Tue Sep 6 19:20:58 UTC 2016
Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
tests/all.py | 2 --
tests/glean/tfragprog1.cpp | 28 ----------------------------
tests/spec/arb_fragment_program/built-in-functions/mul.shader_test | 19 +++++++++++++++++++
tests/spec/arb_fragment_program/swizzle-and-mask/masked-mul.shader_test | 19 +++++++++++++++++++
4 files changed, 38 insertions(+), 30 deletions(-)
create mode 100644 tests/spec/arb_fragment_program/built-in-functions/mul.shader_test
create mode 100644 tests/spec/arb_fragment_program/swizzle-and-mask/masked-mul.shader_test
diff --git a/tests/all.py b/tests/all.py
index 1ba96a4..0ebd5fc 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 = [
- 'MUL test',
- 'masked MUL test',
'POW test (exponentiation)',
'RCP test (reciprocal)',
'RCP test 2 (reciprocal)',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index b13e6cb..32b8313 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -82,34 +82,6 @@ static GLfloat FogCoord = 50.0; /* Between FogStart and FogEnd */
// Alphabetical order, please
static const FragmentProgram Programs[] = {
{
- "MUL test",
- "!!ARBfp1.0\n"
- "PARAM p = program.local[1]; \n"
- "MUL result.color, fragment.color, p; \n"
- "END \n",
- { CLAMP01(FragColor[0] * Param1[0]),
- CLAMP01(FragColor[1] * Param1[1]),
- CLAMP01(FragColor[2] * Param1[2]),
- CLAMP01(FragColor[3] * Param1[3])
- },
- DONT_CARE_Z
- },
- {
- "masked MUL test",
- "!!ARBfp1.0\n"
- "PARAM zero = program.local[0]; \n"
- "PARAM p = program.local[1]; \n"
- "MOV result.color, zero; \n"
- "MUL result.color.xy, fragment.color, p; \n"
- "END \n",
- { CLAMP01(FragColor[0] * Param1[0]),
- CLAMP01(FragColor[1] * Param1[1]),
- 0.0,
- 0.0
- },
- DONT_CARE_Z
- },
- {
"POW test (exponentiation)",
"!!ARBfp1.0\n"
"PARAM values = {0.5, 2, 3, 4}; \n"
diff --git a/tests/spec/arb_fragment_program/built-in-functions/mul.shader_test b/tests/spec/arb_fragment_program/built-in-functions/mul.shader_test
new file mode 100644
index 0000000..b407eb9
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/mul.shader_test
@@ -0,0 +1,19 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+PARAM q = program.local[1];
+MUL result.color, p, q;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 ( 1.0, 0.5, 0.0, -1.0)
+parameter local_fp 1 ( 0.5, 0.5, 1.0, 1.0)
+draw rect -1 -1 2 2
+# Note that the w value will be clamped
+probe all rgba 0.5 0.25 0.0 0.0
diff --git a/tests/spec/arb_fragment_program/swizzle-and-mask/masked-mul.shader_test b/tests/spec/arb_fragment_program/swizzle-and-mask/masked-mul.shader_test
new file mode 100644
index 0000000..d3add77
--- /dev/null
+++ b/tests/spec/arb_fragment_program/swizzle-and-mask/masked-mul.shader_test
@@ -0,0 +1,19 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+PARAM q = program.local[1];
+MOV result.color, {0.0, 0.0, 0.0, 0.0};
+MUL result.color.y, q, p;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (0.0, 1.0, 0.0, 0.0)
+parameter local_fp 1 (1.0, 1.0, 1.0, 1.0)
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 0.0
--
git-series 0.8.10
More information about the Piglit
mailing list