[v2,2/37] glean/tfragprog1: port ABS test to shader_runner

Submitted by Dylan Baker on Sept. 6, 2016, 7:20 p.m.

Details

Message ID 6eb98c715e9adab2549d8356ed21b217a4e7e887.1473189647.git-series.dylan@pnwbakers.com
State New
Headers show
Series "Port Glean Frag-prog tests to shader_runner" ( rev: 1 ) in Piglit

Not browsing as part of any series.

Commit Message

Dylan Baker Sept. 6, 2016, 7:20 p.m.
Possible duplicate tests:
shaders/fp-abs-01.c
shaders/fp-abs-02.c

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
---
 tests/all.py                                                       |  2 +-
 tests/glean/tfragprog1.cpp                                         | 13 -------------
 tests/spec/arb_fragment_program/built-in-functions/abs.shader_test | 16 ++++++++++++++++
 3 files changed, 17 insertions(+), 14 deletions(-)
 create mode 100644 tests/spec/arb_fragment_program/built-in-functions/abs.shader_test

Patch hide | download patch | download mbox

diff --git a/tests/all.py b/tests/all.py
index 3961656..0f4a3c5 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -375,7 +375,7 @@  glean_glsl_tests = ['Primary plus secondary color',
                     'varying read but not written',
                     'texcoord varying']
 
-glean_fp_tests = ['ABS test',
+glean_fp_tests = [
                   'ADD test',
                   'ADD with saturation',
                   'ADD an immediate',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index 837382c..bc340ed 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -82,19 +82,6 @@  static GLfloat FogCoord = 50.0;  /* Between FogStart and FogEnd */
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
 	{
-		"ABS test",
-		"!!ARBfp1.0\n"
-		"PARAM p = program.local[2]; \n"
-		"ABS result.color, p; \n"
-		"END \n",
-		{ ABS(Param2[0]),
-		  ABS(Param2[1]),
-		  ABS(Param2[2]),
-		  ABS(Param2[3])
-		},
-		DONT_CARE_Z,
-	},
-	{
 		"ADD test",
 		"!!ARBfp1.0\n"
 		"PARAM p = program.local[1]; \n"
diff --git a/tests/spec/arb_fragment_program/built-in-functions/abs.shader_test b/tests/spec/arb_fragment_program/built-in-functions/abs.shader_test
new file mode 100644
index 0000000..87949d1
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/abs.shader_test
@@ -0,0 +1,16 @@ 
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+ABS result.color, p;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (0.0, -1.0, 0.25, -0.5)
+draw rect -1 -1 2 2 
+probe all rgba 0.0 1.0 0.25 0.5

Comments

On Tue, Sep 06, 2016 at 12:20:40PM -0700, Dylan Baker wrote:
> Possible duplicate tests:
> shaders/fp-abs-01.c
> shaders/fp-abs-02.c
> 
> Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
> ---
>  tests/all.py                                                       |  2 +-
>  tests/glean/tfragprog1.cpp                                         | 13 -------------
>  tests/spec/arb_fragment_program/built-in-functions/abs.shader_test | 16 ++++++++++++++++
>  3 files changed, 17 insertions(+), 14 deletions(-)
>  create mode 100644 tests/spec/arb_fragment_program/built-in-functions/abs.shader_test
> 
> diff --git a/tests/all.py b/tests/all.py
> index 3961656..0f4a3c5 100644
> --- a/tests/all.py
> +++ b/tests/all.py
> @@ -375,7 +375,7 @@ glean_glsl_tests = ['Primary plus secondary color',
>                      'varying read but not written',
>                      'texcoord varying']
>  
> -glean_fp_tests = ['ABS test',
> +glean_fp_tests = [
>                    'ADD test',
>                    'ADD with saturation',
>                    'ADD an immediate',
> diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
> index 837382c..bc340ed 100644
> --- a/tests/glean/tfragprog1.cpp
> +++ b/tests/glean/tfragprog1.cpp
> @@ -82,19 +82,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and FogEnd */
>  // Alphabetical order, please
>  static const FragmentProgram Programs[] = {
>  	{
> -		"ABS test",
> -		"!!ARBfp1.0\n"
> -		"PARAM p = program.local[2]; \n"
> -		"ABS result.color, p; \n"
> -		"END \n",
> -		{ ABS(Param2[0]),
> -		  ABS(Param2[1]),
> -		  ABS(Param2[2]),
> -		  ABS(Param2[3])
> -		},
> -		DONT_CARE_Z,
> -	},
> -	{
>  		"ADD test",
>  		"!!ARBfp1.0\n"
>  		"PARAM p = program.local[1]; \n"
> diff --git a/tests/spec/arb_fragment_program/built-in-functions/abs.shader_test b/tests/spec/arb_fragment_program/built-in-functions/abs.shader_test
> new file mode 100644
> index 0000000..87949d1
> --- /dev/null
> +++ b/tests/spec/arb_fragment_program/built-in-functions/abs.shader_test
> @@ -0,0 +1,16 @@
> +[require]
> +GL_ARB_fragment_program
> +
> +[fragment program]
> +!!ARBfp1.0
> +PARAM p = program.local[0];
> +ABS result.color, p;
> +END
> +
> +[test]
> +clear color 0.5 0.5 0.5 0.5

Original uses clear color of "FRAGCOLOR { 0.25, 0.75, 0.5, 0.25 }". There is
not much difference expect in your case fourth component is cleared to 0.5
which is also the value expected in the end. I'd rather have that as something
else to make sure implementation didn't just fail to overwrite it.

Otherwise this looks to match the original test. Nice:

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>

> +clear
> +
> +parameter local_fp 0 (0.0, -1.0, 0.25, -0.5)
> +draw rect -1 -1 2 2 
> +probe all rgba 0.0 1.0 0.25 0.5
> -- 
> git-series 0.8.10
> _______________________________________________
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit