[Piglit] [PATCH 02/25] glean/tfragprog1: port LIT tests to shader_runner

2016-04-29 Thread Dylan Baker
Signed-off-by: Dylan Baker 
---
 tests/all.py   |  3 --
 tests/glean/tfragprog1.cpp | 39 --
 .../built-in-functions/lit-0-to-0.shader_test  | 18 ++
 .../built-in-functions/lit-x-lt-0.shader_test  | 19 +++
 .../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 093c2b0..d0adcbc 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 000..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 000..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 000..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
-- 
2.8.0

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 06/25] glean/tfragprog1: port MIN test to shader_runner

2016-04-29 Thread Dylan Baker
Signed-off-by: Dylan Baker 
---
 tests/all.py   |  1 -
 tests/glean/tfragprog1.cpp | 13 -
 .../built-in-functions/min.shader_test | 18 ++
 3 files changed, 18 insertions(+), 14 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/min.shader_test

diff --git a/tests/all.py b/tests/all.py
index 42b4d7b..166216d 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -376,7 +376,6 @@ glean_glsl_tests = ['Primary plus secondary color',
 'texcoord varying']
 
 glean_fp_tests = [
-  'MIN test',
   'MOV test',
   'MUL test',
   'masked MUL test',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index 2a77702..d8ba52c 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[] = {
{
-   "MIN test",
-   "!!ARBfp1.0\n"
-   "PARAM p1 = program.local[1]; \n"
-   "MIN result.color, p1, fragment.color; \n"
-   "END \n",
-   { MIN(Param1[0], FragColor[0]),
- MIN(Param1[1], FragColor[1]),
- MIN(Param1[2], FragColor[2]),
- MIN(Param1[3], FragColor[3]),
-   },
-   DONT_CARE_Z
-   },
-   {
"MOV test",
"!!ARBfp1.0\n"
"MOV result.color, fragment.color; \n"
diff --git a/tests/spec/arb_fragment_program/built-in-functions/min.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/min.shader_test
new file mode 100644
index 000..2a09b17
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/min.shader_test
@@ -0,0 +1,18 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+PARAM q = program.local[1];
+MIN result.color, p, q;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (0.0, 0.0, -1.0, 0.5)
+parameter local_fp 1 (0.5, 1.0, 1.0,  1.0)
+draw rect -1 -1 2 2
+probe all rgba 0.0 0.0 0.0 0.5
-- 
2.8.0

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 04/25] glean/tfragprog1: port MAD test to shader_runner

2016-04-29 Thread Dylan Baker
This isn't an exact port, some of the values were changed to be simpler,
easier for humans to calculate values, but it shouldn't affect the
viability of the test.

Signed-off-by: Dylan Baker 
---
 tests/all.py |  1 -
 tests/glean/tfragprog1.cpp   | 14 --
 .../built-in-functions/mad.shader_test   | 20 
 3 files changed, 20 insertions(+), 15 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/mad.shader_test

diff --git a/tests/all.py b/tests/all.py
index d0adcbc..ca3eab5 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -376,7 +376,6 @@ glean_glsl_tests = ['Primary plus secondary color',
 'texcoord varying']
 
 glean_fp_tests = [
-  'MAD test',
   'MAX test',
   'MIN test',
   'MOV test',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index bb79963..9254e11 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -82,20 +82,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and 
FogEnd */
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
{
-   "MAD test",
-   "!!ARBfp1.0\n"
-   "PARAM p1 = program.local[1]; \n"
-   "PARAM p2 = program.local[2]; \n"
-   "MAD result.color, fragment.color, p1, p2; \n"
-   "END \n",
-   { CLAMP01(FragColor[0] * Param1[0] + Param2[0]),
- CLAMP01(FragColor[1] * Param1[1] + Param2[1]),
- CLAMP01(FragColor[2] * Param1[2] + Param2[2]),
- CLAMP01(FragColor[3] * Param1[3] + Param2[3])
-   },
-   DONT_CARE_Z
-   },
-   {
"MAX test",
"!!ARBfp1.0\n"
"PARAM p1 = program.local[1]; \n"
diff --git a/tests/spec/arb_fragment_program/built-in-functions/mad.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/mad.shader_test
new file mode 100644
index 000..8895117
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/mad.shader_test
@@ -0,0 +1,20 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+PARAM q = program.local[1];
+PARAM r = program.local[2];
+MAD result.color, p, q, r;
+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)
+parameter local_fp 2 (0.25, 0.0, 0.5, -1.0)
+draw rect -1 -1 2 2
+probe all rgba 0.75 0.25 0.5 0.0
-- 
2.8.0

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 03/25] glean/tfragprog1: port LRP test to shader_runner

2016-04-29 Thread Dylan Baker
It's worth noting that this test wasn't included in all.py, and
therefore hasn't been running.

Signed-off-by: Dylan Baker 
---
 tests/glean/tfragprog1.cpp   | 14 --
 .../built-in-functions/lrp.shader_test   | 20 
 2 files changed, 20 insertions(+), 14 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/lrp.shader_test

diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index f26f07f..bb79963 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -81,20 +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[] = {
-{
-   "LRP test",
-   "!!ARBfp1.0\n"
-   "PARAM p1 = program.local[1]; \n"
-   "PARAM t = {0.2, 0.5, 1.0, 0.0}; \n"
-   "LRP result.color, t, fragment.color, p1; \n"
-   "END \n",
-   { 0.2 * FragColor[0] + (1.0 - 0.2) * Param1[0],
- 0.5 * FragColor[1] + (1.0 - 0.5) * Param1[1],
- 1.0 * FragColor[2] + (1.0 - 1.0) * Param1[2],
- 0.0 * FragColor[3] + (1.0 - 0.0) * Param1[3]
-   },
-   DONT_CARE_Z
-   },
{
"MAD test",
"!!ARBfp1.0\n"
diff --git a/tests/spec/arb_fragment_program/built-in-functions/lrp.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/lrp.shader_test
new file mode 100644
index 000..96a55c2
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/lrp.shader_test
@@ -0,0 +1,20 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+PARAM q = program.local[1];
+PARAM r = program.local[2];
+LRP result.color, p, q, r;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (0.5, 0.25, 1.0, 0.5)
+parameter local_fp 1 (0.2, 0.5, 0.8, 0.0)
+parameter local_fp 2 (0.3, 0.2, 0.1, 0.4)
+draw rect -1 -1 2 2
+probe all rgba 0.25 0.275 0.8 0.2
-- 
2.8.0

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 13/25] glean/tfragprog1: port SGE test to shader_runner

2016-04-29 Thread Dylan Baker
Signed-off-by: Dylan Baker 
---
 tests/all.py |  1 -
 tests/glean/tfragprog1.cpp   | 14 --
 .../built-in-functions/sge.shader_test   | 20 
 3 files changed, 20 insertions(+), 15 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/sge.shader_test

diff --git a/tests/all.py b/tests/all.py
index 4fbf31b..8b480cd 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -376,7 +376,6 @@ glean_glsl_tests = ['Primary plus secondary color',
 'texcoord varying']
 
 glean_fp_tests = [
-  'SGE test',
   'SIN test',
   'SIN test 2',
   'SLT test',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index 0ca8837..955166b 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -82,20 +82,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and 
FogEnd */
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
{
-   "SGE test",
-   "!!ARBfp1.0\n"
-   "PARAM p0 = program.local[0]; \n"
-   "PARAM p2 = program.local[2]; \n"
-   "SGE result.color, p2, p0; \n"
-   "END \n",
-   { Param2[0] >= Param0[0] ? 1.0 : 0.0,
- Param2[1] >= Param0[1] ? 1.0 : 0.0,
- Param2[2] >= Param0[2] ? 1.0 : 0.0,
- Param2[3] >= Param0[3] ? 1.0 : 0.0,
-   },
-   DONT_CARE_Z
-   },
-   {
"SIN test",
"!!ARBfp1.0\n"
"PARAM values = { 1.57079, -1.57079, 0.5, 1.0 }; \n"
diff --git a/tests/spec/arb_fragment_program/built-in-functions/sge.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/sge.shader_test
new file mode 100644
index 000..c2a774f
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/sge.shader_test
@@ -0,0 +1,20 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+PARAM q = program.local[1];
+PARAM r = {1.0, 1.0, 0.0, 0.0};
+MOV result.color, q;
+SGE result.color, p, q;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (1.0, 0.1,  0.0, -0.5)
+parameter local_fp 1 (0.0, 0.0, -1.0,  1.0)
+draw rect -1 -1 2 2
+probe all rgba 1.0 1.0 1.0 0.0
-- 
2.8.0

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 12/25] glean/tfragprog1: port SCS test to shader_runner

2016-04-29 Thread Dylan Baker
Signed-off-by: Dylan Baker 
---
 tests/all.py  |  1 -
 tests/glean/tfragprog1.cpp| 14 --
 .../built-in-functions/scs.shader_test| 19 +++
 3 files changed, 19 insertions(+), 15 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/scs.shader_test

diff --git a/tests/all.py b/tests/all.py
index 4382a39..4fbf31b 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -376,7 +376,6 @@ glean_glsl_tests = ['Primary plus secondary color',
 'texcoord varying']
 
 glean_fp_tests = [
-  'SCS test',
   'SGE test',
   'SIN test',
   'SIN test 2',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index ab1a8ea..0ca8837 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -82,20 +82,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and 
FogEnd */
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
{
-   "SCS test",
-   "!!ARBfp1.0\n"
-   "PARAM values = { 0.5, 0.5, 0.0, 0.0 }; \n"
-   "SCS result.color.x, values.x; \n"
-   "SCS result.color.y, values.y; \n"
-   "END \n",
-   { CLAMP01(0.8775),
- CLAMP01(0.4794),
- DONT_CARE_COLOR,
- DONT_CARE_COLOR,
-   },
-   DONT_CARE_Z
-   },
-   {
"SGE test",
"!!ARBfp1.0\n"
"PARAM p0 = program.local[0]; \n"
diff --git a/tests/spec/arb_fragment_program/built-in-functions/scs.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/scs.shader_test
new file mode 100644
index 000..4f20728
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/scs.shader_test
@@ -0,0 +1,19 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+PARAM q = {1.0, 1.0, 0.0, 0.0};
+MOV result.color, q;
+SCS result.color.x, p.x;
+SCS result.color.y, p.y;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (0.5, 0.5, 0.0, 0.0)
+draw rect -1 -1 2 2
+probe all rgba 0.8775 0.4794 0.0 0.0
-- 
2.8.0

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 08/25] glean/tfragprog1: port MUL tests to shader_runner

2016-04-29 Thread Dylan Baker
Signed-off-by: Dylan Baker 
---
 tests/all.py   |  2 --
 tests/glean/tfragprog1.cpp | 28 --
 .../built-in-functions/mul.shader_test | 19 +++
 .../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 32fad18..bdfd0a8 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 000..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 000..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
-- 
2.8.0

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 10/25] glean/tfragprog1: port RCP tests to shader_runner

2016-04-29 Thread Dylan Baker
Signed-off-by: Dylan Baker 
---
 tests/all.py   |  2 --
 tests/glean/tfragprog1.cpp | 23 --
 .../built-in-functions/rcp-replicated.shader_test  | 19 ++
 .../built-in-functions/rcp.shader_test | 22 +
 4 files changed, 41 insertions(+), 25 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/rcp-replicated.shader_test
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/rcp.shader_test

diff --git a/tests/all.py b/tests/all.py
index 675d45c..ad74590 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 = [
-  'RCP test (reciprocal)',
-  'RCP test 2 (reciprocal)',
   'RSQ test 1 (reciprocal square root)',
   'RSQ test 2 (reciprocal square root of negative value)',
   'SCS test',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index 37c70c1..827a818 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -82,29 +82,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and 
FogEnd */
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
{
-   "RCP test (reciprocal)",
-   "!!ARBfp1.0\n"
-   "PARAM values = {8, -10, 1, 12 }; \n"
-   "RCP result.color.x, values.x; \n"
-   "RCP result.color.y, values.y; \n"
-   "RCP result.color.z, values.z; \n"
-   "RCP result.color.w, values.w; \n"
-   "END \n",
-   { 1.0 / 8.0, CLAMP01(1.0 / -10.0), 1, 1.0 / 12.0 },
-   DONT_CARE_Z
-   },
-   {
-   /* check that RCP result is replicated across XYZW */
-   "RCP test 2 (reciprocal)",
-   "!!ARBfp1.0\n"
-   "PARAM values = {8, -10, 1, 12 }; \n"
-   "MOV result.color, values; \n"
-   "RCP result.color, values.x; \n"
-   "END \n",
-   { 1.0 / 8.0, 1.0 / 8.0, 1.0 / 8.0, 1.0 / 8.0 },
-   DONT_CARE_Z
-   },
-   {
"RSQ test 1 (reciprocal square root)",
"!!ARBfp1.0\n"
"PARAM values = {1, 4, 9, 100 }; \n"
diff --git 
a/tests/spec/arb_fragment_program/built-in-functions/rcp-replicated.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/rcp-replicated.shader_test
new file mode 100644
index 000..382a556
--- /dev/null
+++ 
b/tests/spec/arb_fragment_program/built-in-functions/rcp-replicated.shader_test
@@ -0,0 +1,19 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+PARAM q = {1.0, 1.0, 1.0, 1.0};
+MOV result.color, q;
+RCP result.color, p.x;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (8.0, -10.0, 1.0, 12.0)
+draw rect -1 -1 2 2
+# The y value will be clamped from -0.1
+probe all rgba 0.125 0.125 0.125 0.125
diff --git a/tests/spec/arb_fragment_program/built-in-functions/rcp.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/rcp.shader_test
new file mode 100644
index 000..80f155e
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/rcp.shader_test
@@ -0,0 +1,22 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+PARAM q = {1.0, 1.0, 1.0, 1.0};
+MOV result.color, q;
+RCP result.color.x, p.x;
+RCP result.color.y, p.y;
+RCP result.color.z, p.z;
+RCP result.color.w, p.w;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (8.0, -10.0, 1.0, 12.0)
+draw rect -1 -1 2 2
+# The y value will be clamped from -0.1
+probe all rgba 0.125 0.0 1.0 0.0833
-- 
2.8.0

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 05/25] glean/tfragprog1: port MAX test to shader_runner

2016-04-29 Thread Dylan Baker
Signed-off-by: Dylan Baker 
---
 tests/all.py   |  1 -
 tests/glean/tfragprog1.cpp | 14 --
 .../built-in-functions/max.shader_test | 18 ++
 3 files changed, 18 insertions(+), 15 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/max.shader_test

diff --git a/tests/all.py b/tests/all.py
index ca3eab5..42b4d7b 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -376,7 +376,6 @@ glean_glsl_tests = ['Primary plus secondary color',
 'texcoord varying']
 
 glean_fp_tests = [
-  'MAX test',
   'MIN test',
   'MOV test',
   'MUL test',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index 9254e11..2a77702 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -82,20 +82,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and 
FogEnd */
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
{
-   "MAX test",
-   "!!ARBfp1.0\n"
-   "PARAM p1 = program.local[1]; \n"
-   "PARAM p2 = program.local[2]; \n"
-   "MAX result.color, p1, p2; \n"
-   "END \n",
-   { MAX(Param1[0], Param2[0]),
- MAX(Param1[1], Param2[1]),
- MAX(Param1[2], Param2[2]),
- MAX(Param1[3], Param2[3]),
-   },
-   DONT_CARE_Z
-   },
-   {
"MIN test",
"!!ARBfp1.0\n"
"PARAM p1 = program.local[1]; \n"
diff --git a/tests/spec/arb_fragment_program/built-in-functions/max.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/max.shader_test
new file mode 100644
index 000..c9a175a
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/max.shader_test
@@ -0,0 +1,18 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+PARAM q = program.local[1];
+MAX 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, 1.0, 1.0,  1.0)
+draw rect -1 -1 2 2
+probe all rgba 1.0 1.0 1.0 1.0
-- 
2.8.0

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 11/25] glean/tfragprog1: port RSQ tests to shader_runner

2016-04-29 Thread Dylan Baker
This single test combines the two tests in glean into one, adding a
negative number.

Signed-off-by: Dylan Baker 
---
 tests/all.py   |  2 --
 tests/glean/tfragprog1.cpp | 28 --
 .../built-in-functions/rsq.shader_test | 21 
 3 files changed, 21 insertions(+), 30 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/rsq.shader_test

diff --git a/tests/all.py b/tests/all.py
index ad74590..4382a39 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 = [
-  'RSQ test 1 (reciprocal square root)',
-  'RSQ test 2 (reciprocal square root of negative value)',
   'SCS test',
   'SGE test',
   'SIN test',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index 827a818..ab1a8ea 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[] = {
{
-   "RSQ test 1 (reciprocal square root)",
-   "!!ARBfp1.0\n"
-   "PARAM values = {1, 4, 9, 100 }; \n"
-   "RSQ result.color.x, values.x; \n"
-   "RSQ result.color.y, values.y; \n"
-   "RSQ result.color.z, values.z; \n"
-   "RSQ result.color.w, values.w; \n"
-   "END \n",
-   { 1.0, 0.5, 0., 0.1 },
-   DONT_CARE_Z
-   },
-   {
-   "RSQ test 2 (reciprocal square root of negative value)",
-   "!!ARBfp1.0\n"
-   "PARAM values = {0, -100, -5, -1}; \n"
-   "RSQ result.color.x, values.x; \n"
-   "RSQ result.color.y, values.y; \n"
-   "RSQ result.color.z, values.z; \n"
-   "RSQ result.color.w, values.w; \n"
-   "END \n",
-   { DONT_CARE_COLOR,
- 0.1,
- 0.447,
- 1.0,
-   },
-   DONT_CARE_Z
-   },
-   {
"SCS test",
"!!ARBfp1.0\n"
"PARAM values = { 0.5, 0.5, 0.0, 0.0 }; \n"
diff --git a/tests/spec/arb_fragment_program/built-in-functions/rsq.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/rsq.shader_test
new file mode 100644
index 000..2f61261
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/rsq.shader_test
@@ -0,0 +1,21 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+PARAM q = {1.0, 1.0, 1.0, 1.0};
+MOV result.color, q;
+RSQ result.color.x, p.x;
+RSQ result.color.y, p.y;
+RSQ result.color.z, p.z;
+RSQ result.color.w, p.w;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (0.0, 4.0, 9.0, -100.0)
+draw rect -1 -1 2 2
+probe all rgba 1.0 0.5 0. 0.1
-- 
2.8.0

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 09/25] glean/tfragprog1: port POW test to shader_runner

2016-04-29 Thread Dylan Baker
Signed-off-by: Dylan Baker 
---
 tests/all.py  |  1 -
 tests/glean/tfragprog1.cpp| 15 ---
 .../built-in-functions/pow.shader_test| 19 +++
 3 files changed, 19 insertions(+), 16 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/pow.shader_test

diff --git a/tests/all.py b/tests/all.py
index bdfd0a8..675d45c 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -376,7 +376,6 @@ glean_glsl_tests = ['Primary plus secondary color',
 'texcoord varying']
 
 glean_fp_tests = [
-  'POW test (exponentiation)',
   'RCP test (reciprocal)',
   'RCP test 2 (reciprocal)',
   'RSQ test 1 (reciprocal square root)',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index 32b8313..37c70c1 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -82,21 +82,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and 
FogEnd */
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
{
-   "POW test (exponentiation)",
-   "!!ARBfp1.0\n"
-   "PARAM values = {0.5, 2, 3, 4}; \n"
-   "POW result.color.x, values.x, values.y; \n"
-   "POW result.color.y, values.x, values.z; \n"
-   "POW result.color.z, values.x, values.w; \n"
-   "POW result.color.w, values.w, values.x; \n"
-   "END \n",
-   { 0.5 * 0.5,
- 0.5 * 0.5 * 0.5,
- 0.5 * 0.5 * 0.5 * 0.5,
- CLAMP01(2.0) },
-   DONT_CARE_Z
-   },
-   {
"RCP test (reciprocal)",
"!!ARBfp1.0\n"
"PARAM values = {8, -10, 1, 12 }; \n"
diff --git a/tests/spec/arb_fragment_program/built-in-functions/pow.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/pow.shader_test
new file mode 100644
index 000..eb6f890
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/pow.shader_test
@@ -0,0 +1,19 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+POW result.color.x, p.x, p.y;
+POW result.color.y, p.x, p.z;
+POW result.color.z, p.x, p.w;
+POW result.color.w, p.w, p.x;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (0.5, 2.0, 3.0, 4.0)
+draw rect -1 -1 2 2
+probe all rgba 0.25 0.125 0.0625 1.0
-- 
2.8.0

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 07/25] glean/tfragprog1: port MOV tests to shader_runner

2016-04-29 Thread Dylan Baker
Signed-off-by: Dylan Baker 
---
 tests/all.py |  1 -
 tests/glean/tfragprog1.cpp   |  8 
 .../built-in-functions/mov.shader_test   | 16 
 3 files changed, 16 insertions(+), 9 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/mov.shader_test

diff --git a/tests/all.py b/tests/all.py
index 166216d..32fad18 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -376,7 +376,6 @@ glean_glsl_tests = ['Primary plus secondary color',
 'texcoord varying']
 
 glean_fp_tests = [
-  'MOV test',
   'MUL test',
   'masked MUL test',
   'POW test (exponentiation)',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index d8ba52c..b13e6cb 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -82,14 +82,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and 
FogEnd */
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
{
-   "MOV test",
-   "!!ARBfp1.0\n"
-   "MOV result.color, fragment.color; \n"
-   "END \n",
-   FRAGCOLOR,
-   DONT_CARE_Z,
-   },
-   {
"MUL test",
"!!ARBfp1.0\n"
"PARAM p = program.local[1]; \n"
diff --git a/tests/spec/arb_fragment_program/built-in-functions/mov.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/mov.shader_test
new file mode 100644
index 000..1995692
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/mov.shader_test
@@ -0,0 +1,16 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+MOV 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.0, 0.0)
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 0.0
-- 
2.8.0

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] shader_runner: allow GL_MAX_VERTEX_ATTRIBS in requirements (v2)

2016-04-29 Thread Marek Olšák
Reviewed-by: Marek Olšák 

Marek

On Fri, Apr 29, 2016 at 2:20 PM, Andres Gomez  wrote:
> v2: Just use the same query for GL or GLS 2.0 and 3.0 as noted by
> Marek Olšák.
>
> Signed-off-by: Andres Gomez 
> ---
>  tests/shaders/shader_runner.c | 13 +
>  1 file changed, 13 insertions(+)
>
> diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
> index f0b2ed3..233c600 100644
> --- a/tests/shaders/shader_runner.c
> +++ b/tests/shaders/shader_runner.c
> @@ -90,6 +90,7 @@ static struct component_version glsl_req_version;
>  static int gl_max_vertex_output_components;
>  static int gl_max_fragment_uniform_components;
>  static int gl_max_vertex_uniform_components;
> +static int gl_max_vertex_attribs;
>  static int gl_max_varying_components;
>  static int gl_max_clip_planes;
>
> @@ -725,6 +726,11 @@ process_requirement(const char *line)
> "vertex uniform components",
> },
> {
> +   "GL_MAX_VERTEX_ATTRIBS",
> +   _max_vertex_attribs,
> +   "vertex attribs",
> +   },
> +   {
> "GL_MAX_VARYING_COMPONENTS",
> _max_varying_components,
> "varying components",
> @@ -3322,6 +3328,13 @@ piglit_init(int argc, char **argv)
> gl_max_varying_components *= 4;
> gl_max_clip_planes = 0;
>  #endif
> +   if (gl_version.num >= 20 ||
> +   piglit_is_extension_supported("GL_ARB_vertex_shader"))
> +   glGetIntegerv(GL_MAX_VERTEX_ATTRIBS,
> + _max_vertex_attribs);
> +   else
> +   gl_max_vertex_attribs = 16;
> +
> if (argc < 2) {
> printf("usage: shader_runner \n");
> exit(1);
> --
> 2.8.0.rc3
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] Additional conversion tests for the ARB_gpu_shader_fp64 extension

2016-04-29 Thread Andres Gomez
Hi,

this patch is still unreviewed for the generated tests part.

We'd welcome some help to get this into piglit with guarantees that the
tests added are OK :)

Dave, what do you think about the failing tests in the softpipe?

If we don't manage to get explicit reviews by the end of next week we
will assume that all is OK and will proceed to land them.


On Thu, 2016-04-14 at 12:48 +0300, Andres Gomez wrote:
> Dave, continuing with your request at:
> https://lists.freedesktop.org/archives/piglit/2016-April/019350.html
> 
> Tested with llvmpipe
> 
> 
> FAIL:
>  * All the tests for conversions from a double derived type to a
> float
>    derived type. In addition conversions from dvec3 and dvec4 to
> bvec3
>    and bvec4, respectively.
> 
> SKIP:
>  * All the GLSL 4.xx tests. They PASS if we override the version with
>    an env variable (but the ones failing, already specified above).
> 
> PASS:
>  * The rest of the tests
> 
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
-- 
Br,

Andres


___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] cl: Initialize result variable.

2016-04-29 Thread Serge Martin
On Thursday 28 April 2016 22:02:20 Jan Vesely wrote:
> Fixes Unknown status "Unknown result" python exception.
> 
> Signed-off-by: Jan Vesely 

Reviewed-by Serge Martin 

> ---
>  tests/cl/api/set-kernel-arg.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/cl/api/set-kernel-arg.c b/tests/cl/api/set-kernel-arg.c
> index fb77059..0d476e3 100644
> --- a/tests/cl/api/set-kernel-arg.c
> +++ b/tests/cl/api/set-kernel-arg.c
> @@ -200,7 +200,7 @@ piglit_cl_test(const int argc,
>"Set kernel argument for buffer which is NULL");
> 
>   /*** Errors ***/
> - enum piglit_result input_check_result;
> + enum piglit_result input_check_result = PIGLIT_PASS;
>   /*
>* CL_INVALID_KERNEL if kernel is not a valid kernel object.
>*/

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] shader_runner: allow GL_MAX_VERTEX_ATTRIBS in requirements (v2)

2016-04-29 Thread Andres Gomez
v2: Just use the same query for GL or GLS 2.0 and 3.0 as noted by
Marek Olšák.

Signed-off-by: Andres Gomez 
---
 tests/shaders/shader_runner.c | 13 +
 1 file changed, 13 insertions(+)

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index f0b2ed3..233c600 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -90,6 +90,7 @@ static struct component_version glsl_req_version;
 static int gl_max_vertex_output_components;
 static int gl_max_fragment_uniform_components;
 static int gl_max_vertex_uniform_components;
+static int gl_max_vertex_attribs;
 static int gl_max_varying_components;
 static int gl_max_clip_planes;
 
@@ -725,6 +726,11 @@ process_requirement(const char *line)
"vertex uniform components",
},
{
+   "GL_MAX_VERTEX_ATTRIBS",
+   _max_vertex_attribs,
+   "vertex attribs",
+   },
+   {
"GL_MAX_VARYING_COMPONENTS",
_max_varying_components,
"varying components",
@@ -3322,6 +3328,13 @@ piglit_init(int argc, char **argv)
gl_max_varying_components *= 4;
gl_max_clip_planes = 0;
 #endif
+   if (gl_version.num >= 20 ||
+   piglit_is_extension_supported("GL_ARB_vertex_shader"))
+   glGetIntegerv(GL_MAX_VERTEX_ATTRIBS,
+ _max_vertex_attribs);
+   else
+   gl_max_vertex_attribs = 16;
+
if (argc < 2) {
printf("usage: shader_runner \n");
exit(1);
-- 
2.8.0.rc3

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] shader_runner: allow GL_MAX_VERTEX_ATTRIBS in requirements

2016-04-29 Thread Andres Gomez
On Tue, 2016-04-26 at 11:00 +0200, Marek Olšák wrote:
> On Mon, Apr 25, 2016 at 4:03 PM, Andres Gomez 
> wrote:
> > 
> > Signed-off-by: Andres Gomez 
> > ---
> >  tests/shaders/shader_runner.c | 17 -
> >  1 file changed, 16 insertions(+), 1 deletion(-)
> > 
> > diff --git a/tests/shaders/shader_runner.c
> > b/tests/shaders/shader_runner.c
> > index 239735c..2f6bec8 100644
> > --- a/tests/shaders/shader_runner.c
> > +++ b/tests/shaders/shader_runner.c
> > @@ -89,6 +89,7 @@ static struct component_version glsl_req_version;
> >  static int gl_max_vertex_output_components;
> >  static int gl_max_fragment_uniform_components;
> >  static int gl_max_vertex_uniform_components;
> > +static int gl_max_vertex_attribs;
> >  static int gl_max_varying_components;
> >  static int gl_max_clip_planes;
> > 
> > @@ -724,6 +725,11 @@ process_requirement(const char *line)
> > "vertex uniform components",
> > },
> > {
> > +   "GL_MAX_VERTEX_ATTRIBS",
> > +   _max_vertex_attribs,
> > +   "vertex attribs",
> > +   },
> > +   {
> > "GL_MAX_VARYING_COMPONENTS",
> > _max_varying_components,
> > "varying components",
> > @@ -3323,9 +3329,12 @@ piglit_init(int argc, char **argv)
> > glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS,
> >   _max_fragment_uniform_components);
> > if (piglit_get_gl_version() >= 20 ||
> > -   piglit_is_extension_supported("GL_ARB_vertex_shader"))
> > +   piglit_is_extension_supported("GL_ARB_vertex_shader"))
> > {
> > glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS,
> >   _max_vertex_uniform_components);
> > +   glGetIntegerv(GL_MAX_VERTEX_ATTRIBS,
> > + _max_vertex_attribs);
> > +   }
> > if (piglit_get_gl_version() >= 30 ||
> > piglit_is_extension_supported("GL_ARB_geometry_shader4"
> > ) ||
> > piglit_is_extension_supported("GL_EXT_geometry_shader4"
> > ))
> > @@ -3346,6 +3355,12 @@ piglit_init(int argc, char **argv)
> > gl_max_vertex_uniform_components *= 4;
> > gl_max_varying_components *= 4;
> > gl_max_clip_planes = 0;
> > +#if defined(PIGLIT_USE_OPENGL_ES3) ||
> > defined(PIGLIT_USE_OPENGL_ES2)
> > +   glGetIntegerv(GL_MAX_VERTEX_ATTRIBS,
> > + _max_vertex_attribs);
> > +#else
> > +   gl_max_vertex_attribs = 16;
> This seems to override the first query above. Is that intentional?
> 
> Marek

Argh, you are right. I've done something more complicated and error
prone than needed.

Let's just use the query if GL >= 20 or the extension supported and be
done with that.

I'll send a v2 version.

Thanks!

> 
> > 
> > +#endif
> >  #endif
> > if (argc < 2) {
> > printf("usage: shader_runner
> > \n");
> > --
> > 2.8.0.rc3
> > 
> > ___
> > Piglit mailing list
> > Piglit@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/piglit
-- 
Andres Gomez
Computer Science Engineer
mailto:ago...@igalia.com
http://blogs.igalia.com/agomez/category/igaliacom/
IGALIA, S.L. http://www.igalia.com



signature.asc
Description: This is a digitally signed message part
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] Add a test that reproduces a problem in GLideN64.

2016-04-29 Thread Eduardo Lima Mitev
Confirmed it crashes without your 2-patch series in Mesa, and passes
with it. Test looks good.

Reviewed-by: Eduardo Lima Mitev 

On 04/29/2016 09:23 AM, Kenneth Graunke wrote:
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95164
> ---
>  .../compiler/vector-dereference-in-dereference.frag  | 12 
> 
>  1 file changed, 12 insertions(+)
>  create mode 100644 
> tests/spec/glsl-1.10/compiler/vector-dereference-in-dereference.frag
> 
> diff --git 
> a/tests/spec/glsl-1.10/compiler/vector-dereference-in-dereference.frag 
> b/tests/spec/glsl-1.10/compiler/vector-dereference-in-dereference.frag
> new file mode 100644
> index 000..6c03136
> --- /dev/null
> +++ b/tests/spec/glsl-1.10/compiler/vector-dereference-in-dereference.frag
> @@ -0,0 +1,12 @@
> +/* [config]
> + * expect_result: pass
> + * glsl_version: 1.10
> + * [end config]
> + */
> +uniform ivec4 v;
> +uniform mat4 m;
> +
> +void main()
> +{
> +gl_FragColor = m[v[0]];
> +}
> 

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] Add a test that reproduces a problem in GLideN64.

2016-04-29 Thread Kenneth Graunke
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95164
---
 .../compiler/vector-dereference-in-dereference.frag  | 12 
 1 file changed, 12 insertions(+)
 create mode 100644 
tests/spec/glsl-1.10/compiler/vector-dereference-in-dereference.frag

diff --git 
a/tests/spec/glsl-1.10/compiler/vector-dereference-in-dereference.frag 
b/tests/spec/glsl-1.10/compiler/vector-dereference-in-dereference.frag
new file mode 100644
index 000..6c03136
--- /dev/null
+++ b/tests/spec/glsl-1.10/compiler/vector-dereference-in-dereference.frag
@@ -0,0 +1,12 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.10
+ * [end config]
+ */
+uniform ivec4 v;
+uniform mat4 m;
+
+void main()
+{
+gl_FragColor = m[v[0]];
+}
-- 
2.8.0

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit