Re: [Piglit] Piglit Plans

2014-11-13 Thread Tom Gall
Within Linaro we've recently picked up piglit and added into our
buckets of automated tests, running on Android.

We'd sure like to see piglit advance for GLES testing so there seems
like a lot of room for collaboration. More than willing to give it a
go.

On Thu, Nov 13, 2014 at 11:49 AM, Daniel Kurtz  wrote:
> +piglit@
>
> Hi Chad,
>
> I do not have much time to work on piglit these days, and when I do, I
> usually just focus on trying to get piglit to work with the Chrome OS
> ARM (EGL/GLES) platforms.
> The last time I looked at it was about a month ago.
>
> (1) To get stuff working, originally I planned to use libepoxy.
> However, it has been 10 months since Eric Anholt first sent up
> libepoxy conversion patches to piglit, and upstream piglit still
> hasn't been converted yet.  So, I decided to just hack up piglit
> dispatch to work with Mali's eglGetProcAddress() not accepting core
> functions (glGetString) instead.
> That patch also contains a fixes eglQueryString(EGL_NO_DISPLAY,
> EGL_EXTENSIONS) when an EGL does not support
> EGL_EXT_client_extensions.
> * https://chromium-review.googlesource.com/#/c/223644/1
>
> (2) I also have a set of piglit patches that fix some EGL tests, I've
> been meaning to upstream them when I get a chance:
> * https://chromium-review.googlesource.com/#/c/223645/
>
> I have rebased these patches onto current upstream piglit commit [0]
> and uploaded them to my newly created github repo [1].
> [0] 88fcc67ab168ede4299effd2b0bac9ab7591c552
>registry: Update gl.xml
> [1] https://github.com/djkurtz/piglit/tree/egl_work
>
> With this patch set I get the following results on a "peach_pit"
> Chromebook (Samsung ARM Chromebook 2:
> http://www.samsung.com/us/computer/chrome-os-devices/XE503C12-K01US):
>   # DISPLAY=:0 ./bin/piglit run lib/piglit/tests/quick.py results/q1
>   [25492/25492] fail: 28, pass: 86, skip: 25378 Running Test(s): 25492
>   Thank you for running Piglit!
>
> 112 tests total actually run.
>
> (3) I also have a branch on github [2] that currently runs about 800
> piglit tests for EGL/GLES.
>
> [2] https://github.com/djkurtz/piglit/tree/egl_work_tom_dan
>
>  # DISPLAY=:0 ./bin/piglit run lib/piglit/tests/quick.py results/q2
>  [26446/26446] fail: 485, pass: 330, skip: 25631 Running Test(s):
> 26446
>  Thank you for running Piglit!
>
> The glsles shader/glslparser work is based heavily off of work
> originally done by Tom Gall.  This work was also never upstreamed to
> piglit, so, again, it gets stale quickly.
> Also it takes a long time to go through all of shader test failures
> and skips to see if they are real driver issues, bad tests, or due to
> issues with the egl/gles2 piglit integration.   This is often a slow
> manual process which involves lots of double checking against GLSL and
> OpenGL ES specs.  This patch set is still very much WIP, and needs a
> lot of work to clean it up and make it more upstream friendly.
>
> Hope that helps.
>
> Thanks,
> -Dan
>
> On Thu, Nov 13, 2014 at 5:59 AM, Chad Versace  wrote:
>> Daniel, what are your current plans for Piglit? And what are the big issues
>> you are facing? I'm particularly interested in learning what you're doing
>> with libepoxy.
>>
>> (If you're open to discussing this publicly, feel free to move this
>> conversation to the Piglit list).
>>
>> ~Chad



-- 
Regards,
Tom

"Where's the kaboom!? There was supposed to be an earth-shattering
kaboom!" Marvin Martian
iDirector, Linaro Mobile Group
Tech Lead, Chromium, ChromeOS, Graphics, GPGPU
Linaro.org │ Open source software for ARM SoCs
irc: tgall_foo | skype : tom_gall
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] XML schema & database for GL, GLES, WGL, GLX and EGL

2013-09-23 Thread Tom Gall
Hi All,

I'd like to draw your attention the existence of an "new" (1) XML
scheme & database for GL, GLES, WGL, GLX and EGL.

There are a number tools (like the dispatch table in piglit for
instance, header file generation etc) which would quite likely benefit
from this new source of data from Khronos,

It is worth mentioning that Jesse Barker and I worked with Khronos to
have this made available. They are open to bug fixes as well as other
enhancements that would make the schema more useful.

Thanks!


1 - New since July
-- 
Regards,
Tom

"Where's the kaboom!? There was supposed to be an earth-shattering
kaboom!" Marvin Martian
Tech Lead, Graphics Working Group | Linaro.org │ Open source software
for ARM SoCs
w) tom.gall att linaro.org
h) tom_gall att mac.com
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] RFC: rename test/all.tests to tests/all_tests.py

2013-05-02 Thread Tom Gall
+1

I've had a all_gles2.tests I've been maintaining in my own git repo
which could easily evolve to use this. I'm sure I'm not the only
person that would like to make use of this.

On Thu, May 2, 2013 at 4:03 PM, Brian Paul  wrote:
>
> I'd like to rename tests/all.tests (and the others) to something like
> tests/all_tests.py.
>
> The contents of all.tests is Python code so putting the .py suffix on it
> makes sense.  Then, I'd like to be able to import that code into another
> test spec file where I do blacklisting.
>
> For example, I want to create a test spec file "vmware_tests.py" that
> executes everything in all.tests except for stuff we don't want to test.  An
> example "vmware_tests.py" file might be something like:
>
> import sys
> sys.path.append("tests")
> from all_tests import *
>
> black_list= [
>"spec/!OpenGL 3.1/*",
>"*glean*"
> ]
>
> # Remove the blacklisted tests from the test profile
> for t in black_list:
>profile.remove_test(t)
>
>
>
> As it is now we can't do "import all.tests" in Python.  Renaming to
> all_tests.py fixes that problem.
>
> -Brian
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit



-- 
Regards,
Tom

"Where's the kaboom!? There was supposed to be an earth-shattering
kaboom!" Marvin Martian
Tech Lead, Graphics Working Group | Linaro.org │ Open source software
for ARM SoCs
w) tom.gall att linaro.org
h) tom_gall att mac.com
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 10/10] glsl-es-1.00: array length, preinc, predec, var index, attribute, ctor and assign tests

2013-04-26 Thread Tom Gall
Add to tests/spec/glsl-es-1.00/compiler/structure-and-array-operations
glslparser tests for array assignment using implicit size, attributes,
array constructor tests, array length() fn, array preincrement, array
predecrement, and array variable index tests using implicit array
sizes.

Signed-off-by: Tom Gall 
---
 .../array-assign-implicit-size.vert|   28 
 .../array-attribute.vert   |   18 +++
 .../array-ctor-mismatched-size.vert|   15 +
 .../structure-and-array-operations/array-ctor.vert |   29 +
 .../array-length-implicit-size.vert|   21 
 .../array-length-with-argument.vert|   13 
 .../array-length.vert  |   15 +
 .../array-predecrement.vert|   19 +++
 .../array-preincrement.vert|   19 +++
 .../array-variable-index-implicit-size-global.vert |   29 +
 .../array-variable-index-implicit-size-local.vert  |   34 
 11 files changed, 240 insertions(+)
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-size.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-attribute.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-mismatched-size.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-length-implicit-size.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-length-with-argument.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-length.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-predecrement.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-preincrement.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-variable-index-implicit-size-global.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-variable-index-implicit-size-local.vert

diff --git 
a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-size.vert
 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-size.vert
new file mode 100644
index 000..49ae6be
--- /dev/null
+++ 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-size.vert
@@ -0,0 +1,28 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * Page 24, GLSL ES 1.00.17 spec:
+ *
+ * " The array size must be an integral constant expression (see Section 4.3.3
+ *   "Integral Constant Expressions") greater than zero."
+ *
+ * Further Section 10.17 Unsized Array Declarations on page 93 states:
+ *
+ * "gl_TexCoord is part of fixed functionality so unsigned arrays should be
+ *  removed for GLSL ES
+ *
+ *  RESOLUTION: Remove unsized array declarations"
+ */
+
+
+uniform float a[5];
+
+void main()
+{
+   float b[];
+   b = a;
+
+   gl_Position = vec4(0);
+}
diff --git 
a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-attribute.vert
 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-attribute.vert
new file mode 100644
index 000..aef953c
--- /dev/null
+++ 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-attribute.vert
@@ -0,0 +1,18 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * From page 30 of the GLSL ES 1.00.17 spec:
+ *
+ * "Attribute variables cannot be declared as arrays or structures."
+ */
+
+
+attribute vec4 a[2]
+uniform int i;
+
+void main()
+{
+  gl_Position = a[i];
+}
diff --git 
a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-mismatched-size.vert
 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-mismatched-size.vert
new file mode 100644
index 000..42dc232
--- /dev/null
+++ 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-mismatched-size.vert
@@ -0,0 +1,15 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * Page 41, GLSL ES 1.00.17 spec:
+ *
+ * "Semantically, the number of parameters much be of sufficient size
+ * and correct type to perform the initialization."
+ */
+
+
+vec4 a[] = vec4[2](vec4(0.0), vec4(1.0), vec4(2.0));
+
+void main() { gl_Position = a[0]; }
diff --git 
a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor.vert
 
b/tests/spec/glsl-es-1.00/compiler/structure-and-arr

[Piglit] [PATCH 09/10] glsl-es-1.00: array fn, array structure and redeclaration tests

2013-04-26 Thread Tom Gall
Add to tests/spec/glsl-es-1.00/compiler/structure-and-array-operations
glslparser tests for array declarations, array of structures and
redeclarations.

Signed-off-by: Tom Gall 
---
 .../array-of-any-type.vert |   43 
 ...ay-of-array-function-parameter-declaration.frag |   19 +
 ...ay-of-array-function-parameter-declaration.vert |   19 +
 ...ray-of-array-function-parameter-definition.frag |   22 ++
 ...ray-of-array-function-parameter-definition.vert |   22 ++
 .../array-of-array-structure-field.frag|   21 ++
 .../array-of-array-structure-field.vert|   21 ++
 .../array-of-struct-of-array.vert  |   21 ++
 .../array-of-struct.vert   |   21 ++
 .../array-redeclaration-01.vert|   36 
 .../array-redeclaration-initializer.vert   |   33 +++
 .../array-redeclaration-too-small.vert |   33 +++
 .../array-redeclaration-wrong-base-type.vert   |   34 
 .../array-shadow-redeclaration.vert|   29 +
 14 files changed, 374 insertions(+)
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-any-type.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-array-function-parameter-declaration.frag
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-array-function-parameter-declaration.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-array-function-parameter-definition.frag
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-array-function-parameter-definition.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-array-structure-field.frag
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-array-structure-field.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-struct-of-array.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-struct.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-redeclaration-01.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-redeclaration-initializer.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-redeclaration-too-small.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-redeclaration-wrong-base-type.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-shadow-redeclaration.vert

diff --git 
a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-any-type.vert
 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-any-type.vert
new file mode 100644
index 000..35b8a0a
--- /dev/null
+++ 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-any-type.vert
@@ -0,0 +1,43 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * From page 24 of the GLSL ES 1.00.17 spec:
+ *
+ * "All basic types and structures can be formed into arrays."
+ */
+
+
+uniform float array01[1];
+uniform int array02[1];
+uniform bool array03[1];
+uniform vec2 array04[1];
+uniform vec3 array05[1];
+uniform vec4 array06[1];
+uniform ivec2 array07[1];
+uniform ivec3 array08[1];
+uniform ivec4 array09[1];
+uniform bvec2 array10[1];
+uniform bvec3 array11[1];
+uniform bvec4 array12[1];
+uniform mat2 array13[1];
+uniform mat2x2 array14[1];
+uniform mat2x3 array15[1];
+uniform mat2x4 array16[1];
+uniform mat3 array17[1];
+uniform mat3x2 array18[1];
+uniform mat3x3 array19[1];
+uniform mat3x4 array20[1];
+uniform mat4 array21[1];
+uniform mat4x2 array22[1];
+uniform mat4x3 array23[1];
+uniform mat4x4 array24[1];
+uniform sampler1D array25[1];
+uniform sampler2D array26[1];
+uniform sampler3D array27[1];
+uniform samplerCube array28[1];
+uniform sampler1DShadow array29[1];
+uniform sampler2DShadow array30[1];
+
+void main() { gl_Position = vec4(0.0); }
diff --git 
a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-array-function-parameter-declaration.frag
 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-array-function-parameter-declaration.frag
new file mode 100644
index 000..5a8c086
--- /dev/null
+++ 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-array-function-parameter-declaration.frag
@@ -0,0 +1,19 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * From page 24 of the GLSL ES 1.00.17 spec:
+ *
+ *

[Piglit] [PATCH 08/10] glsl-es-1.00:=, !=, * and multidim structure and array operations

2013-04-26 Thread Tom Gall
Add to tests/spec/glsl-es-1.00/compiler/structure-and-array-operations
glslparser tests for arrays and assignment, multidimensional,
multiply, and not equal.

Signed-off-by: Tom Gall 
---
 .../array-assign.vert  |   27 +++
 .../array-multidimensional-new-syntax.vert |   17 
 .../array-multidimensional.vert|   17 
 .../array-multiply.vert|   23 
 .../array-not-equal-implicit-size.vert |   28 
 .../array-not-equal-matrix.vert|   22 +++
 .../array-not-equal-mismatched-base-type.vert  |   22 +++
 .../array-not-equal-mismatched-size.vert   |   22 +++
 .../array-not-equal-vertor.vert|   22 +++
 .../array-not-equal.vert   |   22 +++
 10 files changed, 222 insertions(+)
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-multidimensional-new-syntax.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-multidimensional.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-multiply.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-implicit-size.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-matrix.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-mismatched-base-type.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-mismatched-size.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-vertor.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal.vert

diff --git 
a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign.vert
 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign.vert
new file mode 100644
index 000..56c480d
--- /dev/null
+++ 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign.vert
@@ -0,0 +1,27 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * From page 46 of the GLSL ES 1.00.17 spec:
+ *
+ * "Assignments of values to variables are performed using the assignment
+ * operator (=).
+ * ...
+ * and l-values dereferenced with the array subsript operator ([]) are
+ * all l-values."
+ */
+
+
+void main()
+{
+  vec4 a[2];
+  vec4 b[2];
+  vec4 c[2];
+
+  a = vec4[2](vec4(0.0), vec4(2.0));
+  b = vec4[ ](vec4(0.5), vec4(2.0));
+  c = a;
+
+  gl_Position = a[0] + b[0] + c[1];
+}
diff --git 
a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-multidimensional-new-syntax.vert
 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-multidimensional-new-syntax.vert
new file mode 100644
index 000..05db993
--- /dev/null
+++ 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-multidimensional-new-syntax.vert
@@ -0,0 +1,17 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * From page 24 of the GLSL ES 1.00.17 spec:
+ *
+ * "Only one-dimensional arrays may be declared."
+ */
+
+
+uniform vec4 [1] an_array[1];
+
+void main()
+{
+  gl_Position = an_array[0][0];
+}
diff --git 
a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-multidimensional.vert
 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-multidimensional.vert
new file mode 100644
index 000..0c046f4
--- /dev/null
+++ 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-multidimensional.vert
@@ -0,0 +1,17 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * From page 24 of the GLSL ES 1.00.17 spec:
+ *
+ * "Only one-dimensional arrays may be declared."
+ */
+
+
+uniform vec4 an_array[1][1];
+
+void main()
+{
+  gl_Position = an_array[0][0];
+}
diff --git 
a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-multiply.vert
 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-multiply.vert
new file mode 100644
index 000..092150b
--- /dev/null
+++ 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-multiply.vert
@@ -0,0 +1,23 @@
+/* [config]
+ * expect_result: fail
+ * glsles_version: 1.00
+ * [end config]
+ *
+ * From page 48 of the GLSL ES 1.00.17 spec:
+ *
+ * "The arithmetic binary operators add (+), subtract (-), multiply (*),
+ * and divide (/) operate on integer and floating-point typed exp

[Piglit] [PATCH 07/10] glsl-es-1.00: new array tests for +, /, >, <, >=, <=, &&, !, ||, ^^, ++, --, -

2013-04-26 Thread Tom Gall
Add to
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations
a series of array operator tests including logical and
mathimatical tests. These are operators including
+,/,>,<,>=,<=,&&,!,||,^^,+,-,++,--, , ,-

Signed-off-by: Tom Gall 
---
 .../structure-and-array-operations/array-add.vert  |   23 +
 .../array-divide.vert  |   23 +
 .../array-greater-equal.vert   |   20 +++
 .../array-greater.vert |   20 +++
 .../array-less-equal.vert  |   20 +++
 .../structure-and-array-operations/array-less.vert |   20 +++
 .../array-logical-and.vert |   20 +++
 .../array-logical-not.vert |   19 ++
 .../array-logical-or.vert  |   20 +++
 .../array-logical-xor.vert |   20 +++
 .../array-negate.vert  |   22 +
 .../array-positive.vert|   22 +
 .../array-postdecrement.vert   |   21 
 .../array-postincrement.vert   |   21 
 .../array-selection.vert   |   26 
 .../array-sequence.vert|   20 +++
 .../array-subtract.vert|   23 +
 17 files changed, 360 insertions(+)
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-add.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-divide.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-greater-equal.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-greater.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-less-equal.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-less.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-logical-and.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-logical-not.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-logical-or.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-logical-xor.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-negate.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-positive.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-postdecrement.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-postincrement.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-selection.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-sequence.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-subtract.vert

diff --git 
a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-add.vert
 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-add.vert
new file mode 100644
index 000..e824260
--- /dev/null
+++ 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-add.vert
@@ -0,0 +1,23 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * From page 48 of the GLSL ES 1.00.17 spec:
+ *
+ * "The arithmetic binary operators add (+), subtract (-), multiply (*),
+ * and divide (/) operate on integer and floating-point typed expressions
+ * (including vectors and matrices). The two operands must be of the same
+ * type or one can be a scalar float and the other a float vector or matrix
+ * or one can be a scalar integer and the other an integer vector."
+ */
+
+
+uniform vec4 a[2];
+uniform vec4 b[2];
+
+void main()
+{
+  vec4 c[2] = a + b;
+  gl_Position = c[0];
+}
diff --git 
a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-divide.vert
 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-divide.vert
new file mode 100644
index 000..d1c9111
--- /dev/null
+++ 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-divide.vert
@@ -0,0 +1,23 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * From page 48 of the GLSL ES 1.00.17 spec:
+ *
+ * "The arithmetic binary operators add (+), subtract (-), multiply (*),
+ * and divide (/) operate on integer and floating-point typed expressions
+ * (i

[Piglit] [PATCH 06/10] glsl-es-1.00: new array size tests using a variety of types

2013-04-26 Thread Tom Gall
Add to
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations
a series of array declaration size tests.

Signed-off-by: Tom Gall 
---
 .../array-size-bool.vert   |   16 ++
 .../array-size-bvec2.vert  |   16 ++
 .../array-size-bvec3.vert  |   16 ++
 .../array-size-bvec4.vert  |   16 ++
 .../array-size-constant-cast.vert  |   17 +++
 .../array-size-constant-relational.vert|  161 
 .../array-size-float.vert  |   16 ++
 .../array-size-int.vert|   16 ++
 .../array-size-ivec2.vert  |   16 ++
 .../array-size-ivec3.vert  |   16 ++
 .../array-size-ivec4.vert  |   16 ++
 .../array-size-length.vert |   17 +++
 .../array-size-negative.vert   |   16 ++
 .../array-size-non-builtin-function.vert   |   18 +++
 .../array-size-not-constant.vert   |   17 +++
 .../array-size-selection.vert  |   21 +++
 .../array-size-sequence-in-parenthesis.vert|   29 
 .../array-size-sequence.vert   |   29 
 .../array-size-vec2.vert   |   16 ++
 .../array-size-vec3.vert   |   16 ++
 .../array-size-vec4.vert   |   16 ++
 .../array-size-with-side-effect.vert   |   19 +++
 .../array-size-zero.vert   |   16 ++
 23 files changed, 552 insertions(+)
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bool.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bvec2.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bvec3.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bvec4.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-constant-cast.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-constant-relational.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-float.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-int.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-ivec2.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-ivec3.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-ivec4.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-length.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-negative.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-non-builtin-function.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-not-constant.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-selection.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-sequence-in-parenthesis.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-sequence.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-vec2.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-vec3.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-vec4.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-with-side-effect.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-zero.vert

diff --git 
a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bool.vert
 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bool.vert
new file mode 100644
index 000..06d451b
--- /dev/null
+++ 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bool.vert
@@ -0,0 +1,16 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * Page 24, GLSL ES 1.00 spec:
+ *
+ * "The array size must be an integral constant expression (see
+ * Section 4.3.3 "Integral Constant Expressions") greater than
+ * zero."
+ */
+
+
+uniform float [true] a;
+
+void main() { gl_Position = vec4(a[0]); }
diff --git 
a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bvec2.vert
 
b/tes

[Piglit] [PATCH 05/10] glsl-es-1.00: new tests for array function params and return types

2013-04-26 Thread Tom Gall
Add to
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations
a series of array tests used as function params and return types.

Signed-off-by: Tom Gall 
---
 .../array-function-parameter-implicit-size.vert|   36 
 .../array-function-parameter-unsized.vert  |   29 
 .../array-function-return-unsized.vert |   31 +
 .../array-function-return.vert |   30 
 4 files changed, 126 insertions(+)
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-parameter-implicit-size.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-parameter-unsized.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-return-unsized.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-return.vert

diff --git 
a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-parameter-implicit-size.vert
 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-parameter-implicit-size.vert
new file mode 100644
index 000..f050c87
--- /dev/null
+++ 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-parameter-implicit-size.vert
@@ -0,0 +1,36 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * The GLSL ES 1.00 spec takes no position on what should
+ * happen with a undeclared array size.
+ *
+ * The GLSL ES 3.00 spec on page 136 in section 12.22 within
+ * the issues chapter says :
+ *
+ *  "float a[5];
+ * ...
+ * float b[] = a; // bi is explicity size 5 "
+ *
+ * Further, "However, any declaration that leaves the size
+ * undefined is disallowed as this would add complexity and there are
+ * no use-cases.
+ */
+
+
+float a_function(vec4[6]);
+
+void main()
+{
+  vec4 [] an_array;
+
+  an_array[0] = vec4(0);
+  an_array[1] = vec4(1);
+  an_array[2] = vec4(2);
+  an_array[3] = vec4(3);
+  an_array[4] = vec4(4);
+  an_array[5] = vec4(5);
+
+  gl_Position = vec4(a_function(an_array));
+}
diff --git 
a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-parameter-unsized.vert
 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-parameter-unsized.vert
new file mode 100644
index 000..4a536a9
--- /dev/null
+++ 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-parameter-unsized.vert
@@ -0,0 +1,29 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * The GLSL ES 1.00 spec takes no position on what should
+ * happen with a undeclared array size.
+ *
+ * The GLSL ES 3.00 spec on page 136 in section 12.22 within
+ * the issues chapter says :
+ *
+ *  "float a[5];
+ * ...
+ * float b[] = a; // bi is explicity size 5 "
+ *
+ * Further, "However, any declaration that leaves the size
+ * undefined is disallowed as this would add complexity and there are
+ * no use-cases.
+ */
+
+
+vec4 a_function(vec4 [] p);
+
+uniform vec4 [6] an_array;
+
+void main()
+{
+  gl_Position = a_function(an_array);
+}
diff --git 
a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-return-unsized.vert
 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-return-unsized.vert
new file mode 100644
index 000..49a80e5
--- /dev/null
+++ 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-return-unsized.vert
@@ -0,0 +1,31 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * Page 24, GLSL ES 1.00.17 spec:
+ *
+ * "Arrays declared as formal parameters in a function
+ * declaration must specify a size."
+ *
+ * The GLSL ES 3.00 spec on page 136 in section 12.22 within
+ * the issues chapter says :
+ *
+ *  "float a[5];
+ * ...
+ * float b[] = a; // bi is explicity size 5 "
+ *
+ * Further, "However, any declaration that leaves the size
+ * undefined is disallowed as this would add complexity and there are
+ * no use-cases.
+ */
+
+
+vec4[] a_function(vec4 [6] p);
+
+uniform vec4 [6] an_array;
+
+void main()
+{
+  gl_Position = a_function(an_array)[0];
+}
diff --git 
a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-return.vert
 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-return.vert
new file mode 100644
index 000..a560685
--- /dev/null
+++ 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-return.vert
@@ -0,0 +1,30 @@
+/* [config]
+ * expect_result: pass
+ * glsles_version: 1.00
+ * [end config]
+ *
+ * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec:
+ *
+ * "This type can be used anywhere any other type can be used, including
+ * as t

[Piglit] [PATCH 04/10] glsl-es-1.00: New array construction tests with implicit conversion

2013-04-26 Thread Tom Gall
Add to
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations
a series of array constructor tests with implicit conversions
over a variety of types.

Signed-off-by: Tom Gall 
---
 .../array-ctor-implicit-conversion-bool-float.vert  |   19 +++
 .../array-ctor-implicit-conversion-bool-int.vert|   19 +++
 .../array-ctor-implicit-conversion-bvec2-ivec2.vert |   19 +++
 .../array-ctor-implicit-conversion-bvec2-vec2.vert  |   19 +++
 .../array-ctor-implicit-conversion-bvec3-ivec3.vert |   19 +++
 .../array-ctor-implicit-conversion-bvec3-vec3.vert  |   19 +++
 .../array-ctor-implicit-conversion-bvec4-ivec4.vert |   19 +++
 .../array-ctor-implicit-conversion-bvec4-vec4.vert  |   19 +++
 .../array-ctor-implicit-conversion-float-bool.vert  |   19 +++
 .../array-ctor-implicit-conversion-float-int.vert   |   19 +++
 .../array-ctor-implicit-conversion-int-bool.vert|   19 +++
 .../array-ctor-implicit-conversion-int-float.vert   |   19 +++
 .../array-ctor-implicit-conversion-ivec2-bvec2.vert |   19 +++
 .../array-ctor-implicit-conversion-ivec2-vec2.vert  |   19 +++
 .../array-ctor-implicit-conversion-ivec3-bvec3.vert |   19 +++
 .../array-ctor-implicit-conversion-ivec3-vec3.vert  |   19 +++
 .../array-ctor-implicit-conversion-ivec4-bvec4.vert |   19 +++
 .../array-ctor-implicit-conversion-ivec4-vec4.vert  |   19 +++
 .../array-ctor-implicit-conversion-vec2-bvec2.vert  |   19 +++
 .../array-ctor-implicit-conversion-vec2-ivec2.vert  |   19 +++
 .../array-ctor-implicit-conversion-vec3-bvec3.vert  |   19 +++
 .../array-ctor-implicit-conversion-vec3-ivec3.vert  |   19 +++
 .../array-ctor-implicit-conversion-vec4-bvec4.vert  |   19 +++
 .../array-ctor-implicit-conversion-vec4-ivec4.vert  |   19 +++
 24 files changed, 456 insertions(+)
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bool-float.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bool-int.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bvec2-ivec2.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bvec2-vec2.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bvec3-ivec3.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bvec3-vec3.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bvec4-ivec4.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bvec4-vec4.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-float-bool.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-float-int.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-int-bool.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-int-float.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-ivec2-bvec2.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-ivec2-vec2.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-ivec3-bvec3.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-ivec3-vec3.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-ivec4-bvec4.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-ivec4-vec4.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-vec2-bvec2.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-vec2-ivec2.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-vec3-bvec3.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array

[Piglit] [PATCH 03/10] glsl-es-1.00: array equality tests

2013-04-26 Thread Tom Gall
Add to
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations
a series of array equality tests, with mismatching types,
sizes, implicit sizes etc.

Signed-off-by: Tom Gall 
---
 .../array-equal-implicit-size.vert |   32 
 .../array-equal-matrix.vert|   22 ++
 .../array-equal-mismatched-base-type.vert  |   22 ++
 .../array-equal-mismatched-size.vert   |   19 
 .../array-equal-vector.vert|   22 ++
 .../array-equal.vert   |   22 ++
 6 files changed, 139 insertions(+)
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal-implicit-size.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal-matrix.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal-mismatched-base-type.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal-mismatched-size.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal-vector.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal.vert

diff --git 
a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal-implicit-size.vert
 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal-implicit-size.vert
new file mode 100644
index 000..9a8abc8
--- /dev/null
+++ 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal-implicit-size.vert
@@ -0,0 +1,32 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * Page 24, GLSL ES 1.00.17 spec:
+ *
+ * " The array size must be an integral constant expression (see Section 4.3.3
+ *   "Integral Constant Expressions") greater than zero."
+ *
+ * Further Section 10.17 Unsized Array Declarations on page 93 states:
+ *
+ * "gl_TexCoord is part of fixed functionality so unsigned arrays should be
+ *  removed for GLSL ES
+ *
+ *  RESOLUTION: Remove unsized array declarations"
+ */
+
+
+uniform vec4 a[2];
+uniform vec4 b[2];
+
+void main()
+{
+  vec4 c[];
+
+  // Implicitly size c to match a and b.
+  c[0] = b[0];
+  c[1] = b[1];
+
+  gl_Position = vec4(a == c);
+}
diff --git 
a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal-matrix.vert
 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal-matrix.vert
new file mode 100644
index 000..e234c58
--- /dev/null
+++ 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal-matrix.vert
@@ -0,0 +1,22 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * Page 48 GLSL ES 1.00.17 spec:
+ *
+ * "The equality operations equal (==) and not equal (!=) operate on all
+ * types execpt arrays, structures containing arrays"
+ *
+ * Further "For vectors, matricies, and structures, all components of
+ * the operands must be equal for the operands to be considered equal."
+ */
+
+
+uniform vec4 a[4];
+uniform mat4 b;
+
+void main()
+{
+  gl_Position = vec4(a == b);
+}
diff --git 
a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal-mismatched-base-type.vert
 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal-mismatched-base-type.vert
new file mode 100644
index 000..67bf83d
--- /dev/null
+++ 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal-mismatched-base-type.vert
@@ -0,0 +1,22 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * Page 48 GLSL ES 1.00.17 spec:
+ *
+ * "The equality operations equal (==) and not equal (!=) operate on all
+ * types execpt arrays, structures containing arrays"
+ *
+ * Further "For vectors, matricies, and structures, all components of
+ * the operands must be equal for the operands to be considered equal."
+ */
+
+
+uniform vec4 a[2];
+uniform vec3 b[2]; // Note the differing base type
+
+void main()
+{
+  gl_Position = vec4(a == b);
+}
diff --git 
a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal-mismatched-size.vert
 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal-mismatched-size.vert
new file mode 100644
index 000..7843eff
--- /dev/null
+++ 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal-mismatched-size.vert
@@ -0,0 +1,19 @@
+/* [config]
+ * expect_result: fail
+ * glsles_version: 1.00
+ * [end config]
+ *
+ * Page 48 GLSL ES 1.00.17 spec:
+ *
+ * "The equality operations equal (==) and not equal (!=) operate on all
+ * types execpt arrays, structures containing arrays"
+ */
+
+
+uniform vec4 a[2];
+uniform vec4

[Piglit] [PATCH 02/10] glsl-es-1.00: array tests using a variety of indexes

2013-04-26 Thread Tom Gall
Add to
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations
a series of constant index array tests including valid, negative
and outside of the range.

Signed-off-by: Tom Gall 
---
 .../array-constant-index-implicit-size.vert|   29 
 .../array-constant-index-negative.vert |   18 
 .../array-constant-index-too-large.vert|   18 
 3 files changed, 65 insertions(+)
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-constant-index-implicit-size.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-constant-index-negative.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-constant-index-too-large.vert

diff --git 
a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-constant-index-implicit-size.vert
 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-constant-index-implicit-size.vert
new file mode 100644
index 000..d46fdc7
--- /dev/null
+++ 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-constant-index-implicit-size.vert
@@ -0,0 +1,29 @@
+/* [config]
+ * expect_result: pass
+ * glsles_version: 1.00
+ * [end config]
+ *
+ * The GLSL ES 1.00 spec takes no position on what should
+ * happen with a undeclared array size.
+ *
+ * The GLSL ES 3.00 spec on page 136 in section 12.22 within
+ * the issues chapter says :
+ *
+ *  "float a[5];
+ * ...
+ * float b[] = a; // bi is explicity size 5 "
+ *
+ * Further, "However, any declaration that leaves the size
+ * undefined is disallowed as this would add complexity and there are
+ * no use-cases."
+ */
+
+
+/* Assume the array is sized in a different compilation unit.
+ */
+vec4 [] an_array;
+
+void main()
+{
+  gl_Position = an_array[2];
+}
diff --git 
a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-constant-index-negative.vert
 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-constant-index-negative.vert
new file mode 100644
index 000..2384705
--- /dev/null
+++ 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-constant-index-negative.vert
@@ -0,0 +1,18 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * From page 24 of the GLSL ES 1.00.17 spec:
+ *
+ * "It is also illegal to index an array with a negative constant
+ * expression."
+ */
+
+
+uniform vec4 [6] an_array;
+
+void main()
+{
+  gl_Position = an_array[-1];
+}
diff --git 
a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-constant-index-too-large.vert
 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-constant-index-too-large.vert
new file mode 100644
index 000..f3838ea
--- /dev/null
+++ 
b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-constant-index-too-large.vert
@@ -0,0 +1,18 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * From Page 24 of the GLSL ES 1.00.17 spec:
+ *
+ * "It is illegal to index an array with an integral constant expression
+ *  greater than or equal to it's declared size."
+ */
+
+
+uniform vec4 [6] an_array;
+
+void main()
+{
+  gl_Position = an_array[6];
+}
-- 
1.7.10.4

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


[Piglit] [PATCH 01/10] glsl-es-1.00: array assignment tests with implicit conversions

2013-04-26 Thread Tom Gall
Add to
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations
a series of tests that validates for arrays:

Page 18 of the GLSL ES 1.00.17 spec:

"There are no implicit conversions between types."

Signed-off-by: Tom Gall 
---
 ...rray-assign-implicit-conversion-bool-float.vert |   19 ++
 .../array-assign-implicit-conversion-bool-int.vert |   19 ++
 ...ray-assign-implicit-conversion-bvec2-ivec2.vert |   19 ++
 ...rray-assign-implicit-conversion-bvec2-vec2.vert |   19 ++
 ...ray-assign-implicit-conversion-bvec3-ivec3.vert |   19 ++
 ...rray-assign-implicit-conversion-bvec3-vec3.vert |   19 ++
 ...ray-assign-implicit-conversion-bvec4-ivec4.vert |   19 ++
 ...rray-assign-implicit-conversion-bvec4-vec4.vert |   19 ++
 ...rray-assign-implicit-conversion-float-bool.vert |   19 ++
 ...array-assign-implicit-conversion-float-int.vert |   19 ++
 .../array-assign-implicit-conversion-int-bool.vert |   19 ++
 ...array-assign-implicit-conversion-int-float.vert |   19 ++
 ...ray-assign-implicit-conversion-ivec2-bvec2.vert |   19 ++
 ...rray-assign-implicit-conversion-ivec2-vec2.vert |   19 ++
 ...ray-assign-implicit-conversion-ivec3-bvec3.vert |   19 ++
 ...rray-assign-implicit-conversion-ivec3-vec3.vert |   19 ++
 ...ray-assign-implicit-conversion-ivec4-bvec4.vert |   19 ++
 ...rray-assign-implicit-conversion-ivec4-vec4.vert |   19 ++
 ...rray-assign-implicit-conversion-vec2-bvec2.vert |   19 ++
 ...rray-assign-implicit-conversion-vec2-ivec2.vert |   19 ++
 ...rray-assign-implicit-conversion-vec3-bvec3.vert |   21 
 ...rray-assign-implicit-conversion-vec3-ivec3.vert |   19 ++
 ...rray-assign-implicit-conversion-vec4-bvec4.vert |   19 ++
 ...rray-assign-implicit-conversion-vec4-ivec4.vert |   19 ++
 24 files changed, 458 insertions(+)
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bool-float.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bool-int.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bvec2-ivec2.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bvec2-vec2.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bvec3-ivec3.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bvec3-vec3.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bvec4-ivec4.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bvec4-vec4.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-float-bool.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-float-int.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-int-bool.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-int-float.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-ivec2-bvec2.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-ivec2-vec2.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-ivec3-bvec3.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-ivec3-vec3.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-ivec4-bvec4.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-ivec4-vec4.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-vec2-bvec2.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-vec2-ivec2.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-vec3-bvec3.vert
 create mode 100644 
tests

[Piglit] [PATCH 2/2] gles3: Add outerProduct tests to generated_tests

2013-04-25 Thread Tom Gall
GL SL ES 3.00 added outerProduct as a built in fuction.

http://www.khronos.org/opengles/sdk/docs/manglsl/xhtml/outerProduct.xml

Add a script which generates testcases which validate the variety
of valid and invalid parameters that may be passed. The script
is called as part of the generated_tests.

Signed-off-by: Tom Gall 
---
 generated_tests/CMakeLists.txt |   14 +++
 generated_tests/outerProduct-invalid-parameters.sh |   91 
 2 files changed, 105 insertions(+)
 create mode 100755 generated_tests/outerProduct-invalid-parameters.sh

diff --git a/generated_tests/CMakeLists.txt b/generated_tests/CMakeLists.txt
index db3734f..58ff0af 100644
--- a/generated_tests/CMakeLists.txt
+++ b/generated_tests/CMakeLists.txt
@@ -18,6 +18,16 @@ function(piglit_make_generated_tests file_list 
generator_script)
VERBATIM)
 endfunction(piglit_make_generated_tests custom_target generator_script)
 
+function(piglit_make_sh_generated_tests file_list generator_sh_script version)
+   # Add a custom command which executes ${generator_script}
+   # during the build.
+   add_custom_command(
+   OUTPUT ${file_list}
+   COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${generator_sh_script} 
${version} > ${file_list}
+   DEPENDS ${generator_sh_script} ${ARGN}
+   VERBATIM)
+endfunction(piglit_make_sh_generated_tests custom_target generator_sh_script)
+
 # Create custom commands and targets to build generated tests.
 piglit_make_generated_tests(
builtin_packing_tests.list
@@ -54,6 +64,9 @@ piglit_make_generated_tests(
 piglit_make_generated_tests(
builtin_cl_int_tests.list
generate-cl-int-builtins.py)
+piglit_make_sh_generated_tests(
+   outerProduct-invalid-parameters_tests.list
+   outerProduct-invalid-parameters.sh 3.00)
 
 # Add a "gen-tests" target that can be used to generate all the
 # tests without doing any other compilation.
@@ -64,5 +77,6 @@ add_custom_target(gen-tests ALL
builtin_cl_int_tests.list
interpolation_tests.list
non-lvalue_tests.list
+   outerProduct-invalid-parameters_tests.list
texture_query_lod_tests.list
uniform-initializer_tests.list)
diff --git a/generated_tests/outerProduct-invalid-parameters.sh 
b/generated_tests/outerProduct-invalid-parameters.sh
new file mode 100755
index 000..7def598
--- /dev/null
+++ b/generated_tests/outerProduct-invalid-parameters.sh
@@ -0,0 +1,91 @@
+#!/bin/bash
+
+function emit_vs
+{
+targetdir=$1
+t=$2
+
+echo "$targetdir/outerProduct-$t.vert"
+cat > $targetdir/outerProduct-$t.vert <http://www.khronos.org/opengles/sdk/docs/manglsl/xhtml/outerProduct.xml
+ */
+void main () {
+  gl_Position = vec4(0);
+  outerProduct(${t}(0), ${t}(0));
+}
+EOF
+}
+
+function emit_valid_vs
+{
+targetdir=$1
+t=$2
+
+echo "$targetdir/outerProduct-$t.vert"
+cat > $targetdir/outerProduct-$t.vert <http://www.khronos.org/opengles/sdk/docs/manglsl/xhtml/outerProduct.xml
+ */
+void main () {
+  gl_Position = vec4(0);
+  outerProduct(${t}(0), ${t}(0));
+}
+EOF
+}
+
+function emit_valid_mixed_vs
+{
+targetdir=$1
+t=$2
+u=$3
+
+echo "$targetdir/outerProduct-$t.vert"
+cat > $targetdir/outerProduct-$t.vert <http://www.khronos.org/opengles/sdk/docs/manglsl/xhtml/outerProduct.xml
+ */
+void main () {
+  gl_Position = vec4(0);
+  outerProduct(${t}(0), ${u}(0));
+}
+EOF
+}
+
+set +x
+
+targetdir="spec/glsl-es-3.00/compiler/built-in-functions"
+mkdir -p $targetdir
+
+for i in int float bool bvec2 bvec3 bvec4 mat2 mat2x2 mat2x3 mat2x4 mat3 
mat3x2 mat3x3 mat3x4 mat4 mat4x2 mat4x3 mat4x4
+do
+emit_vs $targetdir $i
+done
+for i in vec2 vec3 vec4
+do
+emit_valid_vs $targetdir $i
+done
+emit_valid_mixed_vs $targetdir vec3 vec2
+emit_valid_mixed_vs $targetdir vec2 vec3
+emit_valid_mixed_vs $targetdir vec4 vec2
+emit_valid_mixed_vs $targetdir vec4 vec3
+emit_valid_mixed_vs $targetdir vec2 vec4
+emit_valid_mixed_vs $targetdir vec3 vec4
-- 
1.7.10.4

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


[Piglit] [PATCH 1/2] Add outerProduct existance test for glsl es 1.00

2013-04-25 Thread Tom Gall
outerProduct is available with glsl es 3.00 but not
with glsl es 1.00.

http://www.khronos.org/opengles/sdk/docs/manglsl/xhtml/outerProduct.xml

Signed-off-by: Tom Gall 
---
 .../compiler/built-in-functions/outerProduct-vec2.vert |   12 
 1 file changed, 12 insertions(+)
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/built-in-functions/outerProduct-vec2.vert

diff --git 
a/tests/spec/glsl-es-1.00/compiler/built-in-functions/outerProduct-vec2.vert 
b/tests/spec/glsl-es-1.00/compiler/built-in-functions/outerProduct-vec2.vert
new file mode 100644
index 000..bcdac9e
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/compiler/built-in-functions/outerProduct-vec2.vert
@@ -0,0 +1,12 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ * outerProduct is not available in OpenGL SL 1.00. It is
+ *   available in OpenGL SL 3.00.
+ * http://www.khronos.org/opengles/sdk/docs/manglsl/xhtml/outerProduct.xml
+ */
+void main () {
+  gl_Position = vec4(0);
+  outerProduct(vec2(0), vec2(0));
+}
-- 
1.7.10.4

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


[Piglit] [PATCH 1/1] piglit-framework-cl.c: When extensions is NULL, don't segv

2013-04-21 Thread Tom Gall
In check_platform_extensions, fix a bug where if extentions
was NULL, it'll segv.

Signed-off-by: Tom Gall 
---
 tests/util/piglit-framework-cl.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/util/piglit-framework-cl.c b/tests/util/piglit-framework-cl.c
index deddc8d..4435bf7 100644
--- a/tests/util/piglit-framework-cl.c
+++ b/tests/util/piglit-framework-cl.c
@@ -84,9 +84,10 @@ print_test_info(const struct piglit_cl_test_config_header* 
config,
 
 bool check_platform_extensions(cl_platform_id platform_id, char* extensions)
 {
-   char* pch;
+   char* pch=NULL;
 
-   pch = strtok(extensions, " ");
+   if (extensions)
+   pch = strtok(extensions, " ");
while(pch != NULL) {
if(   strlen(pch) > 0
   && !piglit_cl_is_platform_extension_supported(platform_id, 
pch)) {
-- 
1.8.1.2

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


[Piglit] [PATCH 7/8] variable-index-write.sh: echo generated testcase name and formalize output directory target

2013-04-20 Thread Tom Gall
Adjust shell script so it echos the name of the generated testcase and output 
the
generated testcases using the following pattern:

"spec/glsl"${es}-${version}"/execution/varible-index-write"

This uses the convention followed by the other scripts that generate testcases.

Signed-off-by: Tom Gall 
---
 generated_tests/variable-index-write.sh |   98 +++
 1 file changed, 61 insertions(+), 37 deletions(-)

diff --git a/generated_tests/variable-index-write.sh 
b/generated_tests/variable-index-write.sh
index 06802c4..52cd24e 100755
--- a/generated_tests/variable-index-write.sh
+++ b/generated_tests/variable-index-write.sh
@@ -450,6 +450,14 @@ else
 esac
 fi
 
+v=${version/./}
+if [ $v -eq 100 ]; then
+   es="-es"
+fi
+
+filepath="spec/glsl"${es}-${version}"/execution/varible-index-write"
+mkdir -p ${filepath}
+
 for mode in temp varying; do
 # More than 3 is unlikely to work for the varying tests due to using too
 # many varying vectors.  mat4[3] uses 12 varying vectors by itself.
@@ -465,57 +473,73 @@ for mode in temp varying; do
for matrix_dim in 2 3 4; do
# Fragment shaders cannot write varyings
if [ "x$mode" != "xvarying" ]; then
-   emit_fs_wr_test $matrix_dim $array_dim $mode index col float \
-   > 
fs-${mode}-${arr}mat${matrix_dim}-${idx_txt}col-row-wr.shader_test
-
-   emit_fs_wr_test $matrix_dim $array_dim $mode index 1   float \
-   > 
fs-${mode}-${arr}mat${matrix_dim}-${idx_txt}row-wr.shader_test
-
-   emit_fs_wr_test $matrix_dim $array_dim $mode index col 
vec${matrix_dim} \
-   > 
fs-${mode}-${arr}mat${matrix_dim}-${idx_txt}col-wr.shader_test
-
-   emit_fs_wr_test $matrix_dim $array_dim $mode index 1   
vec${matrix_dim} \
-   > fs-${mode}-${arr}mat${matrix_dim}-${idx_txt}wr.shader_test
-
-   if [ $array_dim -ne 0 ]; then
-   emit_fs_wr_test $matrix_dim $array_dim $mode 1 col float \
-   > 
fs-${mode}-${arr}mat${matrix_dim}-col-row-wr.shader_test
-
-   emit_fs_wr_test $matrix_dim $array_dim $mode 1 1   float \
-   > fs-${mode}-${arr}mat${matrix_dim}-row-wr.shader_test
-
-   emit_fs_wr_test $matrix_dim $array_dim $mode 1 col 
vec${matrix_dim} \
-   > fs-${mode}-${arr}mat${matrix_dim}-col-wr.shader_test
-
-   emit_fs_wr_test $matrix_dim $array_dim $mode 1 1   
vec${matrix_dim} \
-   > fs-${mode}-${arr}mat${matrix_dim}-wr.shader_test
-   fi
+   emit_fs_wr_test $matrix_dim $array_dim $mode index col 
float \
+   > 
${filepath}/fs-${mode}-${arr}mat${matrix_dim}-${idx_txt}col-row-wr.shader_test
+   echo 
"${filepath}/fs-${mode}-${arr}mat${matrix_dim}-${idx_txt}col-row-wr.shader_test"
+
+   emit_fs_wr_test $matrix_dim $array_dim $mode index 1   
float \
+   > 
${filepath}/fs-${mode}-${arr}mat${matrix_dim}-${idx_txt}row-wr.shader_test
+   echo 
"${filepath}/fs-${mode}-${arr}mat${matrix_dim}-${idx_txt}row-wr.shader_test"
+
+   emit_fs_wr_test $matrix_dim $array_dim $mode index col 
vec${matrix_dim} \
+   > 
${filepath}/fs-${mode}-${arr}mat${matrix_dim}-${idx_txt}col-wr.shader_test
+   echo 
"${filepath}/fs-${mode}-${arr}mat${matrix_dim}-${idx_txt}col-wr.shader_test"
+
+   emit_fs_wr_test $matrix_dim $array_dim $mode index 1   
vec${matrix_dim} \
+   > 
${filepath}/fs-${mode}-${arr}mat${matrix_dim}-${idx_txt}wr.shader_test
+   echo 
"${filepath}/fs-${mode}-${arr}mat${matrix_dim}-${idx_txt}wr.shader_test"
+
+   if [ $array_dim -ne 0 ]; then
+   emit_fs_wr_test $matrix_dim $array_dim $mode 1 
col float \
+   > 
${filepath}/fs-${mode}-${arr}mat${matrix_dim}-col-row-wr.shader_test
+   echo 
"${filepath}/fs-${mode}-${arr}mat${matrix_dim}-col-row-wr.shader_test"
+
+   emit_fs_wr_test $matrix_dim $array_dim $mode 1 
1   float \
+   > 
${filepath}/fs-${mode}-${arr}mat${matrix_dim}-row-wr.shader_test
+   echo 
"${filepath}/fs-${mode}-${arr}mat${matrix_dim}-row-wr.shader_test"
+
+   emit_fs_wr_test $matrix_dim $array_dim $mode 1 
col vec${matrix_dim} \
+   > 
${filepath}/fs-${mode}-${arr}mat${matrix_dim}-col-wr.shader_test
+   echo 
"${filepath}/fs-${mode}-${arr}mat${matrix_dim}-col-wr.shader_test"

[Piglit] [PATCH 6/8] variable-index-read.sh: echo generated testcase name and formalize output directory target

2013-04-20 Thread Tom Gall
Adjust shell script so it echos the name of the generated testcase and output 
the
generated testcases using the following pattern:

"spec/glsl"${es}-${version}"/execution/varible-index-read"

This uses the convention followed by the other scripts that generate testcases.

Signed-off-by: Tom Gall 
---
 generated_tests/variable-index-read.sh |   57 +++-
 1 file changed, 41 insertions(+), 16 deletions(-)

diff --git a/generated_tests/variable-index-read.sh 
b/generated_tests/variable-index-read.sh
index 8fa2bc7..1dd821a 100755
--- a/generated_tests/variable-index-read.sh
+++ b/generated_tests/variable-index-read.sh
@@ -458,6 +458,14 @@ else
 esac
 fi
 
+v=${version/./}
+if [ $v -eq 100 ]; then
+   es="-es"
+fi
+
+filepath="spec/glsl"${es}-${version}"/execution/varible-index-read"
+mkdir -p ${filepath}
+
 for mode in temp uniform varying; do
 # More than 3 is unlikely to work for the varying tests due to using too
 # many varying vectors.  mat4[3] uses 12 varying vectors by itself.
@@ -468,56 +476,73 @@ for mode in temp uniform varying; do
idx_txt="index-"
 
emit_fs_rd_test $matrix_dim $array_dim $mode 1 col float \
-   > fs-${mode}-${arr}mat${matrix_dim}-col-row-rd.shader_test
+   > 
${filepath}/fs-${mode}-${arr}mat${matrix_dim}-col-row-rd.shader_test
+   echo 
"${filepath}/fs-${mode}-${arr}mat${matrix_dim}-col-row-rd.shader_test"
 
emit_fs_rd_test $matrix_dim $array_dim $mode 1 1   float \
-   > fs-${mode}-${arr}mat${matrix_dim}-row-rd.shader_test
+   > 
${filepath}/fs-${mode}-${arr}mat${matrix_dim}-row-rd.shader_test
+   echo 
"${filepath}/fs-${mode}-${arr}mat${matrix_dim}-row-rd.shader_test"
 
emit_fs_rd_test $matrix_dim $array_dim $mode 1 col 
vec${matrix_dim} \
-   > fs-${mode}-${arr}mat${matrix_dim}-col-rd.shader_test
+   > 
${filepath}/fs-${mode}-${arr}mat${matrix_dim}-col-rd.shader_test
+   echo 
"${filepath}/fs-${mode}-${arr}mat${matrix_dim}-col-rd.shader_test"
 
emit_fs_rd_test $matrix_dim $array_dim $mode 1 1   
vec${matrix_dim} \
-   > fs-${mode}-${arr}mat${matrix_dim}-rd.shader_test
+   > 
${filepath}/fs-${mode}-${arr}mat${matrix_dim}-rd.shader_test
+   echo 
"${filepath}/fs-${mode}-${arr}mat${matrix_dim}-rd.shader_test"
 
emit_vs_rd_test $matrix_dim $array_dim $mode 1 col float \
-   > vs-${mode}-${arr}mat${matrix_dim}-col-row-rd.shader_test
+   > 
${filepath}/vs-${mode}-${arr}mat${matrix_dim}-col-row-rd.shader_test
+   echo 
"${filepath}/vs-${mode}-${arr}mat${matrix_dim}-col-row-rd.shader_test"
 
emit_vs_rd_test $matrix_dim $array_dim $mode 1 1   float \
-   > vs-${mode}-${arr}mat${matrix_dim}-row-rd.shader_test
+   > 
${filepath}/vs-${mode}-${arr}mat${matrix_dim}-row-rd.shader_test
+   echo 
"${filepath}/vs-${mode}-${arr}mat${matrix_dim}-row-rd.shader_test"
 
emit_vs_rd_test $matrix_dim $array_dim $mode 1 col 
vec${matrix_dim} \
-   > vs-${mode}-${arr}mat${matrix_dim}-col-rd.shader_test
+   > 
${filepath}/vs-${mode}-${arr}mat${matrix_dim}-col-rd.shader_test
+   echo 
"${filepath}/vs-${mode}-${arr}mat${matrix_dim}-col-rd.shader_test"
 
emit_vs_rd_test $matrix_dim $array_dim $mode 1 1   
vec${matrix_dim} \
-   > vs-${mode}-${arr}mat${matrix_dim}-rd.shader_test
+   > 
${filepath}/vs-${mode}-${arr}mat${matrix_dim}-rd.shader_test
+   echo 
"${filepath}/vs-${mode}-${arr}mat${matrix_dim}-rd.shader_test"
+
else
arr=""
idx_txt=""
fi
 
emit_fs_rd_test $matrix_dim $array_dim $mode index col float \
-   > 
fs-${mode}-${arr}mat${matrix_dim}-${idx_txt}col-row-rd.shader_test
+   > 
${filepath}/fs-${mode}-${arr}mat${matrix_dim}-${idx_txt}col-row-rd.shader_test
+   echo 
"${filepath}/fs-${mode}-${arr}mat${matrix_dim}-${idx_txt}col-row-rd.shader_test"
 
emit_fs_rd_test $matrix_dim $array_dim $mode index 1   float \
-   > fs-${mode}-${arr}mat${matrix_dim}-${idx_txt}row-rd.shader_test
+   > 
${filepath}/fs-${mode}-${arr}mat${matrix_dim}-${idx_txt}row-rd.shader_test
+   echo 
"${filepath}/fs-${mode}-${arr}mat${matrix_dim}-${idx_txt}row-rd.shader_test"
 
emit_fs_rd_test $matrix_dim $array_dim $mode index col 
vec${matrix_dim} \
-   > fs-${mode}-

[Piglit] [PATCH 5/8] Add calls to variable-index-read.sh and variable-index-write.sh in generated_tests

2013-04-20 Thread Tom Gall
In generated_tests/CMakeLists.txt add new fn piglit_make_sh_generated_tests 
which
allows for shells scripts to be called to generate tests cases.

Call variable-index-read.sh and variable-index-write.sh to generate tests for
glsl 1.00, 1.10 and 1.20.

Signed-off-by: Tom Gall 
---
 generated_tests/CMakeLists.txt |   36 +++-
 1 file changed, 35 insertions(+), 1 deletion(-)

diff --git a/generated_tests/CMakeLists.txt b/generated_tests/CMakeLists.txt
index db3734f..c0950d1 100644
--- a/generated_tests/CMakeLists.txt
+++ b/generated_tests/CMakeLists.txt
@@ -18,6 +18,16 @@ function(piglit_make_generated_tests file_list 
generator_script)
VERBATIM)
 endfunction(piglit_make_generated_tests custom_target generator_script)
 
+function(piglit_make_sh_generated_tests file_list generator_sh_script version)
+   # Add a custom command which executes ${generator_script}
+   # during the build.
+   add_custom_command(
+   OUTPUT ${file_list}
+   COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${generator_sh_script} 
${version} > ${file_list}
+   DEPENDS ${generator_sh_script} ${ARGN}
+   VERBATIM)
+endfunction(piglit_make_sh_generated_tests custom_target generator_sh_script)
+
 # Create custom commands and targets to build generated tests.
 piglit_make_generated_tests(
builtin_packing_tests.list
@@ -54,6 +64,24 @@ piglit_make_generated_tests(
 piglit_make_generated_tests(
builtin_cl_int_tests.list
generate-cl-int-builtins.py)
+piglit_make_sh_generated_tests(
+   variable-index-read-100_tests.list
+   variable-index-read.sh 1.00)
+piglit_make_sh_generated_tests(
+   variable-index-read-110_tests.list
+   variable-index-read.sh 1.10)
+piglit_make_sh_generated_tests(
+   variable-index-read-120_tests.list
+   variable-index-read.sh 1.20)
+piglit_make_sh_generated_tests(
+   variable-index-write-100_tests.list
+   variable-index-write.sh 1.00)
+piglit_make_sh_generated_tests(
+   variable-index-write-110_tests.list
+   variable-index-write.sh 1.10)
+piglit_make_sh_generated_tests(
+   variable-index-write-120_tests.list
+   variable-index-write.sh 1.20)
 
 # Add a "gen-tests" target that can be used to generate all the
 # tests without doing any other compilation.
@@ -65,4 +93,10 @@ add_custom_target(gen-tests ALL
interpolation_tests.list
non-lvalue_tests.list
texture_query_lod_tests.list
-   uniform-initializer_tests.list)
+   uniform-initializer_tests.list
+   variable-index-read-100_tests.list
+   variable-index-read-110_tests.list
+   variable-index-read-120_tests.list
+   variable-index-write-100_tests.list
+   variable-index-write-110_tests.list
+   variable-index-write-120_tests.list)
-- 
1.7.10.4

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


[Piglit] [PATCH 4/8] move variable-index-read.sh and variable-index-write.sh to generated_tests

2013-04-20 Thread Tom Gall

Signed-off-by: Tom Gall 
---
 {tests/spec/glsl-1.10 => generated_tests}/variable-index-read.sh  |0
 {tests/spec/glsl-1.10 => generated_tests}/variable-index-write.sh |0
 2 files changed, 0 insertions(+), 0 deletions(-)
 rename {tests/spec/glsl-1.10 => generated_tests}/variable-index-read.sh (100%)
 rename {tests/spec/glsl-1.10 => generated_tests}/variable-index-write.sh (100%)

diff --git a/tests/spec/glsl-1.10/variable-index-read.sh 
b/generated_tests/variable-index-read.sh
similarity index 100%
rename from tests/spec/glsl-1.10/variable-index-read.sh
rename to generated_tests/variable-index-read.sh
diff --git a/tests/spec/glsl-1.10/variable-index-write.sh 
b/generated_tests/variable-index-write.sh
similarity index 100%
rename from tests/spec/glsl-1.10/variable-index-write.sh
rename to generated_tests/variable-index-write.sh
-- 
1.7.10.4

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


[Piglit] [PATCH 3/8] glsl_parser_test.py: For glsl 1.00 use correct glslparsertest_gles2 binary

2013-04-20 Thread Tom Gall
When the glsl_version is 1.00, use the glslparsertest_gles2 binary

Signed-off-by: Tom Gall 
---
 framework/glsl_parser_test.py |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/framework/glsl_parser_test.py b/framework/glsl_parser_test.py
index 66e6dd3..914904d 100755
--- a/framework/glsl_parser_test.py
+++ b/framework/glsl_parser_test.py
@@ -368,8 +368,14 @@ class GLSLParserTest(PlainExecTest):
return None
 
assert(self.config is not None)
+
+   if self.config.get('config', 'glsl_version') == '1.00':
+   runner = "glslparsertest_gles2"
+   else:
+   runner = "glslparsertest"
+
command = [
-   path.join(testBinDir, 'glslparsertest'),
+   path.join(testBinDir, runner),
self.__filepath,
self.config.get('config', 'expect_result'),
self.config.get('config', 'glsl_version')
-- 
1.7.10.4

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


[Piglit] [PATCH 2/8] variable-index-write.sh: extend to support glsl es 1.00

2013-04-20 Thread Tom Gall
>From tests/spec/glsl-1.10 extend variable-index-write.sh so that
it can also correctly generates variable index write tests that
support glsl-es-1.00.

1.00 added as a valid parameter to generated tests for glsl-es-1.00.

For 1.00 tests in the vertex shader an orthographic projection is
applied since ortho during the test portion isn't supported on
OpenGL ES.

For 1.00 tests the fragent shader specifies default precision.

For 1.00 tests emit in the [require] section the correct
GLSL ES and GL ES settings.

Signed-off-by: Tom Gall 
---
 tests/spec/glsl-1.10/variable-index-write.sh |   67 +++---
 1 file changed, 61 insertions(+), 6 deletions(-)

diff --git a/tests/spec/glsl-1.10/variable-index-write.sh 
b/tests/spec/glsl-1.10/variable-index-write.sh
index 96a4791..06802c4 100755
--- a/tests/spec/glsl-1.10/variable-index-write.sh
+++ b/tests/spec/glsl-1.10/variable-index-write.sh
@@ -177,6 +177,10 @@ function emit_fs
 fi
 
 echo "[fragment shader]"
+if [ $v -eq 100 ]; then
+echo "precision highp float;"
+echo "precision highp int;"
+fi
 
 emit_globals $*
 
@@ -207,14 +211,24 @@ function emit_test_vectors
 index_value=$4
 col=$5
 value_type=$6
+v=${version/./}
 
-cat <= ${version}"
+if [ "$v" -eq 100 ]; then
+echo "GLSL ES >= ${version}"
+echo "GL ES >= 2.0"
+else
+echo "GLSL >= ${version}"
+fi
 echo
 
 echo "[vertex shader]"
-echo "void main() { gl_Position = gl_ModelViewProjectionMatrix * 
gl_Vertex; }"
+if [ "$v" -eq 100 ]; then
+echo "attribute vec4 vertex;"
+echo "mat4 projection = mat4("
+echo "2.0/250.0, 0.0, 0.0, -1.0,"
+echo "0.0, 2.0/250.0, 0.0, -1.0,"
+echo "0.0, 0.0, -1.0, 0.0,"
+echo "0.0, 0.0, 0.0, 1.0);"
+echo
+echo "void main()"
+echo "{"
+echo "gl_Position = vertex;"
+echo "gl_Position *= projection;"
+echo "}"
+else
+echo "void main() { gl_Position = gl_ModelViewProjectionMatrix * 
gl_Vertex; }"
+fi
 echo
 
 emit_fs $*
@@ -342,20 +378,39 @@ function emit_vs_wr_test
 matrix_dim=$1
 array_dim=$2
 mode=$3
+v=${version/./}
 
 echo "# Test generated by:"
 echo "# ${cmd}"
 echo
 echo "[require]"
-echo "GLSL >= ${version}"
+if [ "$v" -eq 100 ]; then
+echo "GLSL ES >= ${version}"
+echo "GL ES >= 2.0"
+else
+echo "GLSL >= ${version}"
+fi
 echo
 
 echo "[vertex shader]"
+if [ "$v" -eq 100 ]; then
+echo "attribute vec4 vertex;"
+echo "mat4 projection = mat4("
+echo "2.0/250.0, 0.0, 0.0, -1.0,"
+echo "0.0, 2.0/250.0, 0.0, -1.0,"
+echo "0.0, 0.0, -1.0, 0.0,"
+echo "0.0, 0.0, 0.0, 1.0);"
+fi
 emit_globals $*
 
 echo "void main()"
 echo "{"
-echo "gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;"
+if [ "$v" -eq 100 ]; then
+echo "gl_Position = vertex;"
+echo "gl_Position *= projection;"
+else
+echo "gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;"
+fi
 echo
 
 emit_set_matrix $*
@@ -387,7 +442,7 @@ if [ "x$1" = "x" ]; then
 version="1.10"
 else
 case "$1" in
-   1.[12]0) version="$1";;
+   1.[012]0) version="$1";;
*)
echo "Bogus GLSL version \"$1\" specified."
exit 1
-- 
1.7.10.4

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


[Piglit] [PATCH 1/8] variable-index-read.sh: extend to support glsl es 1.00

2013-04-20 Thread Tom Gall
>From tests/spec/glsl-1.10 extend variable-index-read.sh so that
it can also correctly generates variable index read tests that
support glsl-es-1.00.

1.00 added as a valid parameter to generated tests for glsl-es-1.00.

For 1.00 tests the vertex shader an orthographic projection is
applied since ortho during the test portion isn't supported on
OpenGL ES.

For 1.00 tests the fragent shader specifies default precision.

For 1.00 tests emit in the [require] section the correct
GLSL ES and GL ES settings.

Signed-off-by: Tom Gall 
---
 tests/spec/glsl-1.10/variable-index-read.sh |   54 ---
 1 file changed, 48 insertions(+), 6 deletions(-)

diff --git a/tests/spec/glsl-1.10/variable-index-read.sh 
b/tests/spec/glsl-1.10/variable-index-read.sh
index 80cb078..8fa2bc7 100755
--- a/tests/spec/glsl-1.10/variable-index-read.sh
+++ b/tests/spec/glsl-1.10/variable-index-read.sh
@@ -156,6 +156,7 @@ function emit_vs
 col=$5
 expect_type=$6
 do_compare=$7
+v=${version/./}
 
 if [ $array_dim -ne 0 ]; then
idx="[${index_value}]"
@@ -164,11 +165,24 @@ function emit_vs
 fi
 
 echo "[vertex shader]"
+if [ $v -eq 100 ]; then
+echo "attribute vec4 vertex;"
+echo "mat4 projection = mat4("
+echo "2.0/250.0, 0.0, 0.0, -1.0,"
+echo "0.0, 2.0/250.0, 0.0, -1.0,"
+echo "0.0, 0.0, -1.0, 0.0,"
+echo "0.0, 0.0, 0.0, 1.0);"
+fi
 emit_globals $*
 
 echo "void main()"
 echo "{"
-echo "gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;"
+if [ $v -eq 100 ]; then
+echo "gl_Position = vertex;"
+echo "gl_Position *= projection;"
+else
+echo "gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;"
+fi
 
 # Only emit the code to set the matrix if the vertex shader is generating
 # varyings for a fragment shader or the matrix is in local storage and the
@@ -215,8 +229,13 @@ emit_fs()
 col=$5
 expect_type=$6
 do_compare=$7
+v=${version/./}
 
 echo "[fragment shader]"
+if [ $v -eq 100 ]; then
+echo "precision highp float;"
+echo "precision highp int;"
+fi
 emit_globals $*
 
 echo "void main()"
@@ -275,6 +294,7 @@ function emit_test_vectors
 index_value=$4
 col=$5
 expect_type=$6
+v=${version/./}
 
 # Optimizing GLSL linkers may reduce the size of the uniform array if tail
 # elements are not accessed.  Shader runner will fail the test if one of
@@ -283,16 +303,24 @@ function emit_test_vectors
array_dim=$((index_value+1))
 fi
 
-cat <= $version"
+if [ $v -eq 100 ]; then
+echo "GLSL ES >= $version"
+echo "GL ES >= 2.0"
+else
+echo "GLSL >= $version"
+fi
 echo
 
 emit_vs $* 0
@@ -389,11 +424,18 @@ function emit_fs_rd_test
 # index in the fragment shader.
 function emit_vs_rd_test
 {
+v=${version/./}
+
 echo "# Test generated by:"
 echo "# ${cmd}"
 echo
 echo "[require]"
-echo "GLSL >= $version"
+if [ $v -eq 100 ]; then
+echo "GLSL ES >= $version"
+echo "GL ES >= 2.0"
+else
+echo "GLSL >= $version"
+fi
 echo
 
 emit_vs $* 1
@@ -408,7 +450,7 @@ if [ "x$1" = "x" ]; then
 version="1.10"
 else
 case "$1" in
-   1.[12]0) version="$1";;
+   1.[012]0) version="$1";;
*)
echo "Bogus GLSL version \"$1\" specified."
exit 1
-- 
1.7.10.4

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


Re: [Piglit] [PATCH] add a simple glinfo "test" program

2013-04-19 Thread Tom Gall
From a GLES perspective, it's easy enough to apt-get / yum  install
mesa-utils-extra for es2_info but I definitely understand where you're
coming from and am in favor.

I'd like this built for GLES2/GLES3 as well please. Eyeballing it,
should work just fine save for the necessary adjustment to config of
course.

Reviewed-by Tom Gall 

On Thu, Apr 18, 2013 at 3:21 PM, Brian Paul  wrote:
> When doing a full piglit run it's helpful to have all the OpenGL
> driver version/vendor/extension info.  The piglit framework tries
> to run glxinfo/wglinfo and include the output in the results file,
> but sometimes those programs aren't installed.
> ---
>  tests/all.tests |1 +
>  tests/general/CMakeLists.gl.txt |1 +
>  tests/general/glinfo.c  |   92 
> +++
>  3 files changed, 94 insertions(+), 0 deletions(-)
>  create mode 100644 tests/general/glinfo.c
>
> diff --git a/tests/all.tests b/tests/all.tests
> index daebbd3..4e85a34 100644
> --- a/tests/all.tests
> +++ b/tests/all.tests
> @@ -512,6 +512,7 @@ add_plain_test(gl11, 'fragment-center')
>  add_fbo_depthstencil_tests(gl11, 'default_fb')
>  add_plain_test(gl11, 'geterror-invalid-enum')
>  add_plain_test(gl11, 'geterror-inside-begin')
> +add_concurrent_test(gl11, 'glinfo')
>  add_plain_test(gl11, 'hiz')
>  add_plain_test(gl11, 'infinite-spot-light')
>  add_plain_test(gl11, 'line-aa-width')
> diff --git a/tests/general/CMakeLists.gl.txt b/tests/general/CMakeLists.gl.txt
> index e1eb3e3..0e87baa 100644
> --- a/tests/general/CMakeLists.gl.txt
> +++ b/tests/general/CMakeLists.gl.txt
> @@ -67,6 +67,7 @@ ENDIF (UNIX)
>  piglit_add_executable (getactiveattrib getactiveattrib.c)
>  piglit_add_executable (geterror-inside-begin geterror-inside-begin.c)
>  piglit_add_executable (geterror-invalid-enum geterror-invalid-enum.c)
> +piglit_add_executable (glinfo glinfo.c)
>  piglit_add_executable (gl30basic gl30basic.c)
>  piglit_add_executable (hiz hiz.c)
>  if (UNIX)
> diff --git a/tests/general/glinfo.c b/tests/general/glinfo.c
> new file mode 100644
> index 000..b60ae6d
> --- /dev/null
> +++ b/tests/general/glinfo.c
> @@ -0,0 +1,92 @@
> +/*
> + * Copyright © 2013 VMware, Inc.
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
> + * DEALINGS IN THE SOFTWARE.
> + */
> +
> +/**
> + * Simply query and print various glGetString() values.
> + * This is helpful when running a complete piglit run since the
> + * results file will have all the pertinant info for the GL driver
> + * that was tested.
> + *
> + * Note that the piglit framework tries to run glxinfo/wglinfo and
> + * put the output in the results file, but sometimes those programs
> + * aren't installed.
> + *
> + * Brian Paul
> + * April 2013
> + */
> +
> +
> +#include "piglit-util-gl-common.h"
> +
> +
> +PIGLIT_GL_TEST_CONFIG_BEGIN
> +   config.supports_gl_compat_version = 10;
> +   config.window_visual = PIGLIT_GL_VISUAL_RGB;
> +PIGLIT_GL_TEST_CONFIG_END
> +
> +
> +enum piglit_result
> +piglit_display(void)
> +{
> +   return PIGLIT_PASS;
> +}
> +
> +
> +void
> +piglit_init(int argc, char **argv)
> +{
> +   const char *renderer = (const char *) glGetString(GL_RENDERER);
> +   const char *version = (const char *) glGetString(GL_VERSION);
> +   const char *vendor = (const char *) glGetString(GL_VENDOR);
> +
> +   printf("GL_RENDERER = %s\n", renderer);
> +   printf("GL_VERSION = %s\

Re: [Piglit] [PATCH] add new --ignoreStderr option to piglit-run.py

2013-04-19 Thread Tom Gall
On Fri, Apr 19, 2013 at 9:22 AM, Brian Paul  wrote:
> On 04/19/2013 04:33 AM, Jose Fonseca wrote:
>>
>> Yes, assuming stderr messages are driver warnings seems a bit pedantic.
>>
>> We could do the other way around -- have a whitelist of warning regular
>> expressions that we do known that are worrisome.
>
>
> Yeah, that's an idea.  But I think the only ones that comes to mind are
> "Mesa implementation error" from _mesa_problem() and "Mesa warning" from
> _mesa_warning().

FWIW, there are some binary GLES drivers which emit info/warnings
which would be nice to ignore via some kind of mechanism.

> "Mesa: User error" from _mesa_error() should be ignored since quite a few
> piglit tests probe for GL errors and the message is always printed for debug
> builds.
>
> I guess I'd like to get some more opinions on this patch vs. just removing
> the "stderr=warn" detection code entirely.

I'm not keen on removing it either, but with the idea of a list of
messages that can be ignored, I'd say that's moving in the right
direction.

> -Brian
>
>
>
>> - Original Message -
>>>
>>> Normally, if anything unexpected is printed to stderr we report 'warn'
>>> for the test result.  The list of expected/allowed stderr message is
>>> found at the end of core.py.  It's a PITA to update this list and if
>>> you've temporarily inserted extra debug code in Mesa/gallium it causes
>>> piglit to just report 'warn' instead of the more useful 'pass/fail'.
>>>
>>> I wonder if anybody depends on stderr output for generating 'warn'
>>> results.  If not, maybe we should just remove that "feature" entirely.
>>> ---
>>>   framework/core.py |5 +++--
>>>   framework/exectest.py |5 +++--
>>>   piglit-run.py |7 ++-
>>>   3 files changed, 12 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/framework/core.py b/framework/core.py
>>> index 08f442f..8d0d0a6 100644
>>> --- a/framework/core.py
>>> +++ b/framework/core.py
>>> @@ -372,13 +372,14 @@ class TestrunResult:
>>>
>>>   class Environment:
>>> def __init__(self, concurrent=True, execute=True,
>>> include_filter=[],
>>> -   exclude_filter=[], valgrind=False):
>>> +   exclude_filter=[], valgrind=False,
>>> ignoreStderr=False):
>>> self.concurrent = concurrent
>>> self.execute= execute
>>> self.filter = []
>>> self.exclude_filter = []
>>> self.exclude_tests  = set()
>>> self.valgrind   = valgrind
>>> +   self.ignoreStderr   = ignoreStderr
>>>
>>> """
>>> The filter lists that are read in should be a list of
>>> string objects,
>>> @@ -455,7 +456,7 @@ class Test:
>>> try:
>>> status("running")
>>> time_start = time.time()
>>> -   result = self.run(env.valgrind)
>>> +   result = self.run(env.valgrind,
>>> env.ignoreStderr)
>>> time_end = time.time()
>>> if 'time' not in result:
>>> result['time'] = time_end -
>>> time_start
>>> diff --git a/framework/exectest.py b/framework/exectest.py
>>> index b8d97b8..007cf49 100644
>>> --- a/framework/exectest.py
>>> +++ b/framework/exectest.py
>>> @@ -55,7 +55,7 @@ class ExecTest(Test):
>>> raise NotImplementedError
>>> return out
>>>
>>> -   def run(self, valgrind):
>>> +   def run(self, valgrind, ignoreStderr):
>>> """
>>> Run a test.  The return value will be a dictionary with
>>> keys
>>> including 'result', 'info', 'returncode' and 'command'.
>>> @@ -161,7 +161,8 @@ class ExecTest(Test):
>>> results['returncode'] = returncode
>>> results['command'] = ' '.join(self.command)
>>>
>>> -   self.handleErr(results, err)
>>> +   if not ignoreStderr:
>>> +   self.handleErr(results, err)
>>>
>>> else:
>>> results = TestResult()
>>> diff --git a/piglit-run.py b/piglit-run.py
>>> index 6d6ec77..d6aadf0 100755
>>> --- a/piglit-run.py
>>> +++ b/piglit-run.py
>>> @@ -94,6 +94,10 @@ def main():
>>> parser.add_argument("--valgrind",
>>> action  =  "store_true",
>>> help= "Run tests in valgrind's memcheck")
>>> +   parser.add_argument("--ignoreStderr",
>>> +   action  = "store_true",
>>> +   help= "Ignore messages printed to stderr
>>> (don't report 'warn'"
>>> + " for unexpected stderr
>>> messages)")
>>> parser.add_argument("testProfile",
>>> metavar = "",
>>>  

Re: [Piglit] [PATCH 1/1] generated-cl-int-builtins.py:detect and return ints and longs in getValue

2013-04-18 Thread Tom Gall
Bah! Ignore.  Didn't realize my repo was slightly out of date. Sorry about that!

On Thu, Apr 18, 2013 at 3:39 PM, Tom Gall  wrote:
> generated_tests/generate-cl-int-builtins.py in getValue, at the
> very end some logic checks for an instance of an int and returns
> it.
>
> In the case of a long, this fails and results in a TypeError
> killing the build.
>
> Add a check for an instance of a long and return the number just
> as is done for an int.
>
> Signed-off-by: Tom Gall 
> ---
>  generated_tests/generate-cl-int-builtins.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/generated_tests/generate-cl-int-builtins.py 
> b/generated_tests/generate-cl-int-builtins.py
> index 5b6eaf6..22b0726 100755
> --- a/generated_tests/generate-cl-int-builtins.py
> +++ b/generated_tests/generate-cl-int-builtins.py
> @@ -264,7 +264,7 @@ def getValue(type, val):
>  getValue(type, val[3]), getValue(type, val[4]))
>
>  #At this point, we should have been passed a number
> -if (isinstance(val, int)):
> +if ((isinstance(val, int)) or (isinstance(val, long))):
>  return val;
>
>  print('Invalid value '+val+' encountered in getValue\n')
> --
> 1.8.1.2
>



-- 
Regards,
Tom

"Where's the kaboom!? There was supposed to be an earth-shattering
kaboom!" Marvin Martian
Tech Lead, Graphics Working Group | Linaro.org │ Open source software
for ARM SoCs
w) tom.gall att linaro.org
h) tom_gall att mac.com
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 1/1] generated-cl-int-builtins.py:detect and return ints and longs in getValue

2013-04-18 Thread Tom Gall
generated_tests/generate-cl-int-builtins.py in getValue, at the
very end some logic checks for an instance of an int and returns
it.

In the case of a long, this fails and results in a TypeError
killing the build.

Add a check for an instance of a long and return the number just
as is done for an int.

Signed-off-by: Tom Gall 
---
 generated_tests/generate-cl-int-builtins.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/generated_tests/generate-cl-int-builtins.py 
b/generated_tests/generate-cl-int-builtins.py
index 5b6eaf6..22b0726 100755
--- a/generated_tests/generate-cl-int-builtins.py
+++ b/generated_tests/generate-cl-int-builtins.py
@@ -264,7 +264,7 @@ def getValue(type, val):
 getValue(type, val[3]), getValue(type, val[4]))
 
 #At this point, we should have been passed a number
-if (isinstance(val, int)):
+if ((isinstance(val, int)) or (isinstance(val, long))):
 return val;
 
 print('Invalid value '+val+' encountered in getValue\n')
-- 
1.8.1.2

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


[Piglit] [PATCH 2/2] variable-index-write.sh: extend to support glsl es 1.00

2013-04-18 Thread Tom Gall
Please apply. Initially posted ~ a month ago. No negative feedback.

>From tests/spec/glsl-1.10 extend variable-index-write.sh so that
it can also correctly generates variable index write tests that
support glsl-es-1.00.

1.00 added as a valid parameter to generated tests for glsl-es-1.00.

For 1.00 tests in the vertex shader an orthographic projection is
applied since ortho during the test portion isn't supported on
OpenGL ES.

For 1.00 tests the fragent shader specifies default precision.

For 1.00 tests emit in the [require] section the correct
GLSL ES and GL ES settings.

Signed-off-by: Tom Gall 
---
 tests/spec/glsl-1.10/variable-index-write.sh |   67 +++---
 1 file changed, 61 insertions(+), 6 deletions(-)

diff --git a/tests/spec/glsl-1.10/variable-index-write.sh 
b/tests/spec/glsl-1.10/variable-index-write.sh
index 96a4791..06802c4 100755
--- a/tests/spec/glsl-1.10/variable-index-write.sh
+++ b/tests/spec/glsl-1.10/variable-index-write.sh
@@ -177,6 +177,10 @@ function emit_fs
 fi
 
 echo "[fragment shader]"
+if [ $v -eq 100 ]; then
+echo "precision highp float;"
+echo "precision highp int;"
+fi
 
 emit_globals $*
 
@@ -207,14 +211,24 @@ function emit_test_vectors
 index_value=$4
 col=$5
 value_type=$6
+v=${version/./}
 
-cat <= ${version}"
+if [ "$v" -eq 100 ]; then
+echo "GLSL ES >= ${version}"
+echo "GL ES >= 2.0"
+else
+echo "GLSL >= ${version}"
+fi
 echo
 
 echo "[vertex shader]"
-echo "void main() { gl_Position = gl_ModelViewProjectionMatrix * 
gl_Vertex; }"
+if [ "$v" -eq 100 ]; then
+echo "attribute vec4 vertex;"
+echo "mat4 projection = mat4("
+echo "2.0/250.0, 0.0, 0.0, -1.0,"
+echo "0.0, 2.0/250.0, 0.0, -1.0,"
+echo "0.0, 0.0, -1.0, 0.0,"
+echo "0.0, 0.0, 0.0, 1.0);"
+echo
+echo "void main()"
+echo "{"
+echo "gl_Position = vertex;"
+echo "gl_Position *= projection;"
+echo "}"
+else
+echo "void main() { gl_Position = gl_ModelViewProjectionMatrix * 
gl_Vertex; }"
+fi
 echo
 
 emit_fs $*
@@ -342,20 +378,39 @@ function emit_vs_wr_test
 matrix_dim=$1
 array_dim=$2
 mode=$3
+v=${version/./}
 
 echo "# Test generated by:"
 echo "# ${cmd}"
 echo
 echo "[require]"
-echo "GLSL >= ${version}"
+if [ "$v" -eq 100 ]; then
+echo "GLSL ES >= ${version}"
+echo "GL ES >= 2.0"
+else
+echo "GLSL >= ${version}"
+fi
 echo
 
 echo "[vertex shader]"
+if [ "$v" -eq 100 ]; then
+echo "attribute vec4 vertex;"
+echo "mat4 projection = mat4("
+echo "2.0/250.0, 0.0, 0.0, -1.0,"
+echo "0.0, 2.0/250.0, 0.0, -1.0,"
+echo "0.0, 0.0, -1.0, 0.0,"
+echo "0.0, 0.0, 0.0, 1.0);"
+fi
 emit_globals $*
 
 echo "void main()"
 echo "{"
-echo "gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;"
+if [ "$v" -eq 100 ]; then
+echo "gl_Position = vertex;"
+echo "gl_Position *= projection;"
+else
+echo "gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;"
+fi
 echo
 
 emit_set_matrix $*
@@ -387,7 +442,7 @@ if [ "x$1" = "x" ]; then
 version="1.10"
 else
 case "$1" in
-   1.[12]0) version="$1";;
+   1.[012]0) version="$1";;
*)
echo "Bogus GLSL version \"$1\" specified."
exit 1
-- 
1.7.10.4

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


[Piglit] [PATCH 1/2] variable-index-read.sh: extend to support glsl es 1.00

2013-04-18 Thread Tom Gall
Please apply. Initially posted ~ a month ago. No negative feedback.

>From tests/spec/glsl-1.10 extend variable-index-read.sh so that
it can also correctly generates variable index read tests that
support glsl-es-1.00.

1.00 added as a valid parameter to generated tests for glsl-es-1.00.

For 1.00 tests the vertex shader an orthographic projection is
applied since ortho during the test portion isn't supported on
OpenGL ES.

For 1.00 tests the fragent shader specifies default precision.

For 1.00 tests emit in the [require] section the correct
GLSL ES and GL ES settings.

Signed-off-by: Tom Gall 
---
 tests/spec/glsl-1.10/variable-index-read.sh |   54 ---
 1 file changed, 48 insertions(+), 6 deletions(-)

diff --git a/tests/spec/glsl-1.10/variable-index-read.sh 
b/tests/spec/glsl-1.10/variable-index-read.sh
index 80cb078..8fa2bc7 100755
--- a/tests/spec/glsl-1.10/variable-index-read.sh
+++ b/tests/spec/glsl-1.10/variable-index-read.sh
@@ -156,6 +156,7 @@ function emit_vs
 col=$5
 expect_type=$6
 do_compare=$7
+v=${version/./}
 
 if [ $array_dim -ne 0 ]; then
idx="[${index_value}]"
@@ -164,11 +165,24 @@ function emit_vs
 fi
 
 echo "[vertex shader]"
+if [ $v -eq 100 ]; then
+echo "attribute vec4 vertex;"
+echo "mat4 projection = mat4("
+echo "2.0/250.0, 0.0, 0.0, -1.0,"
+echo "0.0, 2.0/250.0, 0.0, -1.0,"
+echo "0.0, 0.0, -1.0, 0.0,"
+echo "0.0, 0.0, 0.0, 1.0);"
+fi
 emit_globals $*
 
 echo "void main()"
 echo "{"
-echo "gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;"
+if [ $v -eq 100 ]; then
+echo "gl_Position = vertex;"
+echo "gl_Position *= projection;"
+else
+echo "gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;"
+fi
 
 # Only emit the code to set the matrix if the vertex shader is generating
 # varyings for a fragment shader or the matrix is in local storage and the
@@ -215,8 +229,13 @@ emit_fs()
 col=$5
 expect_type=$6
 do_compare=$7
+v=${version/./}
 
 echo "[fragment shader]"
+if [ $v -eq 100 ]; then
+echo "precision highp float;"
+echo "precision highp int;"
+fi
 emit_globals $*
 
 echo "void main()"
@@ -275,6 +294,7 @@ function emit_test_vectors
 index_value=$4
 col=$5
 expect_type=$6
+v=${version/./}
 
 # Optimizing GLSL linkers may reduce the size of the uniform array if tail
 # elements are not accessed.  Shader runner will fail the test if one of
@@ -283,16 +303,24 @@ function emit_test_vectors
array_dim=$((index_value+1))
 fi
 
-cat <= $version"
+if [ $v -eq 100 ]; then
+echo "GLSL ES >= $version"
+echo "GL ES >= 2.0"
+else
+echo "GLSL >= $version"
+fi
 echo
 
 emit_vs $* 0
@@ -389,11 +424,18 @@ function emit_fs_rd_test
 # index in the fragment shader.
 function emit_vs_rd_test
 {
+v=${version/./}
+
 echo "# Test generated by:"
 echo "# ${cmd}"
 echo
 echo "[require]"
-echo "GLSL >= $version"
+if [ $v -eq 100 ]; then
+echo "GLSL ES >= $version"
+echo "GL ES >= 2.0"
+else
+echo "GLSL >= $version"
+fi
 echo
 
 emit_vs $* 1
@@ -408,7 +450,7 @@ if [ "x$1" = "x" ]; then
 version="1.10"
 else
 case "$1" in
-   1.[12]0) version="$1";;
+   1.[012]0) version="$1";;
*)
echo "Bogus GLSL version \"$1\" specified."
exit 1
-- 
1.7.10.4

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


Re: [Piglit] Requiring Python 3.x for Piglit?

2013-04-17 Thread Tom Gall
On Wed, Apr 17, 2013 at 4:48 AM, Kenneth Graunke  wrote:
> Does anyone object to porting to Python 3.x (and dropping 2.x support)?

I don't have strong objections, but more of a preference that 2.7+ and
3.x be supported.  My Ubuntu Raring (the next release of ubuntu)
install for instance has 2.7.4 as the default and the Ubuntu wiki
(https://wiki.ubuntu.com/Python/3) indicates they don't plan to go to
python 3 as the default until 14.04 LTS which would be next year.

> Some useful data points:
> - Debian stable has 3.1, testing/unstable have 3.2
> - Fedora 18 and Arch Linux have 3.3
> - Windows installers for 3.3 are available on python.org
> - Mac OS X support for 3.3 is also available on python.org
>
> - numpy and mako are both available for Python 3 now.  numpy is packaged on
> Arch and Debian testing/unstable.  Not sure how much of a pain it is to get
> on Windows/OSX.
>
> - intel-gpu-tools now requires Python 3.x to build.
>
> Jon Severinsson did a great job in making a hybrid solution that works with
> both Python 2 and 3, but I'm a bit nervous about some of it.  For example,
> unicode stuff has bitten us in the past, and supporting only one major
> language version seems a lot easier to get right.  It'd also be a lot
> cleaner to just transition to Python 3.x.

Sure supporting just one is easier, but we'd hardly be the only
project that supports both. Substantial projects like OpenStack can do
it, we can do it too.

> --Ken
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit

--
Regards,
Tom

"Where's the kaboom!? There was supposed to be an earth-shattering
kaboom!" Marvin Martian
Tech Lead, Graphics Working Group | Linaro.org │ Open source software
for ARM SoCs
w) tom.gall att linaro.org
h) tom_gall att mac.com
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] patch tracking

2013-04-10 Thread Tom Gall
Hi All,

It's a bit of a challenge to see the status of various patches. As an
observation and not a complaint, I have a number of patches dating a
ways back either with no action or reviews that haven't landed. I'm
sure I'm not the only one.

I wonder if setting up patchwork for tracking patch status would be helpful.

Another option could be a simple summary of patches still pending
every say couple weeks? I'd be happy to volunteer to do whatever might
be deemed as the most helpful.

--
Regards
Tom

"Where's the kaboom!? There was supposed to be an earth-shattering
kaboom!" Marvin Martian
Tech Lead, Graphics Working Group | Linaro.org │ Open source software
for ARM SoCs
w) tom.gall att linaro.org
h) tom_gall att mac.com
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 1/3] shader_runner: remove explicit #version from spec/glsl-1.10 tests

2013-04-04 Thread Tom Gall
On Thu, Apr 4, 2013 at 11:11 AM, Eric Anholt  wrote:
> Stuart Abercrombie  writes:
>
>> It will be added based on the GLSL requirement instead.
>>
>> Same number of passes on Sandy Bridge running all.tests without glean.
>
> I don't like this anti-#version crusade.  I'd like to see only patches
> to remove them if it actually makes the tests run somewhere new.  These
> tests in particular are for specific behavior of GLSL 1.10, and GLES
> should have equivalent tests that test for their particular limits.

GL ES does. The patches went in about a month ago and they live in
tests/spec/glsl-es-1.00/execution/maximums

Related, when the variable-index-read and variable-index-write patches
to include glsl-1.00 support are accepted (hint hint), the next set of
patches I have moves both of those scripts into the generated_tests
and then deletes all the variable-index tests from tests/spec/...

That will remove a few hundred cases where one might be tempted to
fiddle with #versions in favor of auto generating appropriate
testcases for glsl 1.00, 1.10 and 1.20.

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



--
Regards,
Tom

"Where's the kaboom!? There was supposed to be an earth-shattering
kaboom!" Marvin Martian
Tech Lead, Graphics Working Group | Linaro.org │ Open source software
for ARM SoCs
w) tom.gall att linaro.org
h) tom_gall att mac.com
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 3/3] add gen_non-lvalue_es-tests.py to generated_tests/CMakeLists.txt

2013-04-02 Thread Tom Gall

Signed-off-by: Tom Gall 
---
 generated_tests/CMakeLists.txt |4 
 1 file changed, 4 insertions(+)

diff --git a/generated_tests/CMakeLists.txt b/generated_tests/CMakeLists.txt
index db3734f..a30d9e6 100644
--- a/generated_tests/CMakeLists.txt
+++ b/generated_tests/CMakeLists.txt
@@ -54,6 +54,9 @@ piglit_make_generated_tests(
 piglit_make_generated_tests(
builtin_cl_int_tests.list
generate-cl-int-builtins.py)
+piglit_make_generated_tests(
+   non-lvalue_es-tests.list
+   gen_non-lvalue_es-tests.py)
 
 # Add a "gen-tests" target that can be used to generate all the
 # tests without doing any other compilation.
@@ -64,5 +67,6 @@ add_custom_target(gen-tests ALL
builtin_cl_int_tests.list
interpolation_tests.list
non-lvalue_tests.list
+   non-lvalue_es-tests.list
texture_query_lod_tests.list
uniform-initializer_tests.list)
-- 
1.7.10.4

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


[Piglit] [PATCH 2/3] add generated_tests/gen_non-lvalue_es-tests.py

2013-04-02 Thread Tom Gall
This adds a series l-value tests for glslparsertest. This new
python code creates glsl es versions of the tests. This "new"
code was directly based on generated_tests/gen_non-lvalue_tests.py.
The new es version outputs to generated_tests/spec/glsl-es-1.00.

Signed-off-by: Tom Gall 
---
 generated_tests/gen_non-lvalue_es-tests.py |  174 
 1 file changed, 174 insertions(+)
 create mode 100644 generated_tests/gen_non-lvalue_es-tests.py

diff --git a/generated_tests/gen_non-lvalue_es-tests.py 
b/generated_tests/gen_non-lvalue_es-tests.py
new file mode 100644
index 000..cc254fd
--- /dev/null
+++ b/generated_tests/gen_non-lvalue_es-tests.py
@@ -0,0 +1,174 @@
+# coding=utf-8
+#
+# Copyright © 2012 Intel Corporation
+# Copyright © 2013 Linaro Inc
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+# DEALINGS IN THE SOFTWARE.
+
+import os
+
+
+class TestES1(object):
+def __init__(self, type_name, op, usage, shader_target):
+self.type_name = type_name
+self.op = op
+self.usage = usage
+self.shader_target = shader_target
+
+def filename(self):
+if self.op == "++t":
+name_base = "preincrement"
+elif self.op == "--t":
+name_base = "predecrement"
+elif self.op == "t++":
+name_base = "postincrement"
+elif self.op == "t--":
+name_base = "postdecrement"
+
+return os.path.join('spec',
+'glsl-es-1.00',
+'compiler',
+'expressions',
+'{0}-{1}-non-lvalue-for-{2}.{3}'.format(
+name_base, self.type_name, self.usage,
+self.shader_target))
+
+def generate(self):
+if self.usage == 'assignment':
+test = """/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * Page 46, Section 5.8 of the GLSL ES 1.00.17 spec says:
+ *
+ * "Variables that are built-in types, entire structures, structure
+ * fields, l-values with the field selector ( . ) applied to select
+ * components or swizzles without repeated fields, l-values within
+ * parentheses and and l-values dereferenced with the array subscript
+ * operator ( [ ] ) are all l-values. Other unary, binary, ternary
+ * expressions, are not l-values. This includes assignments, function
+ * names, swizzles with repeated fields and constants.
+ *
+ * Array variables are l-values and maybe passed to parameters declared as
+ * out or inout. However, they may not be used as the target of assignment.
+ * Similiarly, structures containing arrays may be passed to parameters
+ * declared as out or inout but may not be used as the target of an
+ * assignment.
+ */
+uniform {self.type_name} u;
+{mode} vec4 v;
+
+void main()
+{{
+{self.type_name} t = u;
+
+{self.op} = {self.type_name}(v{components});
+{dest} = {var_as_vec4};
+}}
+"""
+else:
+test = """/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * Page 46, Section 5.8 of the GLSL ES 1.00.17 spec says:
+ *
+ * "Variables that are built-in types, entire structures, structure
+ * fields, l-values with the field selector ( . ) applied to select
+ * components or swizzles without repeated fields, l-values within
+ * parentheses and and l-values dereferenced with the array subscript
+ * operator ( [ ] ) are all l-values. Other unary, binary, ternary
+ * expressions, are not l-values. This includes assignments, function
+ * names, swizzles with repeated fields and constants.
+ *
+ * Arra

[Piglit] [PATCH 1/3] glsl_parser_test.py: For glsl 1.00 use gles2

2013-04-02 Thread Tom Gall
When the glsl_version is 1.00, use the glslparsertest_gles2 binary

Signed-off-by: Tom Gall 
---
 framework/glsl_parser_test.py |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/framework/glsl_parser_test.py b/framework/glsl_parser_test.py
index 66e6dd3..914904d 100755
--- a/framework/glsl_parser_test.py
+++ b/framework/glsl_parser_test.py
@@ -368,8 +368,14 @@ class GLSLParserTest(PlainExecTest):
return None
 
assert(self.config is not None)
+
+   if self.config.get('config', 'glsl_version') == '1.00':
+   runner = "glslparsertest_gles2"
+   else:
+   runner = "glslparsertest"
+
command = [
-   path.join(testBinDir, 'glslparsertest'),
+   path.join(testBinDir, runner),
self.__filepath,
self.config.get('config', 'expect_result'),
self.config.get('config', 'glsl_version')
-- 
1.7.10.4

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


[Piglit] Merge request: variable-index patches

2013-04-02 Thread Tom Gall
Just about two weeks ago I had posted:

http://lists.freedesktop.org/archives/piglit/2013-March/005231.html
http://lists.freedesktop.org/archives/piglit/2013-March/005232.html

If acceptable can we get these merged? There hasn't been any negative
feedback thus far.

I have the patches ready to go which follow up on these changes.
Specifically the as discussed movement of the variable index
generation scripts into generated-tests, small changes so the scripts
are called and then deletion of the generated tests since they no
longer need to be in git.

Thanks!

--
Regards,
Tom

"Where's the kaboom!? There was supposed to be an earth-shattering
kaboom!" Marvin Martian
Tech Lead, Graphics Working Group | Linaro.org │ Open source software
for ARM SoCs
w) tom.gall att linaro.org
h) tom_gall att mac.com
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 1/1] shader_runner.c: Fix lod_bias breakage on GLES.

2013-04-01 Thread Tom Gall
When lod_bias was added to shader_runner it broke compilation
on OpenGL ES. GL_TEXTURE_LOD_BIAS isn't defined as part of
OpenGL ES. Added #ifdef PIGLIT_USE_OPENGL to handle_texparameter
when the string_match checks for lod_bias.

Signed-off-by: Tom Gall 
---
 tests/shaders/shader_runner.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index 002cf72..22a9f0f 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -1577,11 +1577,13 @@ handle_texparameter(const char *line)
parameter_name = "mag";
line += strlen("mag ");
strings = mag_filter_modes;
+#ifdef PIGLIT_USE_OPENGL
} else if (string_match("lod_bias ", line)) {
line += strlen("lod_bias ");
glTexParameterf(target, GL_TEXTURE_LOD_BIAS,
strtod(line, NULL));
return;
+#endif
} else {
fprintf(stderr, "unknown texture parameter in `%s'\n", line);
piglit_report_result(PIGLIT_FAIL);
-- 
1.7.10.4

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


Re: [Piglit] [PATCH 2/2] variable-index-write.sh: extend to support glsl es 1.00

2013-03-28 Thread Tom Gall
On Thu, Mar 28, 2013 at 1:50 PM, Stuart Abercrombie
 wrote:
> The content looks good.  I'm just not sure if supplying 100 as a parameter
> should be the trigger for GLES GLSL 1.00.  It doesn't seem particularly
> obvious, although I know there is no regular GL GLSL version 1.00.

It's probably quite safe to say that a GLSL 1.00 will never happen and
that GLSL 1.00 will always mean GLSL ES 1.00.

I hate to drive from 100 by adding a 100es or something but I can see
the case for it.

> A separate preexisting issue is the location of the file, which is again
> misleading.

Yes these need to move. I think that's a separate patch and plan to
submit that as well.

Likewise the files that these scripts generate need to be deleted from
git and then a little bit of script added so that at build time all
these tests are generated in their respective glsl-xx-x.xx
directories.  I think that's a separate patch and also I plan to do
it.

> Stuart
>
>
> On Wed, Mar 20, 2013 at 3:15 PM, Tom Gall  wrote:
>>
>> From tests/spec/glsl-1.10 extend variable-index-write.sh so that
>> it can also correctly generates variable index write tests that
>> support glsl-es-1.00.
>>
>> 1.00 added as a valid parameter to generated tests for glsl-es-1.00.
>>
>> For 1.00 tests in the vertex shader an orthographic projection is
>> applied since ortho during the test portion isn't supported on
>> OpenGL ES.
>>
>> For 1.00 tests the fragent shader specifies default precision.
>>
>> For 1.00 tests emit in the [require] section the correct
>> GLSL ES and GL ES settings.
>>
>> Signed-off-by: Tom Gall 
>> ---
>>  tests/spec/glsl-1.10/variable-index-write.sh |   67
>> +++---
>>  1 file changed, 61 insertions(+), 6 deletions(-)
>>
>> diff --git a/tests/spec/glsl-1.10/variable-index-write.sh
>> b/tests/spec/glsl-1.10/variable-index-write.sh
>> index 96a4791..06802c4 100755
>> --- a/tests/spec/glsl-1.10/variable-index-write.sh
>> +++ b/tests/spec/glsl-1.10/variable-index-write.sh
>> @@ -177,6 +177,10 @@ function emit_fs
>>  fi
>>
>>  echo "[fragment shader]"
>> +if [ $v -eq 100 ]; then
>> +echo "precision highp float;"
>> +echo "precision highp int;"
>> +fi
>>
>>  emit_globals $*
>>
>> @@ -207,14 +211,24 @@ function emit_test_vectors
>>  index_value=$4
>>  col=$5
>>  value_type=$6
>> +v=${version/./}
>>
>> -cat <> +if [ "$v" -eq 100 ]; then
>> +cat <> +[test]
>> +clear color 0.5 0.5 0.5 0.5
>> +clear
>> +
>> +EOF
>> +else
>> +cat <>  [test]
>>  clear color 0.5 0.5 0.5 0.5
>>  clear
>>  ortho
>>
>>  EOF
>> +fi
>>
>>  # NOTE: shader_runner uses the matCxR names even for GLSL 1.10
>>  type="mat${matrix_dim}x${matrix_dim}"
>> @@ -321,15 +335,37 @@ EOF
>>
>>  function emit_fs_wr_test
>>  {
>> +v=${version/./}
>> +
>>  echo "# Test generated by:"
>>  echo "# ${cmd}"
>>  echo
>>  echo "[require]"
>> -echo "GLSL >= ${version}"
>> +if [ "$v" -eq 100 ]; then
>> +echo "GLSL ES >= ${version}"
>> +echo "GL ES >= 2.0"
>> +else
>> +echo "GLSL >= ${version}"
>> +fi
>>  echo
>>
>>  echo "[vertex shader]"
>> -echo "void main() { gl_Position = gl_ModelViewProjectionMatrix *
>> gl_Vertex; }"
>> +if [ "$v" -eq 100 ]; then
>> +echo "attribute vec4 vertex;"
>> +echo "mat4 projection = mat4("
>> +echo "2.0/250.0, 0.0, 0.0, -1.0,"
>> +echo "0.0, 2.0/250.0, 0.0, -1.0,"
>> +echo "0.0, 0.0, -1.0, 0.0,"
>> +echo "0.0, 0.0, 0.0, 1.0);"
>> +echo
>> +echo "void main()"
>> +echo "{"
>> +echo "gl_Position = vertex;"
>> +echo "gl_Position *= projection;"
>> +echo "}"
>> +else
>> +echo "void main() { gl_Position = gl_ModelViewProjectionMatrix *
>> gl_Vertex; }"
>> +fi
>>  echo
>>
>>  emit_fs $*
>> @@ -342,20 +378,39 @@ function emit_vs_wr_test
>>  matrix_dim=$1
>&

[Piglit] [PATCH 2/2] variable-index-write.sh: extend to support glsl es 1.00

2013-03-20 Thread Tom Gall
>From tests/spec/glsl-1.10 extend variable-index-write.sh so that
it can also correctly generates variable index write tests that
support glsl-es-1.00.

1.00 added as a valid parameter to generated tests for glsl-es-1.00.

For 1.00 tests in the vertex shader an orthographic projection is
applied since ortho during the test portion isn't supported on
OpenGL ES.

For 1.00 tests the fragent shader specifies default precision.

For 1.00 tests emit in the [require] section the correct
GLSL ES and GL ES settings.

Signed-off-by: Tom Gall 
---
 tests/spec/glsl-1.10/variable-index-write.sh |   67 +++---
 1 file changed, 61 insertions(+), 6 deletions(-)

diff --git a/tests/spec/glsl-1.10/variable-index-write.sh 
b/tests/spec/glsl-1.10/variable-index-write.sh
index 96a4791..06802c4 100755
--- a/tests/spec/glsl-1.10/variable-index-write.sh
+++ b/tests/spec/glsl-1.10/variable-index-write.sh
@@ -177,6 +177,10 @@ function emit_fs
 fi
 
 echo "[fragment shader]"
+if [ $v -eq 100 ]; then
+echo "precision highp float;"
+echo "precision highp int;"
+fi
 
 emit_globals $*
 
@@ -207,14 +211,24 @@ function emit_test_vectors
 index_value=$4
 col=$5
 value_type=$6
+v=${version/./}
 
-cat <= ${version}"
+if [ "$v" -eq 100 ]; then
+echo "GLSL ES >= ${version}"
+echo "GL ES >= 2.0"
+else
+echo "GLSL >= ${version}"
+fi
 echo
 
 echo "[vertex shader]"
-echo "void main() { gl_Position = gl_ModelViewProjectionMatrix * 
gl_Vertex; }"
+if [ "$v" -eq 100 ]; then
+echo "attribute vec4 vertex;"
+echo "mat4 projection = mat4("
+echo "2.0/250.0, 0.0, 0.0, -1.0,"
+echo "0.0, 2.0/250.0, 0.0, -1.0,"
+echo "0.0, 0.0, -1.0, 0.0,"
+echo "0.0, 0.0, 0.0, 1.0);"
+echo
+echo "void main()"
+echo "{"
+echo "gl_Position = vertex;"
+echo "gl_Position *= projection;"
+echo "}"
+else
+echo "void main() { gl_Position = gl_ModelViewProjectionMatrix * 
gl_Vertex; }"
+fi
 echo
 
 emit_fs $*
@@ -342,20 +378,39 @@ function emit_vs_wr_test
 matrix_dim=$1
 array_dim=$2
 mode=$3
+v=${version/./}
 
 echo "# Test generated by:"
 echo "# ${cmd}"
 echo
 echo "[require]"
-echo "GLSL >= ${version}"
+if [ "$v" -eq 100 ]; then
+echo "GLSL ES >= ${version}"
+echo "GL ES >= 2.0"
+else
+echo "GLSL >= ${version}"
+fi
 echo
 
 echo "[vertex shader]"
+if [ "$v" -eq 100 ]; then
+echo "attribute vec4 vertex;"
+echo "mat4 projection = mat4("
+echo "2.0/250.0, 0.0, 0.0, -1.0,"
+echo "0.0, 2.0/250.0, 0.0, -1.0,"
+echo "0.0, 0.0, -1.0, 0.0,"
+echo "0.0, 0.0, 0.0, 1.0);"
+fi
 emit_globals $*
 
 echo "void main()"
 echo "{"
-echo "gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;"
+if [ "$v" -eq 100 ]; then
+echo "gl_Position = vertex;"
+echo "gl_Position *= projection;"
+else
+echo "gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;"
+fi
 echo
 
 emit_set_matrix $*
@@ -387,7 +442,7 @@ if [ "x$1" = "x" ]; then
 version="1.10"
 else
 case "$1" in
-   1.[12]0) version="$1";;
+   1.[012]0) version="$1";;
*)
echo "Bogus GLSL version \"$1\" specified."
exit 1
-- 
1.7.10.4

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


[Piglit] [PATCH 1/2] variable-index-read.sh: extend to support glsl es 1.00

2013-03-20 Thread Tom Gall
>From tests/spec/glsl-1.10 extend variable-index-read.sh so that
it can also correctly generates variable index read tests that
support glsl-es-1.00.

1.00 added as a valid parameter to generated tests for glsl-es-1.00.

For 1.00 tests the vertex shader an orthographic projection is
applied since ortho during the test portion isn't supported on
OpenGL ES.

For 1.00 tests the fragent shader specifies default precision.

For 1.00 tests emit in the [require] section the correct
GLSL ES and GL ES settings.

Signed-off-by: Tom Gall 
---
 tests/spec/glsl-1.10/variable-index-read.sh |   54 ---
 1 file changed, 48 insertions(+), 6 deletions(-)

diff --git a/tests/spec/glsl-1.10/variable-index-read.sh 
b/tests/spec/glsl-1.10/variable-index-read.sh
index 80cb078..8fa2bc7 100755
--- a/tests/spec/glsl-1.10/variable-index-read.sh
+++ b/tests/spec/glsl-1.10/variable-index-read.sh
@@ -156,6 +156,7 @@ function emit_vs
 col=$5
 expect_type=$6
 do_compare=$7
+v=${version/./}
 
 if [ $array_dim -ne 0 ]; then
idx="[${index_value}]"
@@ -164,11 +165,24 @@ function emit_vs
 fi
 
 echo "[vertex shader]"
+if [ $v -eq 100 ]; then
+echo "attribute vec4 vertex;"
+echo "mat4 projection = mat4("
+echo "2.0/250.0, 0.0, 0.0, -1.0,"
+echo "0.0, 2.0/250.0, 0.0, -1.0,"
+echo "0.0, 0.0, -1.0, 0.0,"
+echo "0.0, 0.0, 0.0, 1.0);"
+fi
 emit_globals $*
 
 echo "void main()"
 echo "{"
-echo "gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;"
+if [ $v -eq 100 ]; then
+echo "gl_Position = vertex;"
+echo "gl_Position *= projection;"
+else
+echo "gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;"
+fi
 
 # Only emit the code to set the matrix if the vertex shader is generating
 # varyings for a fragment shader or the matrix is in local storage and the
@@ -215,8 +229,13 @@ emit_fs()
 col=$5
 expect_type=$6
 do_compare=$7
+v=${version/./}
 
 echo "[fragment shader]"
+if [ $v -eq 100 ]; then
+echo "precision highp float;"
+echo "precision highp int;"
+fi
 emit_globals $*
 
 echo "void main()"
@@ -275,6 +294,7 @@ function emit_test_vectors
 index_value=$4
 col=$5
 expect_type=$6
+v=${version/./}
 
 # Optimizing GLSL linkers may reduce the size of the uniform array if tail
 # elements are not accessed.  Shader runner will fail the test if one of
@@ -283,16 +303,24 @@ function emit_test_vectors
array_dim=$((index_value+1))
 fi
 
-cat <= $version"
+if [ $v -eq 100 ]; then
+echo "GLSL ES >= $version"
+echo "GL ES >= 2.0"
+else
+echo "GLSL >= $version"
+fi
 echo
 
 emit_vs $* 0
@@ -389,11 +424,18 @@ function emit_fs_rd_test
 # index in the fragment shader.
 function emit_vs_rd_test
 {
+v=${version/./}
+
 echo "# Test generated by:"
 echo "# ${cmd}"
 echo
 echo "[require]"
-echo "GLSL >= $version"
+if [ $v -eq 100 ]; then
+echo "GLSL ES >= $version"
+echo "GL ES >= 2.0"
+else
+echo "GLSL >= $version"
+fi
 echo
 
 emit_vs $* 1
@@ -408,7 +450,7 @@ if [ "x$1" = "x" ]; then
 version="1.10"
 else
 case "$1" in
-   1.[12]0) version="$1";;
+   1.[012]0) version="$1";;
*)
echo "Bogus GLSL version \"$1\" specified."
exit 1
-- 
1.7.10.4

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


[Piglit] [PATCH 1/1] glsl-es-1.00: sanity.shader_test fragment needs default precision

2013-03-20 Thread Tom Gall
GLSL ES 1.00 spec 4.5.3 page 36:
"The fragment language has no default precision qualifier for
floating point types."

Adding default precision for float in the fragment shader
so this sanity testcase doesn't error out.
mediump is choosen since according to 4.5.2 page 34:
"The fragment language requires any uses of lowp and mediump to
compile without error.  Support for highp is optional."

Signed-off-by: Tom Gall 
---
 tests/spec/glsl-es-1.00/execution/sanity.shader_test |2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/spec/glsl-es-1.00/execution/sanity.shader_test 
b/tests/spec/glsl-es-1.00/execution/sanity.shader_test
index 0884e2c..5461167 100644
--- a/tests/spec/glsl-es-1.00/execution/sanity.shader_test
+++ b/tests/spec/glsl-es-1.00/execution/sanity.shader_test
@@ -12,6 +12,8 @@ void main() {
 }
 
 [fragment shader]
+precision mediump float;
+
 uniform vec4 u_color;
 
 void main() {
-- 
1.7.10.4

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


Re: [Piglit] [PATCH] shader_runner: remove explicit #version from outerProduct generated tests.

2013-03-11 Thread Tom Gall
On Mon, Mar 11, 2013 at 12:41 PM, Stuart Abercrombie
 wrote:
> It will be added based on the GLSL requirement instead.
>
> Also make it clearer that these shader_test files are automatically generated.

Why patch the tests instead of the script that generated them?

> Same number of passes on Sandy Bridge running all.tests without glean.
>
> Signed-off-by: Stuart Abercrombie 


Reviewed-by: Tom Gall 

-- 
Regards,
Tom

"Where's the kaboom!? There was supposed to be an earth-shattering
kaboom!" Marvin Martian
Tech Lead, Graphics Working Group | Linaro.org │ Open source software
for ARM SoCs
w) tom.gall att linaro.org
h) tom_gall att mac.com
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] RFC: variable-index-read.sh and write for GLES

2013-02-27 Thread Tom Gall
From tests/spec/glsl-1.10,  I've extended variable-index-write.sh and
variable-index-read.sh so the scripts are able to generate tests for
GLSL ES 1.00.

Posting the patches for the scripts is trivial but how do we want to
handle all the tests that it generates?

Seems like a bit of a waste of mailing list bandwidth to post the 326
resulting new files as patches that are output from the scripts.

Thoughts?

--
Regards,
Tom

"Where's the kaboom!? There was supposed to be an earth-shattering
kaboom!" Marvin Martian
Tech Lead, Graphics Working Group | Linaro.org │ Open source software
for ARM SoCs
w) tom.gall att linaro.org
h) tom_gall att mac.com
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH RESEND 3/3] glslparsertest: Avoid uninitialized vars in parse_glsl_version_number.

2013-02-27 Thread Tom Gall
For the series.

Reviewed-by: Tom Gall 

On Wed, Feb 27, 2013 at 12:59 PM, Chad Versace
 wrote:
> On 02/27/2013 10:47 AM, Paul Berry wrote:
>> On 27 February 2013 10:44, Eric Anholt > <mailto:e...@anholt.net>> wrote:
>>
>> Paul Berry mailto:stereotype...@gmail.com>> 
>> writes:
>>
>> > Previously, if the user specified an ill-formed GLSL version number
>> > (or the implementation supplied an ill-formed number in its response
>> > to glGetString(GL_SHADING_LANGUAGE_VERSION)), glslparsertest would
>> > access uninitialized variables, resulting in unpredictable (and often
>> > confusing) behaviour.
>> >
>> > With this patch, glslparser test accepts version numbers either of the
>> > form "" or ".".  Ill-formed version numbers lead to a
>> > test failure.
>> > ---
>> >  tests/glslparsertest/glslparsertest.c | 10 +++---
>> >  1 file changed, 7 insertions(+), 3 deletions(-)
>> >
>> > diff --git a/tests/glslparsertest/glslparsertest.c
>> b/tests/glslparsertest/glslparsertest.c
>> > index 43bef03..c9696be 100644
>> > --- a/tests/glslparsertest/glslparsertest.c
>> > +++ b/tests/glslparsertest/glslparsertest.c
>> > @@ -339,10 +339,14 @@ int process_options(int argc, char **argv)
>> >  static unsigned
>> >  parse_glsl_version_number(const char *str)
>> >  {
>> > - unsigned major;
>> > - unsigned minor;
>> > + unsigned major = 0;
>> > + unsigned minor = 0;
>> > +
>> > + if (sscanf(str, "%u.%u", &major, &minor) == 0) {
>> > + printf("Ill-formed GLSL version number: %s\n", str);
>> > + piglit_report_result(PIGLIT_FAIL);
>> > + }
>>
>> For full pedantry, I think that would be sscanf(...) != 2.
>>
>>
>> Actually, sscanf(...) == 0 allows the version number to be supplied as either
>> "" or ".".
>
> Please add a comment explaining that's why `== 0` is used. I saw your trick,
> but it's not obvious.
>
> With that, the series is:
> Reviewed-by: Chad Versace 
>
> By the way, I do prefer Tom's suggestions to use runtime detection in
> patches 1 and 2. That would be one less thing to clean up when we switch
> to unified binaries. But, it doesn't really matter today.
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit



--
Regards,
Tom

"Where's the kaboom!? There was supposed to be an earth-shattering
kaboom!" Marvin Martian
Tech Lead, Graphics Working Group | Linaro.org │ Open source software
for ARM SoCs
w) tom.gall att linaro.org
h) tom_gall att mac.com
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH RESEND 2/3] glslparsertest: Don't require ES compatibility extensions when testing GLES.

2013-02-27 Thread Tom Gall
I don't have an objection, just thought I'd ask. If in the longer term
we have the goal to build just one test binary that can be applied
against different versions of GL, then we'll have to go back and get
rid of these compile time checks.

Regards,
Tom

On Wed, Feb 27, 2013 at 12:54 PM, Paul Berry  wrote:
> On 27 February 2013 10:46, Tom Gall  wrote:
>>
>> Hmm is there some reason this has to be a compile time decision as
>> compared to use of the piglit_is_gles() function?
>
>
> No, I don't really see a reason to prefer one way over the other.
>
>>
>>
>> Here's a link to the patch that I had posted on the 18th.
>>
>> http://lists.freedesktop.org/archives/piglit/2013-February/004952.html
>
>
> Wow, looks like we both failed to notice each other's patch :)
>
> It looks like your version only addresses GLES2, not GLES3.  Any objection
> to going forward with my version?  I have the series ready to push, and it's
> already received Eric's review.
>
>>
>>
>>
>>
>> On Wed, Feb 27, 2013 at 12:32 PM, Paul Berry 
>> wrote:
>> > glslparsertest should only check for the presence of
>> > GL_ARB_ES{2,3}_compatibility when the test is running under desktop
>> > GL.  GLES never exposes these extensions.
>> > ---
>> >  tests/glslparsertest/glslparsertest.c | 36
>> > ---
>> >  1 file changed, 25 insertions(+), 11 deletions(-)
>> >
>> > diff --git a/tests/glslparsertest/glslparsertest.c
>> > b/tests/glslparsertest/glslparsertest.c
>> > index 26a558f..43bef03 100644
>> > --- a/tests/glslparsertest/glslparsertest.c
>> > +++ b/tests/glslparsertest/glslparsertest.c
>> > @@ -366,6 +366,30 @@ parse_glsl_version_string(const char *str)
>> > return parse_glsl_version_number(str);
>> >  }
>> >
>> > +
>> > +static void
>> > +check_version(unsigned glsl_version)
>> > +{
>> > +#ifdef PIGLIT_USE_OPENGL
>> > +   if (requested_version == 100) {
>> > +   piglit_require_extension("GL_ARB_ES2_compatibility");
>> > +   return;
>> > +   } else if (requested_version == 300) {
>> > +   piglit_require_extension("GL_ARB_ES3_compatibility");
>> > +   return;
>> > +   }
>> > +#endif
>> > +
>> > +   if (glsl_version < requested_version) {
>> > +   fprintf(stderr,
>> > +   "GLSL version is %u.%u, but requested version
>> > %u.%u is required\n",
>> > +   glsl_version / 100, glsl_version % 100,
>> > +   requested_version / 100, requested_version %
>> > 100);
>> > +   piglit_report_result(PIGLIT_SKIP);
>> > +   }
>> > +}
>> > +
>> > +
>> >  void
>> >  piglit_init(int argc, char**argv)
>> >  {
>> > @@ -406,17 +430,7 @@ piglit_init(int argc, char**argv)
>> > if (glsl_version_string != NULL)
>> > glsl_version =
>> > parse_glsl_version_string(glsl_version_string);
>> >
>> > -   if (requested_version == 100) {
>> > -   piglit_require_extension("GL_ARB_ES2_compatibility");
>> > -   } else if (requested_version == 300) {
>> > -   piglit_require_extension("GL_ARB_ES3_compatibility");
>> > -   } else if (glsl_version < requested_version) {
>> > -   fprintf(stderr,
>> > -   "GLSL version is %u.%u, but requested version
>> > %u.%u is required\n",
>> > -   glsl_version / 100, glsl_version % 100,
>> > -   requested_version / 100, requested_version %
>> > 100);
>> > -   piglit_report_result(PIGLIT_SKIP);
>> > -   }
>> > +   check_version(glsl_version);
>> >
>> > for (i = 4; i < argc; i++) {
>> > if (argv[i][0] == '!') {
>> > --
>> > 1.8.1.4
>> >
>> > ___
>> > Piglit mailing list
>> > Piglit@lists.freedesktop.org
>> > http://lists.freedesktop.org/mailman/listinfo/piglit
>>
>>
>>
>> --
>> Regards,
>> Tom
>>
>> "Where's the kaboom!? There was supposed to be an earth-shattering
>> kaboom!" Marvin Martian
>> Tech Lead, Graphics Working Group | Linaro.org │ Open source software
>> for ARM SoCs
>> w) tom.gall att linaro.org
>> h) tom_gall att mac.com
>
>



--
Regards,
Tom

"Where's the kaboom!? There was supposed to be an earth-shattering
kaboom!" Marvin Martian
Tech Lead, Graphics Working Group | Linaro.org │ Open source software
for ARM SoCs
w) tom.gall att linaro.org
h) tom_gall att mac.com
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH RESEND 2/3] glslparsertest: Don't require ES compatibility extensions when testing GLES.

2013-02-27 Thread Tom Gall
Hmm is there some reason this has to be a compile time decision as
compared to use of the piglit_is_gles() function?

Here's a link to the patch that I had posted on the 18th.

http://lists.freedesktop.org/archives/piglit/2013-February/004952.html



On Wed, Feb 27, 2013 at 12:32 PM, Paul Berry  wrote:
> glslparsertest should only check for the presence of
> GL_ARB_ES{2,3}_compatibility when the test is running under desktop
> GL.  GLES never exposes these extensions.
> ---
>  tests/glslparsertest/glslparsertest.c | 36 
> ---
>  1 file changed, 25 insertions(+), 11 deletions(-)
>
> diff --git a/tests/glslparsertest/glslparsertest.c 
> b/tests/glslparsertest/glslparsertest.c
> index 26a558f..43bef03 100644
> --- a/tests/glslparsertest/glslparsertest.c
> +++ b/tests/glslparsertest/glslparsertest.c
> @@ -366,6 +366,30 @@ parse_glsl_version_string(const char *str)
> return parse_glsl_version_number(str);
>  }
>
> +
> +static void
> +check_version(unsigned glsl_version)
> +{
> +#ifdef PIGLIT_USE_OPENGL
> +   if (requested_version == 100) {
> +   piglit_require_extension("GL_ARB_ES2_compatibility");
> +   return;
> +   } else if (requested_version == 300) {
> +   piglit_require_extension("GL_ARB_ES3_compatibility");
> +   return;
> +   }
> +#endif
> +
> +   if (glsl_version < requested_version) {
> +   fprintf(stderr,
> +   "GLSL version is %u.%u, but requested version %u.%u 
> is required\n",
> +   glsl_version / 100, glsl_version % 100,
> +   requested_version / 100, requested_version % 100);
> +   piglit_report_result(PIGLIT_SKIP);
> +   }
> +}
> +
> +
>  void
>  piglit_init(int argc, char**argv)
>  {
> @@ -406,17 +430,7 @@ piglit_init(int argc, char**argv)
> if (glsl_version_string != NULL)
> glsl_version = parse_glsl_version_string(glsl_version_string);
>
> -   if (requested_version == 100) {
> -   piglit_require_extension("GL_ARB_ES2_compatibility");
> -   } else if (requested_version == 300) {
> -   piglit_require_extension("GL_ARB_ES3_compatibility");
> -   } else if (glsl_version < requested_version) {
> -   fprintf(stderr,
> -   "GLSL version is %u.%u, but requested version %u.%u 
> is required\n",
> -   glsl_version / 100, glsl_version % 100,
> -   requested_version / 100, requested_version % 100);
> -   piglit_report_result(PIGLIT_SKIP);
> -   }
> +   check_version(glsl_version);
>
> for (i = 4; i < argc; i++) {
> if (argv[i][0] == '!') {
> --
> 1.8.1.4
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit



--
Regards,
Tom

"Where's the kaboom!? There was supposed to be an earth-shattering
kaboom!" Marvin Martian
Tech Lead, Graphics Working Group | Linaro.org │ Open source software
for ARM SoCs
w) tom.gall att linaro.org
h) tom_gall att mac.com
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 1/3] piglit: add piglit_get_prim_name() helper

2013-02-21 Thread Tom Gall
Looks good across the set.

Reviewed-by: Tom Gall 

On Thu, Feb 21, 2013 at 9:37 AM, Brian Paul  wrote:
> ---
>  tests/util/piglit-util-gl-common.h |   12 ++
>  tests/util/piglit-util-gl-enum.c   |   41 
> 
>  2 files changed, 53 insertions(+), 0 deletions(-)
>
> diff --git a/tests/util/piglit-util-gl-common.h 
> b/tests/util/piglit-util-gl-common.h
> index 336953d..accf1f3 100644
> --- a/tests/util/piglit-util-gl-common.h
> +++ b/tests/util/piglit-util-gl-common.h
> @@ -80,6 +80,18 @@ const char* piglit_get_gl_error_name(GLenum error);
>  const char *piglit_get_gl_enum_name(GLenum param);
>
>  /**
> + * \brief Convert a GL primitive type enum value to a string.
> + *
> + * For example, given GL_POLYGON, return "GL_POLYGON".
> + * We don't use piglit_get_gl_enum_name() for this because there are
> + * other enums which alias the prim type enums (ex: GL_POINTS = GL_NONE);
> + *
> + * Return "(unrecognized enum)" if the enum is not recognized.
> + */
> +const char *piglit_get_prim_name(GLenum prim);
> +
> +
> +/**
>   * \brief Check for unexpected GL errors.
>   *
>   * If glGetError() returns an error other than \c expected_error, then
> diff --git a/tests/util/piglit-util-gl-enum.c 
> b/tests/util/piglit-util-gl-enum.c
> index bc48384..8769f4d 100644
> --- a/tests/util/piglit-util-gl-enum.c
> +++ b/tests/util/piglit-util-gl-enum.c
> @@ -2986,3 +2986,44 @@ piglit_get_gl_enum_name(GLenum param)
>  #undef CASE
>  }
>
> +
> +const char *
> +piglit_get_prim_name(GLenum prim)
> +{
> +   switch (prim) {
> +   case GL_POINTS:
> +   return "GL_POINTS";
> +   case GL_LINES:
> +   return "GL_LINES";
> +   case GL_LINE_STRIP:
> +   return "GL_LINE_STRIP";
> +   case GL_LINE_LOOP:
> +   return "GL_LINE_LOOP";
> +   case GL_TRIANGLES:
> +   return "GL_TRIANGLES";
> +   case GL_TRIANGLE_STRIP:
> +   return "GL_TRIANGLE_STRIP";
> +   case GL_TRIANGLE_FAN:
> +   return "GL_TRIANGLE_FAN";
> +   case GL_QUADS:
> +   return "GL_QUADS";
> +   case GL_QUAD_STRIP:
> +   return "GL_QUAD_STRIP";
> +   case GL_POLYGON:
> +   return "GL_POLYGON";
> +   case GL_LINES_ADJACENCY:
> +   return "GL_LINES_ADJACENCY";
> +   case GL_LINE_STRIP_ADJACENCY:
> +   return "GL_LINE_STRIP_ADJACENCY";
> +   case GL_TRIANGLES_ADJACENCY:
> +   return "GL_TRIANGLES_ADJACENCY";
> +   case GL_TRIANGLE_STRIP_ADJACENCY:
> +   return "GL_TRIANGLE_STRIP_ADJACENCY";
> +   case GL_PATCHES:
> +   return "GL_PATCHES";
> +   default:
> +   return "(unrecognized enum)";
> +   }
> +}
> +
> +
> --
> 1.7.3.4
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit



--
Regards,
Tom

"Where's the kaboom!? There was supposed to be an earth-shattering
kaboom!" Marvin Martian
Tech Lead, Graphics Working Group | Linaro.org │ Open source software
for ARM SoCs
w) tom.gall att linaro.org
h) tom_gall att mac.com
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 1/1] Add tests/spec/glsl-es-1.00/execution/maximums shader tests

2013-02-21 Thread Tom Gall
Adds gl_MaxCombinedTextureImageUnits.shader_test
 gl_MaxDrawBuffers.shader_test
 gl_MaxFragmentUniformVectors.shader_test
 gl_MaxTextureImageUnits.shader_test
 gl_MaxVaryingVectors.shader_test
 gl_MaxVertexAttribs.shader_test
 gl_MaxVertexTextureImageUnits.shader_test
 gl_MaxVertexUniformVectors.shader_test

These check the built-in constants of the same name from
section 7.4 of the glsl es 1.0.17 spec.

v2: squash patch, address one by one spec reference.

Signed-off-by: Tom Gall 
---
 .../gl_MaxCombinedTextureImageUnits.shader_test|   30 
 .../maximums/gl_MaxDrawBuffers.shader_test |   29 +++
 .../gl_MaxFragmentUniformVectors.shader_test   |   29 +++
 .../maximums/gl_MaxTextureImageUnits.shader_test   |   29 +++
 .../maximums/gl_MaxVaryingVectors.shader_test  |   29 +++
 .../maximums/gl_MaxVertexAttribs.shader_test   |   29 +++
 .../gl_MaxVertexTextureImageUnits.shader_test  |   29 +++
 .../gl_MaxVertexUniformVectors.shader_test |   29 +++
 8 files changed, 233 insertions(+)
 create mode 100644 
tests/spec/glsl-es-1.00/execution/maximums/gl_MaxCombinedTextureImageUnits.shader_test
 create mode 100644 
tests/spec/glsl-es-1.00/execution/maximums/gl_MaxDrawBuffers.shader_test
 create mode 100644 
tests/spec/glsl-es-1.00/execution/maximums/gl_MaxFragmentUniformVectors.shader_test
 create mode 100644 
tests/spec/glsl-es-1.00/execution/maximums/gl_MaxTextureImageUnits.shader_test
 create mode 100644 
tests/spec/glsl-es-1.00/execution/maximums/gl_MaxVaryingVectors.shader_test
 create mode 100644 
tests/spec/glsl-es-1.00/execution/maximums/gl_MaxVertexAttribs.shader_test
 create mode 100644 
tests/spec/glsl-es-1.00/execution/maximums/gl_MaxVertexTextureImageUnits.shader_test
 create mode 100644 
tests/spec/glsl-es-1.00/execution/maximums/gl_MaxVertexUniformVectors.shader_test

diff --git 
a/tests/spec/glsl-es-1.00/execution/maximums/gl_MaxCombinedTextureImageUnits.shader_test
 
b/tests/spec/glsl-es-1.00/execution/maximums/gl_MaxCombinedTextureImageUnits.shader_test
new file mode 100644
index 000..887cb8f
--- /dev/null
+++ 
b/tests/spec/glsl-es-1.00/execution/maximums/gl_MaxCombinedTextureImageUnits.shader_test
@@ -0,0 +1,30 @@
+# [description]
+# Tests for GLSL ES 1.00 minimum maximums for the builtin constants.
+#
+# See the GLSL ES 1.0.17 specification, section 7.4, page 61
+
+[require]
+GLSL ES >= 1.00
+GL ES >= 2.0
+
+[vertex shader]
+attribute vec4 vertex;
+
+void main(void)
+{
+   gl_Position = vertex;
+}
+
+[fragment shader]
+
+void main(void)
+{
+   if (gl_MaxCombinedTextureImageUnits >= 8)
+   gl_FragColor = vec4(0, 1, 0, 0);
+   else
+   gl_FragColor = vec4(1, 0, 0, 0);
+}
+
+[test]
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 0.0
diff --git 
a/tests/spec/glsl-es-1.00/execution/maximums/gl_MaxDrawBuffers.shader_test 
b/tests/spec/glsl-es-1.00/execution/maximums/gl_MaxDrawBuffers.shader_test
new file mode 100644
index 000..b9a9b5b
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/execution/maximums/gl_MaxDrawBuffers.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Tests for GLSL ES 1.00 minimum maximums for the builtin constants.
+#
+# See the GLSL ES 1.0.17 specification, section 7.4, page 61.
+
+[require]
+GLSL ES >= 1.00
+GL ES >= 2.0
+
+[vertex shader]
+attribute vec4 vertex;
+
+void main(void)
+{
+   gl_Position = vertex;
+}
+
+[fragment shader]
+void main(void)
+{
+   if (gl_MaxDrawBuffers >= 1)
+   gl_FragColor = vec4(0, 1, 0, 0);
+   else
+   gl_FragColor = vec4(1, 0, 0, 0);
+}
+
+[test]
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 0.0
diff --git 
a/tests/spec/glsl-es-1.00/execution/maximums/gl_MaxFragmentUniformVectors.shader_test
 
b/tests/spec/glsl-es-1.00/execution/maximums/gl_MaxFragmentUniformVectors.shader_test
new file mode 100644
index 000..df3ecbc
--- /dev/null
+++ 
b/tests/spec/glsl-es-1.00/execution/maximums/gl_MaxFragmentUniformVectors.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Tests for GLSL ES 1.00 minimum maximums for the builtin constants.
+#
+# See the GLSL ES 1.0.17 specification, section 7.4, page 61.
+
+[require]
+GLSL ES >= 1.00
+GL ES >= 2.0
+
+[vertex shader]
+attribute vec4 vertex;
+
+void main(void)
+{
+   gl_Position = vertex;
+}
+
+[fragment shader]
+void main(void)
+{
+   if (gl_MaxFragmentUniformVectors >= 16)
+   gl_FragColor = vec4(0, 1, 0, 0);
+   else
+   gl_FragColor = vec4(1, 0, 0, 0);
+}
+
+[test]
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 0.0
diff --git 
a/tests/spec/glsl-es-1.00/execution/maximums/gl_MaxTextureImageUnits.shader_test
 
b/tests/spec/glsl-es-1.00/execution/maximums/gl_MaxTextureImageUnits.shader_test
new file mode 100644
index 000..e1b0ed7
--- /dev/null
+++ 
b/tests/spec/glsl

Re: [Piglit] [PATCH 1/8] shader_runner: glsl-es-1.00 add maximums/gl_MaxCombinedTextureImageUnits.shader_test

2013-02-19 Thread Tom Gall
Hi Jordan,

On Mon, Feb 18, 2013 at 8:01 PM, Jordan Justen  wrote:
> Wouldn't a better subject for this patch be:
> glsl-es-1.00: add maximums/gl_MaxCombinedTextureImageUnits
>
> since it is not modifying shader_runner?

These are datafiles for shader_runner, ergo why I used the
shader_runner tag. I guess I could see it going either way.

> -Jordan
>
> On Mon, Feb 18, 2013 at 2:02 PM, Tom Gall  wrote:
>> Adds tests/spec/glsl-es-1.00/maximums/
>> gl_MaxCombinedTextureImageUnits.shader_test, checks built-in
>> constant gl_MaxCombinedTextureImageUnits
>>
>> Signed-off-by: Tom Gall 




-- 
Regards,
Tom

"Where's the kaboom!? There was supposed to be an earth-shattering
kaboom!" Marvin Martian
Tech Lead, Graphics Working Group | Linaro.org │ Open source software
for ARM SoCs
w) tom.gall att linaro.org
h) tom_gall att mac.com
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 8/8] shader_runner: glsl-es-1.00 add maximums/gl_MaxVertexUniformVectors.shader_test

2013-02-18 Thread Tom Gall
Adds tests/spec/glsl-es-1.00/maximums/
gl_MaxVertexUniformVectors.shader_test, checks built-in
constant gl_MaxVertexUniformVectors

Signed-off-by: Tom Gall 
---
 .../gl_MaxVertexUniformVectors.shader_test |   29 
 1 file changed, 29 insertions(+)
 create mode 100644 
tests/spec/glsl-es-1.00/execution/maximums/gl_MaxVertexUniformVectors.shader_test

diff --git 
a/tests/spec/glsl-es-1.00/execution/maximums/gl_MaxVertexUniformVectors.shader_test
 
b/tests/spec/glsl-es-1.00/execution/maximums/gl_MaxVertexUniformVectors.shader_test
new file mode 100644
index 000..5f8f818
--- /dev/null
+++ 
b/tests/spec/glsl-es-1.00/execution/maximums/gl_MaxVertexUniformVectors.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Tests for GLSL ES 1.00 minimum maximums for the builtin constants.
+#
+# See the GLSL ES 1.0.17 specification, section 7.3, page 61.
+
+[require]
+GLSL ES >= 1.00
+GL ES >= 2.0
+
+[vertex shader]
+attribute vec4 vertex;
+
+void main(void)
+{
+   gl_Position = vertex;
+}
+
+[fragment shader]
+void main(void)
+{
+   if (gl_MaxVertexUniformVectors >= 128)
+   gl_FragColor = vec4(0, 1, 0, 0);
+   else
+   gl_FragColor = vec4(1, 0, 0, 0);
+}
+
+[test]
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 0.0
-- 
1.7.10.4

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


[Piglit] [PATCH 7/8] shader_runner: glsl-es-1.00 add maximums/gl_MaxVertexTextureImageUnits.shader_test

2013-02-18 Thread Tom Gall
Adds tests/spec/glsl-es-1.00/maximums/
gl_MaxVertexTextureImageUnits.shader_test, checks built-in
constant gl_MaxVertexTextureImageUnits.

Signed-off-by: Tom Gall 
---
 .../gl_MaxVertexTextureImageUnits.shader_test  |   29 
 1 file changed, 29 insertions(+)
 create mode 100644 
tests/spec/glsl-es-1.00/execution/maximums/gl_MaxVertexTextureImageUnits.shader_test

diff --git 
a/tests/spec/glsl-es-1.00/execution/maximums/gl_MaxVertexTextureImageUnits.shader_test
 
b/tests/spec/glsl-es-1.00/execution/maximums/gl_MaxVertexTextureImageUnits.shader_test
new file mode 100644
index 000..9fa9320
--- /dev/null
+++ 
b/tests/spec/glsl-es-1.00/execution/maximums/gl_MaxVertexTextureImageUnits.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Tests for GLSL ES 1.00 minimum maximums for the builtin constants.
+#
+# See the GLSL ES 1.0.17 specification, section 7.3, page 61.
+
+[require]
+GLSL ES >= 1.00
+GL ES >= 2.0
+
+[vertex shader]
+attribute vec4 vertex;
+
+void main(void)
+{
+   gl_Position = vertex;
+}
+
+[fragment shader]
+void main(void)
+{
+   if (gl_MaxVertexTextureImageUnits >= 0)
+   gl_FragColor = vec4(0, 1, 0, 0);
+   else
+   gl_FragColor = vec4(1, 0, 0, 0);
+}
+
+[test]
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 0.0
-- 
1.7.10.4

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


[Piglit] [PATCH 6/8] shader_runner: glsl-es-1.00 add maximums/gl_MaxVertexAttribs.shader_test

2013-02-18 Thread Tom Gall
Adds tests/spec/glsl-es-1.00/maximums/gl_MaxVertexAttribs.shader_test
checks built-in constant gl_MaxVertexAttribs.

Signed-off-by: Tom Gall 
---
 .../maximums/gl_MaxVertexAttribs.shader_test   |   29 
 1 file changed, 29 insertions(+)
 create mode 100644 
tests/spec/glsl-es-1.00/execution/maximums/gl_MaxVertexAttribs.shader_test

diff --git 
a/tests/spec/glsl-es-1.00/execution/maximums/gl_MaxVertexAttribs.shader_test 
b/tests/spec/glsl-es-1.00/execution/maximums/gl_MaxVertexAttribs.shader_test
new file mode 100644
index 000..70371a9
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/execution/maximums/gl_MaxVertexAttribs.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Tests for GLSL ES 1.00 minimum maximums for the builtin constants.
+#
+# See the GLSL ES 1.0.17 specification, section 7.3, page 61.
+
+[require]
+GLSL ES >= 1.00
+GL ES >= 2.0
+
+[vertex shader]
+attribute vec4 vertex;
+
+void main(void)
+{
+   gl_Position = vertex;
+}
+
+[fragment shader]
+void main(void)
+{
+   if (gl_MaxVertexAttribs >= 8)
+   gl_FragColor = vec4(0, 1, 0, 0);
+   else
+   gl_FragColor = vec4(1, 0, 0, 0);
+}
+
+[test]
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 0.0
-- 
1.7.10.4

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


[Piglit] [PATCH 5/8] shader_runner: glsl-es-1.00 add maximums/gl_MaxVaryingVectors.shader_test

2013-02-18 Thread Tom Gall
Adds tests/spec/glsl-es-1.00/maximums/gl_MaxVaryingVectors.shader_test
checks built-in constant gl_MaxVaryingVectors.

Signed-off-by: Tom Gall 
---
 .../maximums/gl_MaxVaryingVectors.shader_test  |   29 
 1 file changed, 29 insertions(+)
 create mode 100644 
tests/spec/glsl-es-1.00/execution/maximums/gl_MaxVaryingVectors.shader_test

diff --git 
a/tests/spec/glsl-es-1.00/execution/maximums/gl_MaxVaryingVectors.shader_test 
b/tests/spec/glsl-es-1.00/execution/maximums/gl_MaxVaryingVectors.shader_test
new file mode 100644
index 000..2a4e300
--- /dev/null
+++ 
b/tests/spec/glsl-es-1.00/execution/maximums/gl_MaxVaryingVectors.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Tests for GLSL ES 1.00 minimum maximums for the builtin constants.
+#
+# See the GLSL ES 1.0.17 specification, section 7.3, page 61.
+
+[require]
+GLSL ES >= 1.00
+GL ES >= 2.0
+
+[vertex shader]
+attribute vec4 vertex;
+
+void main(void)
+{
+   gl_Position = vertex;
+}
+
+[fragment shader]
+void main(void)
+{
+   if (gl_MaxVaryingVectors >= 8)
+   gl_FragColor = vec4(0, 1, 0, 0);
+   else
+   gl_FragColor = vec4(1, 0, 0, 0);
+}
+
+[test]
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 0.0
-- 
1.7.10.4

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


[Piglit] [PATCH 4/8] shader_runner: glsl-es-1.00 add maximums/gl_MaxTextureImageUnits.shader_test

2013-02-18 Thread Tom Gall
Adds tests/spec/glsl-es-1.00/maximums/gl_MaxTextureImageUnits.shader_test
checks built-in constant gl_MaxTextureImageUnits

Signed-off-by: Tom Gall 
---
 .../maximums/gl_MaxTextureImageUnits.shader_test   |   29 
 1 file changed, 29 insertions(+)
 create mode 100644 
tests/spec/glsl-es-1.00/execution/maximums/gl_MaxTextureImageUnits.shader_test

diff --git 
a/tests/spec/glsl-es-1.00/execution/maximums/gl_MaxTextureImageUnits.shader_test
 
b/tests/spec/glsl-es-1.00/execution/maximums/gl_MaxTextureImageUnits.shader_test
new file mode 100644
index 000..380ff6a
--- /dev/null
+++ 
b/tests/spec/glsl-es-1.00/execution/maximums/gl_MaxTextureImageUnits.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Tests for GLSL ES 1.00 minimum maximums for the builtin constants.
+#
+# See the GLSL ES 1.0.17 specification, section 7.3, page 61.
+
+[require]
+GLSL ES >= 1.00
+GL ES >= 2.0
+
+[vertex shader]
+attribute vec4 vertex;
+
+void main(void)
+{
+   gl_Position = vertex;
+}
+
+[fragment shader]
+void main(void)
+{
+   if (gl_MaxTextureImageUnits >= 8)
+   gl_FragColor = vec4(0, 1, 0, 0);
+   else
+   gl_FragColor = vec4(1, 0, 0, 0);
+}
+
+[test]
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 0.0
-- 
1.7.10.4

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


[Piglit] [PATCH 3/8] shader_runner: glsl-es-1.00 add maximums/gl_MaxFragmentUniformVectors.shader_test

2013-02-18 Thread Tom Gall
Adds tests/spec/glsl-es-1.00/maximums/
gl_MaxFragmentUniformVectors.shader_test, checks built-in
constant gl_MaxFragmentUniformVectors

Signed-off-by: Tom Gall 
---
 .../gl_MaxFragmentUniformVectors.shader_test   |   29 
 1 file changed, 29 insertions(+)
 create mode 100644 
tests/spec/glsl-es-1.00/execution/maximums/gl_MaxFragmentUniformVectors.shader_test

diff --git 
a/tests/spec/glsl-es-1.00/execution/maximums/gl_MaxFragmentUniformVectors.shader_test
 
b/tests/spec/glsl-es-1.00/execution/maximums/gl_MaxFragmentUniformVectors.shader_test
new file mode 100644
index 000..e19b06a
--- /dev/null
+++ 
b/tests/spec/glsl-es-1.00/execution/maximums/gl_MaxFragmentUniformVectors.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Tests for GLSL ES 1.00 minimum maximums for the builtin constants.
+#
+# See the GLSL ES 1.0.17 specification, section 7.3, page 61.
+
+[require]
+GLSL ES >= 1.00
+GL ES >= 2.0
+
+[vertex shader]
+attribute vec4 vertex;
+
+void main(void)
+{
+   gl_Position = vertex;
+}
+
+[fragment shader]
+void main(void)
+{
+   if (gl_MaxFragmentUniformVectors >= 16)
+   gl_FragColor = vec4(0, 1, 0, 0);
+   else
+   gl_FragColor = vec4(1, 0, 0, 0);
+}
+
+[test]
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 0.0
-- 
1.7.10.4

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


[Piglit] [PATCH 2/8] shader_runner: glsl-es-1.00 add maximums/gl_MaxDrawBuffers.shader_test

2013-02-18 Thread Tom Gall
Adds tests/spec/glsl-es-1.00/maximums/gl_MaxDrawBuffers.shader_test
checks built-in constant gl_MaxDrawBuffers

Signed-off-by: Tom Gall 
---
 .../maximums/gl_MaxDrawBuffers.shader_test |   29 
 1 file changed, 29 insertions(+)
 create mode 100644 
tests/spec/glsl-es-1.00/execution/maximums/gl_MaxDrawBuffers.shader_test

diff --git 
a/tests/spec/glsl-es-1.00/execution/maximums/gl_MaxDrawBuffers.shader_test 
b/tests/spec/glsl-es-1.00/execution/maximums/gl_MaxDrawBuffers.shader_test
new file mode 100644
index 000..7f647bc
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/execution/maximums/gl_MaxDrawBuffers.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Tests for GLSL ES 1.00 minimum maximums for the builtin constants.
+#
+# See the GLSL ES 1.0.17 specification, section 7.3, page 61.
+
+[require]
+GLSL ES >= 1.00
+GL ES >= 2.0
+
+[vertex shader]
+attribute vec4 vertex;
+
+void main(void)
+{
+   gl_Position = vertex;
+}
+
+[fragment shader]
+void main(void)
+{
+   if (gl_MaxDrawBuffers >= 1)
+   gl_FragColor = vec4(0, 1, 0, 0);
+   else
+   gl_FragColor = vec4(1, 0, 0, 0);
+}
+
+[test]
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 0.0
-- 
1.7.10.4

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


[Piglit] [PATCH 1/8] shader_runner: glsl-es-1.00 add maximums/gl_MaxCombinedTextureImageUnits.shader_test

2013-02-18 Thread Tom Gall
Adds tests/spec/glsl-es-1.00/maximums/
gl_MaxCombinedTextureImageUnits.shader_test, checks built-in
constant gl_MaxCombinedTextureImageUnits

Signed-off-by: Tom Gall 
---
 .../gl_MaxCombinedTextureImageUnits.shader_test|   30 
 1 file changed, 30 insertions(+)
 create mode 100644 
tests/spec/glsl-es-1.00/execution/maximums/gl_MaxCombinedTextureImageUnits.shader_test

diff --git 
a/tests/spec/glsl-es-1.00/execution/maximums/gl_MaxCombinedTextureImageUnits.shader_test
 
b/tests/spec/glsl-es-1.00/execution/maximums/gl_MaxCombinedTextureImageUnits.shader_test
new file mode 100644
index 000..bf3e5b8
--- /dev/null
+++ 
b/tests/spec/glsl-es-1.00/execution/maximums/gl_MaxCombinedTextureImageUnits.shader_test
@@ -0,0 +1,30 @@
+# [description]
+# Tests for GLSL ES 1.00 minimum maximums for the builtin constants.
+#
+# See the GLSL ES 1.0.17 specification, section 7.3, page 61
+
+[require]
+GLSL ES >= 1.00
+GL ES >= 2.0
+
+[vertex shader]
+attribute vec4 vertex;
+
+void main(void)
+{
+   gl_Position = vertex;
+}
+
+[fragment shader]
+
+void main(void)
+{
+   if (gl_MaxCombinedTextureImageUnits >= 8)
+   gl_FragColor = vec4(0, 1, 0, 0);
+   else
+   gl_FragColor = vec4(1, 0, 0, 0);
+}
+
+[test]
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 0.0
-- 
1.7.10.4

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


[Piglit] Fwd: [PATCH 1/2] gen_builtin_test.py : add version 100 support

2013-02-18 Thread Tom Gall
This patch series was posted on the 5th.

Could I get a Reviewed-by and/or committed ?

In essence they extend tests/glslparsertest/glsl2/gen_builtin_test.py
to include support for glsl version 100.

Thanks!
Tom

-- Forwarded message --
From: Tom Gall 
Date: Tue, Feb 5, 2013 at 2:59 PM
Subject: [PATCH 1/2] gen_builtin_test.py : add version 100 support
To: piglit@lists.freedesktop.org
Cc: patc...@linaro.org, Tom Gall 


Adds support to emit builtin-functions-100.vert
largely based on the 110 version.
- Don't use gl_Vertex.
- Create misc_parameter_100 which adds cross.

Signed-off-by: Tom Gall 
---
 tests/glslparsertest/glsl2/gen_builtin_test.py |   66 +++-
 1 file changed, 65 insertions(+), 1 deletion(-)



-- 
Regards,
Tom

"Where's the kaboom!? There was supposed to be an earth-shattering
kaboom!" Marvin Martian
Tech Lead, Graphics Working Group | Linaro.org │ Open source software
for ARM SoCs
w) tom.gall att linaro.org
h) tom_gall att mac.com
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 1/1] glslparsertest: On GLES don't require GL_ARB_ES2_compatibility

2013-02-18 Thread Tom Gall
glslparsertest.c has a bug where it assumes that when the
requested glsl version is 1.00 the GL_ARB_ES2_compatibility
extension must be present. For GLES2 this should not be
required. The piglit_is_gles() call
checks the version string from glGetString(GL_VERSION).

Signed-off-by: Tom Gall 
---
 tests/glslparsertest/glslparsertest.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/glslparsertest/glslparsertest.c 
b/tests/glslparsertest/glslparsertest.c
index 1fd75d1..6e638da 100644
--- a/tests/glslparsertest/glslparsertest.c
+++ b/tests/glslparsertest/glslparsertest.c
@@ -385,7 +385,7 @@ piglit_init(int argc, char**argv)
if (glsl_version_string != NULL)
glsl_version = parse_glsl_version(glsl_version_string);
 
-   if (requested_version == 100) {
+   if (requested_version == 100 && !piglit_is_gles()) {
piglit_require_extension("GL_ARB_ES2_compatibility");
} else if (requested_version == 300) {
piglit_require_extension("GL_ARB_ES3_compatibility");
-- 
1.7.10.4

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


[Piglit] [PATCH 1/1] glsl-es-1.00: Move contents of glsl-1.00 to glsl-es-1.00

2013-02-15 Thread Tom Gall
Move contents of glsl-1.00 to the glsl-es-1.00 directory.

Remove a few blank lines at the end of 4 tests so that git is happy.

Last fix up all.tests so that all shader and glslparser tests for
glsl-es-1.00 are listed and referenced in the new directory.

V2: patch squashed and generated with --find-renames

Signed-off-by: Tom Gall 
---
 tests/all.tests |   11 +++
 .../compiler/arithmetic-operators/division-by-zero-01.frag  |1 -
 .../compiler/arithmetic-operators/division-by-zero-02.frag  |1 -
 .../compiler/arithmetic-operators/modulus-00.frag   |1 -
 .../assignment-operators/assign-array-prohibited.frag   |0
 .../assignment-operators/assign-array-prohibited.vert   |0
 .../compiler/assignment-operators/modulus-assign-00.frag|1 -
 .../precision-qualifiers/default-precision-bool-01.frag |0
 .../precision-qualifiers/default-precision-float-01.frag|0
 .../precision-qualifiers/default-precision-int-01.frag  |0
 .../precision-qualifiers/default-precision-sampler.frag |0
 .../precision-qualifiers/default-precision-sampler.vert |0
 .../precision-qualifiers/default-precision-vec-01.frag  |0
 .../compiler/precision-qualifiers/precision-bool-01.frag|0
 .../compiler/precision-qualifiers/precision-bool-02.frag|0
 .../compiler/precision-qualifiers/precision-float-01.frag   |0
 .../compiler/precision-qualifiers/precision-float-02.frag   |0
 .../compiler/precision-qualifiers/precision-float-03.frag   |0
 .../compiler/precision-qualifiers/precision-float-04.frag   |0
 .../precision-qualifiers/precision-fs-highp-01.frag |0
 .../precision-qualifiers/precision-fs-highp-02.frag |0
 .../precision-qualifiers/precision-function-param-01.frag   |0
 .../compiler/precision-qualifiers/precision-global-01.frag  |0
 .../compiler/precision-qualifiers/precision-int-01.frag |0
 .../compiler/precision-qualifiers/precision-int-02.frag |0
 .../compiler/precision-qualifiers/precision-int-03.frag |0
 .../precision-qualifiers/precision-literal-const-01.frag|0
 .../precision-qualifiers/precision-literal-const-02.frag|0
 .../compiler/precision-qualifiers/precision-local-01.frag   |0
 .../compiler/precision-qualifiers/precision-struct-01.frag  |0
 .../compiler/precision-qualifiers/precision-struct-02.frag  |0
 .../precision-qualifiers/precision-vs-highp-01.vert |0
 .../compiler/qualifiers/fn-inout-array-allowed-cstyle.frag  |0
 .../compiler/qualifiers/fn-inout-array-allowed-cstyle.vert  |0
 .../compiler/qualifiers/fn-out-array-allowed-cstyle.frag|0
 .../compiler/qualifiers/fn-out-array-allowed-cstyle.vert|0
 .../storage-qualfiers/static-write-attribute-01.vert|0
 .../storage-qualfiers/static-write-attribute-02.vert|0
 .../compiler/storage-qualfiers/static-write-varying-01.frag |0
 .../compiler/storage-qualfiers/static-write-varying-02.frag |0
 40 files changed, 7 insertions(+), 8 deletions(-)
 rename tests/spec/{glsl-1.00 => 
glsl-es-1.00}/compiler/arithmetic-operators/division-by-zero-01.frag (99%)
 rename tests/spec/{glsl-1.00 => 
glsl-es-1.00}/compiler/arithmetic-operators/division-by-zero-02.frag (99%)
 rename tests/spec/{glsl-1.00 => 
glsl-es-1.00}/compiler/arithmetic-operators/modulus-00.frag (99%)
 rename tests/spec/{glsl-1.00 => 
glsl-es-1.00}/compiler/assignment-operators/assign-array-prohibited.frag (100%)
 rename tests/spec/{glsl-1.00 => 
glsl-es-1.00}/compiler/assignment-operators/assign-array-prohibited.vert (100%)
 rename tests/spec/{glsl-1.00 => 
glsl-es-1.00}/compiler/assignment-operators/modulus-assign-00.frag (99%)
 rename tests/spec/{glsl-1.00 => 
glsl-es-1.00}/compiler/precision-qualifiers/default-precision-bool-01.frag 
(100%)
 rename tests/spec/{glsl-1.00 => 
glsl-es-1.00}/compiler/precision-qualifiers/default-precision-float-01.frag 
(100%)
 rename tests/spec/{glsl-1.00 => 
glsl-es-1.00}/compiler/precision-qualifiers/default-precision-int-01.frag (100%)
 rename tests/spec/{glsl-1.00 => 
glsl-es-1.00}/compiler/precision-qualifiers/default-precision-sampler.frag 
(100%)
 rename tests/spec/{glsl-1.00 => 
glsl-es-1.00}/compiler/precision-qualifiers/default-precision-sampler.vert 
(100%)
 rename tests/spec/{glsl-1.00 => 
glsl-es-1.00}/compiler/precision-qualifiers/default-precision-vec-01.frag (100%)
 rename tests/spec/{glsl-1.00 => 
glsl-es-1.00}/compiler/precision-qualifiers/precision-bool-01.frag (100%)
 rename tests/spec/{glsl-1.00 => 
glsl-es-1.00}/compiler/precision-qualifiers/precision-bool-02.frag (100%)
 rename tests/spec/{glsl-1.00 => 
glsl-es-1.00}/compiler/precision-qualifiers/precision-float-01.frag (100%)
 rename tests/spec/{glsl-1.00 => 
glsl-es-1.00}/compiler/precision-qualifiers/precision-float-02.frag (100%)
 rename tests/spec/{glsl-1.00

[Piglit] [PATCH 5/5] glsl-es-1.00: p5 move glsl-1.00 to glsl-es-1.00

2013-02-14 Thread Tom Gall
Move contents of tests/spec/glsl-1.00/compiler/storage-qualfiers to
tests/spec/glsl-es-1.00/compiler/storage-qualfiers

Signed-off-by: Tom Gall 
---
 .../static-write-attribute-01.vert |   17 -
 .../static-write-attribute-02.vert |   20 
 .../storage-qualfiers/static-write-varying-01.frag |   15 ---
 .../storage-qualfiers/static-write-varying-02.frag |   19 ---
 .../static-write-attribute-01.vert |   17 +
 .../static-write-attribute-02.vert |   20 
 .../storage-qualfiers/static-write-varying-01.frag |   15 +++
 .../storage-qualfiers/static-write-varying-02.frag |   19 +++
 8 files changed, 71 insertions(+), 71 deletions(-)
 delete mode 100644 
tests/spec/glsl-1.00/compiler/storage-qualfiers/static-write-attribute-01.vert
 delete mode 100644 
tests/spec/glsl-1.00/compiler/storage-qualfiers/static-write-attribute-02.vert
 delete mode 100644 
tests/spec/glsl-1.00/compiler/storage-qualfiers/static-write-varying-01.frag
 delete mode 100644 
tests/spec/glsl-1.00/compiler/storage-qualfiers/static-write-varying-02.frag
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/storage-qualfiers/static-write-attribute-01.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/storage-qualfiers/static-write-attribute-02.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/storage-qualfiers/static-write-varying-01.frag
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/storage-qualfiers/static-write-varying-02.frag

diff --git 
a/tests/spec/glsl-1.00/compiler/storage-qualfiers/static-write-attribute-01.vert
 
b/tests/spec/glsl-1.00/compiler/storage-qualfiers/static-write-attribute-01.vert
deleted file mode 100644
index 7547479..000
--- 
a/tests/spec/glsl-1.00/compiler/storage-qualfiers/static-write-attribute-01.vert
+++ /dev/null
@@ -1,17 +0,0 @@
-// [config]
-// expect_result: fail
-// glsl_version: 1.00
-// [end config]
-//
-// From section 4.3.3 of the GLSL 1.00 spec:
-// Attribute variables are read-only as far as the vertex shader is
-// concerned.
-
-#version 100
-
-attribute float x;
-
-float f() {
-   x = 0.0;
-   return x;
-}
diff --git 
a/tests/spec/glsl-1.00/compiler/storage-qualfiers/static-write-attribute-02.vert
 
b/tests/spec/glsl-1.00/compiler/storage-qualfiers/static-write-attribute-02.vert
deleted file mode 100644
index a972d34..000
--- 
a/tests/spec/glsl-1.00/compiler/storage-qualfiers/static-write-attribute-02.vert
+++ /dev/null
@@ -1,20 +0,0 @@
-// [config]
-// expect_result: fail
-// glsl_version: 1.00
-// [end config]
-//
-// From section 4.3.3 of the GLSL 1.00 spec:
-// Attribute variables are read-only as far as the vertex shader is
-// concerned.
-
-#version 100
-
-attribute float x;
-
-void f(out float y) {
-y = 0.0;
-}
-
-void g() {
-f(x);
-}
diff --git 
a/tests/spec/glsl-1.00/compiler/storage-qualfiers/static-write-varying-01.frag 
b/tests/spec/glsl-1.00/compiler/storage-qualfiers/static-write-varying-01.frag
deleted file mode 100644
index f61d29c..000
--- 
a/tests/spec/glsl-1.00/compiler/storage-qualfiers/static-write-varying-01.frag
+++ /dev/null
@@ -1,15 +0,0 @@
-// [config]
-// expect_result: fail
-// glsl_version: 1.00
-// [end config]
-//
-// From section 4.3.5 of the GLSL 1.00 spec:
-// A fragment shader can not write to a varying variable.
-
-#version 100
-
-varying float x;
-
-void g() {
-x = 0.0;
-}
diff --git 
a/tests/spec/glsl-1.00/compiler/storage-qualfiers/static-write-varying-02.frag 
b/tests/spec/glsl-1.00/compiler/storage-qualfiers/static-write-varying-02.frag
deleted file mode 100644
index e5548c5..000
--- 
a/tests/spec/glsl-1.00/compiler/storage-qualfiers/static-write-varying-02.frag
+++ /dev/null
@@ -1,19 +0,0 @@
-// [config]
-// expect_result: fail
-// glsl_version: 1.00
-// [end config]
-//
-// From section 4.3.5 of the GLSL 1.00 spec:
-// A fragment shader can not write to a varying variable.
-
-#version 100
-
-varying float x;
-
-void f(out float y) {
-y = 0.0;
-}
-
-void g() {
-f(x);
-}
diff --git 
a/tests/spec/glsl-es-1.00/compiler/storage-qualfiers/static-write-attribute-01.vert
 
b/tests/spec/glsl-es-1.00/compiler/storage-qualfiers/static-write-attribute-01.vert
new file mode 100644
index 000..7547479
--- /dev/null
+++ 
b/tests/spec/glsl-es-1.00/compiler/storage-qualfiers/static-write-attribute-01.vert
@@ -0,0 +1,17 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.00
+// [end config]
+//
+// From section 4.3.3 of the GLSL 1.00 spec:
+// Attribute variables are read-only as far as the vertex shader is
+// concerned.
+
+#version 100
+
+attribute float x;
+
+float f() {
+   x = 0.0;
+   return x;
+}
diff --git 
a/tests/spec/glsl-es-1.00/compiler/storage-qualfiers/static-write-attribute-02.vert
 
b/tests/spec/glsl-es-1.00/compiler/storage-qualfiers/static-write-attribute

[Piglit] [PATCH 4/5] glsl-es-1.00: p4 move glsl-1.00 to glsl-es-1.00

2013-02-14 Thread Tom Gall
Move contents of tests/spec/glsl-1.00/compiler/qualifiers to
tests/spec/glsl-es-1.00/compiler/qualifiers

Signed-off-by: Tom Gall 
---
 .../qualifiers/fn-inout-array-allowed-cstyle.frag  |   28 ---
 .../qualifiers/fn-inout-array-allowed-cstyle.vert  |   29 
 .../qualifiers/fn-out-array-allowed-cstyle.frag|   28 ---
 .../qualifiers/fn-out-array-allowed-cstyle.vert|   29 
 .../qualifiers/fn-inout-array-allowed-cstyle.frag  |   28 +++
 .../qualifiers/fn-inout-array-allowed-cstyle.vert  |   29 
 .../qualifiers/fn-out-array-allowed-cstyle.frag|   28 +++
 .../qualifiers/fn-out-array-allowed-cstyle.vert|   29 
 8 files changed, 114 insertions(+), 114 deletions(-)
 delete mode 100644 
tests/spec/glsl-1.00/compiler/qualifiers/fn-inout-array-allowed-cstyle.frag
 delete mode 100644 
tests/spec/glsl-1.00/compiler/qualifiers/fn-inout-array-allowed-cstyle.vert
 delete mode 100644 
tests/spec/glsl-1.00/compiler/qualifiers/fn-out-array-allowed-cstyle.frag
 delete mode 100644 
tests/spec/glsl-1.00/compiler/qualifiers/fn-out-array-allowed-cstyle.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/qualifiers/fn-inout-array-allowed-cstyle.frag
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/qualifiers/fn-inout-array-allowed-cstyle.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/qualifiers/fn-out-array-allowed-cstyle.frag
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/qualifiers/fn-out-array-allowed-cstyle.vert

diff --git 
a/tests/spec/glsl-1.00/compiler/qualifiers/fn-inout-array-allowed-cstyle.frag 
b/tests/spec/glsl-1.00/compiler/qualifiers/fn-inout-array-allowed-cstyle.frag
deleted file mode 100644
index 497d275..000
--- 
a/tests/spec/glsl-1.00/compiler/qualifiers/fn-inout-array-allowed-cstyle.frag
+++ /dev/null
@@ -1,28 +0,0 @@
-// [config]
-// expect_result: pass
-// glsl_version: 1.00
-// check_link: true
-// [end config]
-//
-// Check that an array can be used as a function inout parameter in
-// GLSL ES 1.00.
-//
-// In this test, the array is declared using C-style array
-// declaration syntax (float x[2] as opposed to float[2] x).
-//
-// From section 5.8 of the GLSL ES 1.00 spec:
-// Array variables are l-values and may be passed to parameters
-// declared as out or inout. However, they may not be used as the
-// target of an assignment.
-
-#version 100
-
-void f(inout float x[2])
-{
-}
-
-void main()
-{
-  float[2] x;
-  f(x);
-}
diff --git 
a/tests/spec/glsl-1.00/compiler/qualifiers/fn-inout-array-allowed-cstyle.vert 
b/tests/spec/glsl-1.00/compiler/qualifiers/fn-inout-array-allowed-cstyle.vert
deleted file mode 100644
index af7075f..000
--- 
a/tests/spec/glsl-1.00/compiler/qualifiers/fn-inout-array-allowed-cstyle.vert
+++ /dev/null
@@ -1,29 +0,0 @@
-// [config]
-// expect_result: pass
-// glsl_version: 1.00
-// check_link: true
-// [end config]
-//
-// Check that an array can be used as a function inout parameter in
-// GLSL ES 1.00.
-//
-// In this test, the array is declared using C-style array
-// declaration syntax (float x[2] as opposed to float[2] x).
-//
-// From section 5.8 of the GLSL ES 1.00 spec:
-// Array variables are l-values and may be passed to parameters
-// declared as out or inout. However, they may not be used as the
-// target of an assignment.
-
-#version 100
-
-void f(inout float x[2])
-{
-}
-
-void main()
-{
-  float[2] x;
-  f(x);
-  gl_Position = vec4(0.0);
-}
diff --git 
a/tests/spec/glsl-1.00/compiler/qualifiers/fn-out-array-allowed-cstyle.frag 
b/tests/spec/glsl-1.00/compiler/qualifiers/fn-out-array-allowed-cstyle.frag
deleted file mode 100644
index 2dd38ab..000
--- a/tests/spec/glsl-1.00/compiler/qualifiers/fn-out-array-allowed-cstyle.frag
+++ /dev/null
@@ -1,28 +0,0 @@
-// [config]
-// expect_result: pass
-// glsl_version: 1.00
-// check_link: true
-// [end config]
-//
-// Check that an array can be used as a function out parameter in
-// GLSL ES 1.00.
-//
-// In this test, the array is declared using C-style array
-// declaration syntax (float x[2] as opposed to float[2] x).
-//
-// From section 5.8 of the GLSL ES 1.00 spec:
-// Array variables are l-values and may be passed to parameters
-// declared as out or inout. However, they may not be used as the
-// target of an assignment.
-
-#version 100
-
-void f(out float x[2])
-{
-}
-
-void main()
-{
-  float[2] x;
-  f(x);
-}
diff --git 
a/tests/spec/glsl-1.00/compiler/qualifiers/fn-out-array-allowed-cstyle.vert 
b/tests/spec/glsl-1.00/compiler/qualifiers/fn-out-array-allowed-cstyle.vert
deleted file mode 100644
index 2f839ba..000
--- a/tests/spec/glsl-1.00/compiler/qualifiers/fn-out-array-allowed-cstyle.vert
+++ /dev/null
@@ -1,29 +0,0 @@
-// [config]
-// expect_result: pass
-// glsl_version: 1.00
-// check_link: true
-// [end config]
-//
-// Check that an array can be used as a function out

[Piglit] [PATCH 3/5] glsl-es-1.00: p3 move glsl-1.00 to glsl-es-1.00

2013-02-14 Thread Tom Gall
Move contents of tests/spec/glsl-1.00/compiler/precision-qualifiers
to tests/spec/glsl-es-1.00/compiler/precision-qualifiers

Signed-off-by: Tom Gall 
---
 .../default-precision-bool-01.frag |   22 ---
 .../default-precision-float-01.frag|   21 --
 .../default-precision-int-01.frag  |   21 --
 .../default-precision-sampler.frag |   28 ---
 .../default-precision-sampler.vert |   29 
 .../default-precision-vec-01.frag  |   23 
 .../precision-qualifiers/precision-bool-01.frag|   17 
 .../precision-qualifiers/precision-bool-02.frag|   17 
 .../precision-qualifiers/precision-float-01.frag   |   17 
 .../precision-qualifiers/precision-float-02.frag   |   17 
 .../precision-qualifiers/precision-float-03.frag   |   18 
 .../precision-qualifiers/precision-float-04.frag   |   17 
 .../precision-fs-highp-01.frag |   24 
 .../precision-fs-highp-02.frag |   26 --
 .../precision-function-param-01.frag   |   16 ---
 .../precision-qualifiers/precision-global-01.frag  |   19 -
 .../precision-qualifiers/precision-int-01.frag |   17 
 .../precision-qualifiers/precision-int-02.frag |   17 
 .../precision-qualifiers/precision-int-03.frag |   18 
 .../precision-literal-const-01.frag|   16 ---
 .../precision-literal-const-02.frag|   16 ---
 .../precision-qualifiers/precision-local-01.frag   |   17 
 .../precision-qualifiers/precision-struct-01.frag  |   21 --
 .../precision-qualifiers/precision-struct-02.frag  |   21 --
 .../precision-vs-highp-01.vert |   18 
 .../default-precision-bool-01.frag |   22 +++
 .../default-precision-float-01.frag|   21 ++
 .../default-precision-int-01.frag  |   21 ++
 .../default-precision-sampler.frag |   28 +++
 .../default-precision-sampler.vert |   29 
 .../default-precision-vec-01.frag  |   23 
 .../precision-qualifiers/precision-bool-01.frag|   17 
 .../precision-qualifiers/precision-bool-02.frag|   17 
 .../precision-qualifiers/precision-float-01.frag   |   17 
 .../precision-qualifiers/precision-float-02.frag   |   17 
 .../precision-qualifiers/precision-float-03.frag   |   18 
 .../precision-qualifiers/precision-float-04.frag   |   17 
 .../precision-fs-highp-01.frag |   24 
 .../precision-fs-highp-02.frag |   26 ++
 .../precision-function-param-01.frag   |   16 +++
 .../precision-qualifiers/precision-global-01.frag  |   19 +
 .../precision-qualifiers/precision-int-01.frag |   17 
 .../precision-qualifiers/precision-int-02.frag |   17 
 .../precision-qualifiers/precision-int-03.frag |   18 
 .../precision-literal-const-01.frag|   16 +++
 .../precision-literal-const-02.frag|   16 +++
 .../precision-qualifiers/precision-local-01.frag   |   17 
 .../precision-qualifiers/precision-struct-01.frag  |   21 ++
 .../precision-qualifiers/precision-struct-02.frag  |   21 ++
 .../precision-vs-highp-01.vert |   18 
 50 files changed, 493 insertions(+), 493 deletions(-)
 delete mode 100644 
tests/spec/glsl-1.00/compiler/precision-qualifiers/default-precision-bool-01.frag
 delete mode 100644 
tests/spec/glsl-1.00/compiler/precision-qualifiers/default-precision-float-01.frag
 delete mode 100644 
tests/spec/glsl-1.00/compiler/precision-qualifiers/default-precision-int-01.frag
 delete mode 100644 
tests/spec/glsl-1.00/compiler/precision-qualifiers/default-precision-sampler.frag
 delete mode 100644 
tests/spec/glsl-1.00/compiler/precision-qualifiers/default-precision-sampler.vert
 delete mode 100644 
tests/spec/glsl-1.00/compiler/precision-qualifiers/default-precision-vec-01.frag
 delete mode 100644 
tests/spec/glsl-1.00/compiler/precision-qualifiers/precision-bool-01.frag
 delete mode 100644 
tests/spec/glsl-1.00/compiler/precision-qualifiers/precision-bool-02.frag
 delete mode 100644 
tests/spec/glsl-1.00/compiler/precision-qualifiers/precision-float-01.frag
 delete mode 100644 
tests/spec/glsl-1.00/compiler/precision-qualifiers/precision-float-02.frag
 delete mode 100644 
tests/spec/glsl-1.00/compiler/precision-qualifiers/precision-float-03.frag
 delete mode

[Piglit] [PATCH 2/5] glsl-es-1.00: p2 move glsl-1.00 to glsl-es-1.00

2013-02-14 Thread Tom Gall
Move contents of tests/spec/glsl-1.00/compiler/assignment-operators
to tests/spec/glsl-es-1.00/compiler/assignment-operators

Signed-off-by: Tom Gall 
---
 .../assign-array-prohibited.frag   |   19 ---
 .../assign-array-prohibited.vert   |   19 ---
 .../assignment-operators/modulus-assign-00.frag|   20 
 .../assign-array-prohibited.frag   |   19 +++
 .../assign-array-prohibited.vert   |   19 +++
 .../assignment-operators/modulus-assign-00.frag|   20 
 6 files changed, 58 insertions(+), 58 deletions(-)
 delete mode 100644 
tests/spec/glsl-1.00/compiler/assignment-operators/assign-array-prohibited.frag
 delete mode 100644 
tests/spec/glsl-1.00/compiler/assignment-operators/assign-array-prohibited.vert
 delete mode 100644 
tests/spec/glsl-1.00/compiler/assignment-operators/modulus-assign-00.frag
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/assignment-operators/assign-array-prohibited.frag
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/assignment-operators/assign-array-prohibited.vert
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/assignment-operators/modulus-assign-00.frag

diff --git 
a/tests/spec/glsl-1.00/compiler/assignment-operators/assign-array-prohibited.frag
 
b/tests/spec/glsl-1.00/compiler/assignment-operators/assign-array-prohibited.frag
deleted file mode 100644
index d33f053..000
--- 
a/tests/spec/glsl-1.00/compiler/assignment-operators/assign-array-prohibited.frag
+++ /dev/null
@@ -1,19 +0,0 @@
-// [config]
-// expect_result: fail
-// glsl_version: 1.00
-// [end config]
-//
-// Check that assignment to an array is illegal in GLSL ES 1.00.
-//
-// From section 5.8 of the GLSL ES 1.00 spec:
-// Array variables are l-values and may be passed to parameters
-// declared as out or inout. However, they may not be used as the
-// target of an assignment.
-
-#version 100
-
-void f(float x[2])
-{
-  float y[2];
-  y = x;
-}
diff --git 
a/tests/spec/glsl-1.00/compiler/assignment-operators/assign-array-prohibited.vert
 
b/tests/spec/glsl-1.00/compiler/assignment-operators/assign-array-prohibited.vert
deleted file mode 100644
index d33f053..000
--- 
a/tests/spec/glsl-1.00/compiler/assignment-operators/assign-array-prohibited.vert
+++ /dev/null
@@ -1,19 +0,0 @@
-// [config]
-// expect_result: fail
-// glsl_version: 1.00
-// [end config]
-//
-// Check that assignment to an array is illegal in GLSL ES 1.00.
-//
-// From section 5.8 of the GLSL ES 1.00 spec:
-// Array variables are l-values and may be passed to parameters
-// declared as out or inout. However, they may not be used as the
-// target of an assignment.
-
-#version 100
-
-void f(float x[2])
-{
-  float y[2];
-  y = x;
-}
diff --git 
a/tests/spec/glsl-1.00/compiler/assignment-operators/modulus-assign-00.frag 
b/tests/spec/glsl-1.00/compiler/assignment-operators/modulus-assign-00.frag
deleted file mode 100644
index 7b35a9a..000
--- a/tests/spec/glsl-1.00/compiler/assignment-operators/modulus-assign-00.frag
+++ /dev/null
@@ -1,20 +0,0 @@
-// [config]
-// expect_result: fail
-// glsl_version: 1.00
-// [end config]
-//
-// The modulus assignment operator '%=' is reserved.
-//
-// From section 5.8 of the GLSL ES 1.00 spec:
-// The assignments remainder into (%=), left shift by (<<=), right shift
-// by (>>=), inclusive or into ( |=), and exclusive or into ( ^=) are
-// reserved for future use.
-
-#version 100
-
-int
-f() {
-int x = 19;
-x %= 4;
-return x;
-}
diff --git 
a/tests/spec/glsl-es-1.00/compiler/assignment-operators/assign-array-prohibited.frag
 
b/tests/spec/glsl-es-1.00/compiler/assignment-operators/assign-array-prohibited.frag
new file mode 100644
index 000..d33f053
--- /dev/null
+++ 
b/tests/spec/glsl-es-1.00/compiler/assignment-operators/assign-array-prohibited.frag
@@ -0,0 +1,19 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.00
+// [end config]
+//
+// Check that assignment to an array is illegal in GLSL ES 1.00.
+//
+// From section 5.8 of the GLSL ES 1.00 spec:
+// Array variables are l-values and may be passed to parameters
+// declared as out or inout. However, they may not be used as the
+// target of an assignment.
+
+#version 100
+
+void f(float x[2])
+{
+  float y[2];
+  y = x;
+}
diff --git 
a/tests/spec/glsl-es-1.00/compiler/assignment-operators/assign-array-prohibited.vert
 
b/tests/spec/glsl-es-1.00/compiler/assignment-operators/assign-array-prohibited.vert
new file mode 100644
index 000..d33f053
--- /dev/null
+++ 
b/tests/spec/glsl-es-1.00/compiler/assignment-operators/assign-array-prohibited.vert
@@ -0,0 +1,19 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.00
+// [end config]
+//
+// Check that assignment to an array is illegal in GLSL ES 1.00.
+//
+// From section 5.8 of the GLSL ES 1.00 spec:
+//

[Piglit] [PATCH 1/5] glsl-es-1.00: move contents of glsl-1.00 to glsl-es-1.00

2013-02-14 Thread Tom Gall
Change all.tests to reflect new location of glsl-1.00 to
glsl-es-1.00 and add es as part of the group name.

In all.tests, add glsl-es-1.00/execution as a shader test.

Move contents of glsl-1.00/compiler/arithmetic-operators/
to glsl-es-1.00/compiler/arithmetic-operators.

Remove blank line at end of
tests/spec/glsl-1.00/compiler/assignment-operators/modulus-assign-00.frag

v2: switch to glsl-es-1.00 instead of glsl-1.00 based on list
discussion

Signed-off-by: Tom Gall 
---
 tests/all.tests |   12 
 .../arithmetic-operators/division-by-zero-01.frag   |   19 ---
 .../arithmetic-operators/division-by-zero-02.frag   |   19 ---
 .../compiler/arithmetic-operators/modulus-00.frag   |   18 --
 .../assignment-operators/modulus-assign-00.frag |1 -
 .../arithmetic-operators/division-by-zero-01.frag   |   18 ++
 .../arithmetic-operators/division-by-zero-02.frag   |   18 ++
 .../compiler/arithmetic-operators/modulus-00.frag   |   17 +
 8 files changed, 61 insertions(+), 61 deletions(-)
 delete mode 100644 
tests/spec/glsl-1.00/compiler/arithmetic-operators/division-by-zero-01.frag
 delete mode 100644 
tests/spec/glsl-1.00/compiler/arithmetic-operators/division-by-zero-02.frag
 delete mode 100644 
tests/spec/glsl-1.00/compiler/arithmetic-operators/modulus-00.frag
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/arithmetic-operators/division-by-zero-01.frag
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/arithmetic-operators/division-by-zero-02.frag
 create mode 100644 
tests/spec/glsl-es-1.00/compiler/arithmetic-operators/modulus-00.frag

diff --git a/tests/all.tests b/tests/all.tests
index f2229c6..074dd73 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -684,11 +684,15 @@ spec['!OpenGL 3.1'] = gl31
 gl31['genned-names'] = concurrent_test('gl-3.1-genned-names')
 gl31['minmax'] = concurrent_test('gl-3.1-minmax')
 
-# Group spec/glsl-1.00
-spec['glsl-1.00'] = Group()
-import_glsl_parser_tests(spec['glsl-1.00'],
-os.path.join(testsDir, 'spec', 'glsl-1.00'),
+# Group spec/glsl-es-1.00
+spec['glsl-es-1.00'] = Group()
+import_glsl_parser_tests(spec['glsl-es-1.00'],
+os.path.join(testsDir, 'spec', 'glsl-es-1.00'),
 ['compiler'])
+spec['glsl-es-1.00']['execution'] = Group()
+add_shader_test_dir(spec['glsl-es-1.00']['execution'],
+os.path.join(testsDir, 'spec', 'glsl-es-1.00', 
'execution'),
+recursive=True)
 
 # Group spec/glsl-1.10
 spec['glsl-1.10'] = Group()
diff --git 
a/tests/spec/glsl-1.00/compiler/arithmetic-operators/division-by-zero-01.frag 
b/tests/spec/glsl-1.00/compiler/arithmetic-operators/division-by-zero-01.frag
deleted file mode 100644
index a3dda0e..000
--- 
a/tests/spec/glsl-1.00/compiler/arithmetic-operators/division-by-zero-01.frag
+++ /dev/null
@@ -1,19 +0,0 @@
-// [config]
-// expect_result: pass
-// glsl_version: 1.00
-// [end config]
-//
-// Division by zero is legal for floating point values.
-//
-// From section 5.9 of the GLSL ES 1.00 spec:
-// Dividing by zero does not cause an exception but does result in an
-// unspecified value.
-
-#version 100
-
-float
-f() {
-float x = 1.0 / 0.0;
-return x;
-}
-
diff --git 
a/tests/spec/glsl-1.00/compiler/arithmetic-operators/division-by-zero-02.frag 
b/tests/spec/glsl-1.00/compiler/arithmetic-operators/division-by-zero-02.frag
deleted file mode 100644
index a93ed7f..000
--- 
a/tests/spec/glsl-1.00/compiler/arithmetic-operators/division-by-zero-02.frag
+++ /dev/null
@@ -1,19 +0,0 @@
-// [config]
-// expect_result: pass
-// glsl_version: 1.00
-// [end config]
-//
-// Division by zero is legal for integer values.
-//
-// From section 5.9 of the GLSL ES 1.00 spec:
-// Dividing by zero does not cause an exception but does result in an
-// unspecified value.
-
-#version 100
-
-int
-f() {
-int x = 1 / 0;
-return x;
-}
-
diff --git a/tests/spec/glsl-1.00/compiler/arithmetic-operators/modulus-00.frag 
b/tests/spec/glsl-1.00/compiler/arithmetic-operators/modulus-00.frag
deleted file mode 100644
index 8032e7a..000
--- a/tests/spec/glsl-1.00/compiler/arithmetic-operators/modulus-00.frag
+++ /dev/null
@@ -1,18 +0,0 @@
-// [config]
-// expect_result: fail
-// glsl_version: 1.00
-// [end config]
-//
-// The modulus operator '%' is reserved.
-//
-// From section 5.9 of the GLSL ES 1.00 spec:
-// The operator remainder (%) is reserved for future use.
-
-#version 100
-
-int
-f() {
-int tea_time = 15 % 24;
-return tea_time;
-}
-
diff --git 
a/tests/spec/glsl-1.00/compiler/assignment-operators/modulus-assign-

Re: [Piglit] [PATCH 1/1] glsl-1.00: move contents of glsl-es-1.00 to glsl-1.00

2013-02-14 Thread Tom Gall
On Thu, Feb 14, 2013 at 12:31 PM, Eric Anholt  wrote:
> Tom Gall  writes:
>
>> Add glsl-1.00/execution dir to all.tests as a shader test.
>>
>> Move contents of glsl-es-1.00 to glsl-1.00 and remove
>> glsl-es-1.00.
>
> I think we should retain the "ES" in es-specific GLSL directory names.

That would be my preference as well, tho it results in having to move
a lot more files. Adding Paul to the CC: as he had an opinion on this.
I can really see going either way.

--
Regards,
Tom

"Where's the kaboom!? There was supposed to be an earth-shattering
kaboom!" Marvin Martian
Tech Lead, Graphics Working Group | Linaro.org │ Open source software
for ARM SoCs
w) tom.gall att linaro.org
h) tom_gall att mac.com
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 1/1] glsl-1.00: move contents of glsl-es-1.00 to glsl-1.00

2013-02-14 Thread Tom Gall
Add glsl-1.00/execution dir to all.tests as a shader test.

Move contents of glsl-es-1.00 to glsl-1.00 and remove
glsl-es-1.00.

Signed-off-by: Tom Gall 
---
 tests/all.tests|4 ++
 tests/spec/glsl-1.00/execution/sanity.shader_test  |   39 
 .../spec/glsl-es-1.00/execution/sanity.shader_test |   39 
 3 files changed, 43 insertions(+), 39 deletions(-)
 create mode 100644 tests/spec/glsl-1.00/execution/sanity.shader_test
 delete mode 100644 tests/spec/glsl-es-1.00/execution/sanity.shader_test

diff --git a/tests/all.tests b/tests/all.tests
index f2229c6..ed4643b 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -689,6 +689,10 @@ spec['glsl-1.00'] = Group()
 import_glsl_parser_tests(spec['glsl-1.00'],
 os.path.join(testsDir, 'spec', 'glsl-1.00'),
 ['compiler'])
+spec['glsl-1.00']['execution'] = Group()
+add_shader_test_dir(spec['glsl-1.00']['execution'],
+os.path.join(testsDir, 'spec', 'glsl-1.00', 
'execution'),
+recursive=True)
 
 # Group spec/glsl-1.10
 spec['glsl-1.10'] = Group()
diff --git a/tests/spec/glsl-1.00/execution/sanity.shader_test 
b/tests/spec/glsl-1.00/execution/sanity.shader_test
new file mode 100644
index 000..0884e2c
--- /dev/null
+++ b/tests/spec/glsl-1.00/execution/sanity.shader_test
@@ -0,0 +1,39 @@
+# Fill the window with red, then green, then blue.
+
+[require]
+GL ES >= 2.0
+GLSL ES >= 1.00
+
+[vertex shader]
+attribute vec4 vertex;
+
+void main() {
+gl_Position = vertex;
+}
+
+[fragment shader]
+uniform vec4 u_color;
+
+void main() {
+gl_FragColor = u_color;
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0  1.0
+-1.0  1.0
+
+[test]
+uniform vec4 u_color 1.0 0.0 0.0 1.0
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 1.0 0.0 0.0 1.0
+
+uniform vec4 u_color 0.0 1.0 0.0 1.0
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 0.0 1.0
+
+uniform vec4 u_color 0.0 0.0 1.0 1.0
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 0.0 1.0 1.0
diff --git a/tests/spec/glsl-es-1.00/execution/sanity.shader_test 
b/tests/spec/glsl-es-1.00/execution/sanity.shader_test
deleted file mode 100644
index 0884e2c..000
--- a/tests/spec/glsl-es-1.00/execution/sanity.shader_test
+++ /dev/null
@@ -1,39 +0,0 @@
-# Fill the window with red, then green, then blue.
-
-[require]
-GL ES >= 2.0
-GLSL ES >= 1.00
-
-[vertex shader]
-attribute vec4 vertex;
-
-void main() {
-gl_Position = vertex;
-}
-
-[fragment shader]
-uniform vec4 u_color;
-
-void main() {
-gl_FragColor = u_color;
-}
-
-[vertex data]
-vertex/float/2
--1.0 -1.0
- 1.0 -1.0
- 1.0  1.0
--1.0  1.0
-
-[test]
-uniform vec4 u_color 1.0 0.0 0.0 1.0
-draw arrays GL_TRIANGLE_FAN 0 4
-probe all rgba 1.0 0.0 0.0 1.0
-
-uniform vec4 u_color 0.0 1.0 0.0 1.0
-draw arrays GL_TRIANGLE_FAN 0 4
-probe all rgba 0.0 1.0 0.0 1.0
-
-uniform vec4 u_color 0.0 0.0 1.0 1.0
-draw arrays GL_TRIANGLE_FAN 0 4
-probe all rgba 0.0 0.0 1.0 1.0
-- 
1.7.10.4

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


[Piglit] [PATCH 2/2] rm tests/glean/ttexrect.*

2013-02-08 Thread Tom Gall
Remove ttexrect.* from glean as the previous patch ports the test
to piglit.

Remove texRect from all.tests.

Signed-off-by: Tom Gall 
---
 tests/all.tests   |1 -
 tests/glean/CMakeLists.gl.txt |1 -
 tests/glean/ttexrect.cpp  |  215 -
 tests/glean/ttexrect.h|   62 
 4 files changed, 279 deletions(-)
 delete mode 100644 tests/glean/ttexrect.cpp
 delete mode 100644 tests/glean/ttexrect.h

diff --git a/tests/all.tests b/tests/all.tests
index 9b9be9f..479b5b4 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -119,7 +119,6 @@ glean['texCombine'] = GleanTest('texCombine')
 glean['texCube'] = GleanTest('texCube')
 glean['texEnv'] = GleanTest('texEnv')
 glean['texgen'] = GleanTest('texgen')
-glean['texRect'] = GleanTest('texRect')
 glean['texCombine4'] = GleanTest('texCombine4')
 glean['texSwizzle'] = GleanTest('texSwizzle')
 glean['texture_srgb'] = GleanTest('texture_srgb')
diff --git a/tests/glean/CMakeLists.gl.txt b/tests/glean/CMakeLists.gl.txt
index 5e20e55..62b9b4e 100644
--- a/tests/glean/CMakeLists.gl.txt
+++ b/tests/glean/CMakeLists.gl.txt
@@ -57,7 +57,6 @@ piglit_add_executable (glean
ttexcube.cpp
ttexenv.cpp
ttexgen.cpp
-   ttexrect.cpp
ttexswizzle.cpp
ttexture_srgb.cpp
ttexunits.cpp
diff --git a/tests/glean/ttexrect.cpp b/tests/glean/ttexrect.cpp
deleted file mode 100644
index ccc5ba3..000
--- a/tests/glean/ttexrect.cpp
+++ /dev/null
@@ -1,215 +0,0 @@
-// BEGIN_COPYRIGHT -*- glean -*-
-
-/*
- * Copyright © 2006 Intel Corporation
- * Copyright © 1999 Allen Akin
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- *Eric Anholt 
- *
- */
-
-/* ttexrect.cpp:  Test the ARB_texture_rectangle extension
- * Author: Eric Anholt 
- *
- * Test procedure:
- *   Create a 255x127 texture of varying colors and bind it as a
- *   GL_ARB_texture_recangle target.  Draw that rectangle to the window, and
- *   check that the texture was drawn correctly.  The common failure to be
- *   caught with this test is not adjusting the non-normalized coordinates on
- *   hardware that expects normalized coordinates.
- */
-
-#include "ttexrect.h"
-#include 
-#include 
-#include 
-
-namespace GLEAN {
-
-/**
- * Test if two colors are close enough to be considered the same.
- */
-bool
-TexRectTest::TestColor(const GLfloat c1[3], const GLfloat c2[3])
-{
-   if (fabs(c1[0] - c2[0]) <= mTolerance[0] &&
-   fabs(c1[1] - c2[1]) <= mTolerance[1] &&
-   fabs(c1[2] - c2[2]) <= mTolerance[2])
-   return true;
-   else
-   return false;
-}
-
-void
-TexRectTest::CalculateTolerance()
-{
-   GLint rBits, gBits, bBits;
-   GLint rTexBits, gTexBits, bTexBits;
-
-   // Get fb resolution
-   glGetIntegerv(GL_RED_BITS, &rBits);
-   glGetIntegerv(GL_GREEN_BITS, &gBits);
-   glGetIntegerv(GL_BLUE_BITS, &bBits);
-
-   // Get tex resolution
-   glGetTexLevelParameteriv(GL_TEXTURE_RECTANGLE_ARB,
-0, GL_TEXTURE_RED_SIZE, &rTexBits);
-   glGetTexLevelParameteriv(GL_TEXTURE_RECTANGLE_ARB,
-0, GL_TEXTURE_GREEN_SIZE, &gTexBits);
-   glGetTexLevelParameteriv(GL_TEXTURE_RECTANGLE_ARB,
-0, GL_TEXTURE_BLUE_SIZE, &bTexBits);
-
-   // Find smaller of frame buffer and texture bits
-   rBits = (rBits < rTexBits) ? rBits : rTexBits;
-   gBits = (gBits < gTexBits) ? gBits : gTexBits;
-   bBits = (bBits < bTexBits) ? bBits : bTexBits;
-
-   // If these fail, something's seriously wrong.
-   assert(r

[Piglit] [PATCH 1/2] port ttexrect.cpp to piglit from glean

2013-02-08 Thread Tom Gall
This ported test goes into tests/spec/arb_texture_rectangle. It
tests the ARB_texture_rectangle extension.

Create a 255x127 texture of varying colors and bind it as a
GL_ARB_texture_recangle target.  Draw that rectangle to the window, and
check that the texture was drawn correctly.  The common failure to be
caught with this test is not adjusting the non-normalized coordinates on
hardware that expects normalized coordinates.

To all.tests, add new texrect_simple_arb_texrect

v2: add PIGLIT_GL_VISUAL_DOUBLE to the window_visual, move various
setup bits to piglit_init and add forgotten all.tests change.
v3: use piglit_present_results, and piglit_probe_image_rgb
v4: use piglit_draw_rect_tex, piglit_ortho_projection and minor
clean ups.

Signed-off-by: Tom Gall 
---
 tests/all.tests|1 +
 tests/spec/CMakeLists.txt  |1 +
 tests/spec/arb_texture_rectangle/CMakeLists.gl.txt |   13 +++
 tests/spec/arb_texture_rectangle/CMakeLists.txt|1 +
 tests/spec/arb_texture_rectangle/texrect-simple.c  |  104 
 5 files changed, 120 insertions(+)
 create mode 100644 tests/spec/arb_texture_rectangle/CMakeLists.gl.txt
 create mode 100644 tests/spec/arb_texture_rectangle/CMakeLists.txt
 create mode 100644 tests/spec/arb_texture_rectangle/texrect-simple.c

diff --git a/tests/all.tests b/tests/all.tests
index 3e2d3f8..9b9be9f 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -1128,6 +1128,7 @@ arb_texture_rectangle['copyteximage RECT'] = 
PlainExecTest(['copyteximage', '-au
 add_concurrent_test(arb_texture_rectangle, '1-1-linear-texture')
 add_plain_test(arb_texture_rectangle, 'texrect-many')
 add_concurrent_test(arb_texture_rectangle, 'getteximage-targets RECT')
+add_plain_test(arb_texture_rectangle, 'texrect_simple_arb_texrect')
 
 arb_texture_storage = Group()
 spec['ARB_texture_storage'] = arb_texture_storage
diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index df87181..1b72040 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -24,6 +24,7 @@ add_subdirectory (arb_texture_buffer_object)
 add_subdirectory (arb_texture_compression)
 add_subdirectory (arb_texture_cube_map_array)
 add_subdirectory (arb_texture_float)
+add_subdirectory (arb_texture_rectangle)
 add_subdirectory (arb_texture_storage)
 add_subdirectory (arb_timer_query)
 add_subdirectory (arb_transform_feedback2)
diff --git a/tests/spec/arb_texture_rectangle/CMakeLists.gl.txt 
b/tests/spec/arb_texture_rectangle/CMakeLists.gl.txt
new file mode 100644
index 000..d84a850
--- /dev/null
+++ b/tests/spec/arb_texture_rectangle/CMakeLists.gl.txt
@@ -0,0 +1,13 @@
+include_directories(
+   ${GLEXT_INCLUDE_DIR}
+   ${OPENGL_INCLUDE_PATH}
+   ${piglit_SOURCE_DIR}/tests/mesa/util
+)
+
+link_libraries (
+   piglitutil_${piglit_target_api}
+   ${OPENGL_gl_LIBRARY}
+   ${OPENGL_glu_LIBRARY}
+)
+
+piglit_add_executable (texrect_simple_arb_texrect texrect-simple.c)
diff --git a/tests/spec/arb_texture_rectangle/CMakeLists.txt 
b/tests/spec/arb_texture_rectangle/CMakeLists.txt
new file mode 100644
index 000..144a306
--- /dev/null
+++ b/tests/spec/arb_texture_rectangle/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git a/tests/spec/arb_texture_rectangle/texrect-simple.c 
b/tests/spec/arb_texture_rectangle/texrect-simple.c
new file mode 100644
index 000..4512ee4
--- /dev/null
+++ b/tests/spec/arb_texture_rectangle/texrect-simple.c
@@ -0,0 +1,104 @@
+/* Copyright © 2013 Linaro Inc
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/**
+ * Ported from glean ttexrect.cpp into piglit.
+ * Test the ARB_texture_rectangle extension
+ *   Create a 255x127 texture of varying colors and bind it as a
+ *   GL_ARB_texture_recangle target.  Draw that rec

[Piglit] [PATCH 2/2] rm tests/glean/ttexrect.*

2013-02-07 Thread Tom Gall
Remove ttexrect.* from glean as the previous patch ports the test
to piglit.

Remove texRect from all.tests.

Signed-off-by: Tom Gall 
---
 tests/all.tests   |1 -
 tests/glean/CMakeLists.gl.txt |1 -
 tests/glean/ttexrect.cpp  |  215 -
 tests/glean/ttexrect.h|   62 
 4 files changed, 279 deletions(-)
 delete mode 100644 tests/glean/ttexrect.cpp
 delete mode 100644 tests/glean/ttexrect.h

diff --git a/tests/all.tests b/tests/all.tests
index 9b9be9f..479b5b4 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -119,7 +119,6 @@ glean['texCombine'] = GleanTest('texCombine')
 glean['texCube'] = GleanTest('texCube')
 glean['texEnv'] = GleanTest('texEnv')
 glean['texgen'] = GleanTest('texgen')
-glean['texRect'] = GleanTest('texRect')
 glean['texCombine4'] = GleanTest('texCombine4')
 glean['texSwizzle'] = GleanTest('texSwizzle')
 glean['texture_srgb'] = GleanTest('texture_srgb')
diff --git a/tests/glean/CMakeLists.gl.txt b/tests/glean/CMakeLists.gl.txt
index 5e20e55..62b9b4e 100644
--- a/tests/glean/CMakeLists.gl.txt
+++ b/tests/glean/CMakeLists.gl.txt
@@ -57,7 +57,6 @@ piglit_add_executable (glean
ttexcube.cpp
ttexenv.cpp
ttexgen.cpp
-   ttexrect.cpp
ttexswizzle.cpp
ttexture_srgb.cpp
ttexunits.cpp
diff --git a/tests/glean/ttexrect.cpp b/tests/glean/ttexrect.cpp
deleted file mode 100644
index ccc5ba3..000
--- a/tests/glean/ttexrect.cpp
+++ /dev/null
@@ -1,215 +0,0 @@
-// BEGIN_COPYRIGHT -*- glean -*-
-
-/*
- * Copyright © 2006 Intel Corporation
- * Copyright © 1999 Allen Akin
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- *Eric Anholt 
- *
- */
-
-/* ttexrect.cpp:  Test the ARB_texture_rectangle extension
- * Author: Eric Anholt 
- *
- * Test procedure:
- *   Create a 255x127 texture of varying colors and bind it as a
- *   GL_ARB_texture_recangle target.  Draw that rectangle to the window, and
- *   check that the texture was drawn correctly.  The common failure to be
- *   caught with this test is not adjusting the non-normalized coordinates on
- *   hardware that expects normalized coordinates.
- */
-
-#include "ttexrect.h"
-#include 
-#include 
-#include 
-
-namespace GLEAN {
-
-/**
- * Test if two colors are close enough to be considered the same.
- */
-bool
-TexRectTest::TestColor(const GLfloat c1[3], const GLfloat c2[3])
-{
-   if (fabs(c1[0] - c2[0]) <= mTolerance[0] &&
-   fabs(c1[1] - c2[1]) <= mTolerance[1] &&
-   fabs(c1[2] - c2[2]) <= mTolerance[2])
-   return true;
-   else
-   return false;
-}
-
-void
-TexRectTest::CalculateTolerance()
-{
-   GLint rBits, gBits, bBits;
-   GLint rTexBits, gTexBits, bTexBits;
-
-   // Get fb resolution
-   glGetIntegerv(GL_RED_BITS, &rBits);
-   glGetIntegerv(GL_GREEN_BITS, &gBits);
-   glGetIntegerv(GL_BLUE_BITS, &bBits);
-
-   // Get tex resolution
-   glGetTexLevelParameteriv(GL_TEXTURE_RECTANGLE_ARB,
-0, GL_TEXTURE_RED_SIZE, &rTexBits);
-   glGetTexLevelParameteriv(GL_TEXTURE_RECTANGLE_ARB,
-0, GL_TEXTURE_GREEN_SIZE, &gTexBits);
-   glGetTexLevelParameteriv(GL_TEXTURE_RECTANGLE_ARB,
-0, GL_TEXTURE_BLUE_SIZE, &bTexBits);
-
-   // Find smaller of frame buffer and texture bits
-   rBits = (rBits < rTexBits) ? rBits : rTexBits;
-   gBits = (gBits < gTexBits) ? gBits : gTexBits;
-   bBits = (bBits < bTexBits) ? bBits : bTexBits;
-
-   // If these fail, something's seriously wrong.
-   assert(r

[Piglit] [PATCH 1/2] port ttexrect.cpp to piglit from glean

2013-02-07 Thread Tom Gall
This ported test goes into tests/spec/arb_texture_rectangle. It
tests the ARB_texture_rectangle extension.

Create a 255x127 texture of varying colors and bind it as a
GL_ARB_texture_recangle target.  Draw that rectangle to the window, and
check that the texture was drawn correctly.  The common failure to be
caught with this test is not adjusting the non-normalized coordinates on
hardware that expects normalized coordinates.

To all.tests, add new texrect_simple_arb_texrect

v2: add PIGLIT_GL_VISUAL_DOUBLE to the window_visual, move various
setup bits to piglit_init and add forgotten all.tests change.
v3: use piglit_present_results, and piglit_probe_image_rgb

Signed-off-by: Tom Gall 
---
 tests/all.tests|1 +
 tests/spec/CMakeLists.txt  |1 +
 tests/spec/arb_texture_rectangle/CMakeLists.gl.txt |   13 ++
 tests/spec/arb_texture_rectangle/CMakeLists.txt|1 +
 tests/spec/arb_texture_rectangle/texrect-simple.c  |  127 
 5 files changed, 143 insertions(+)
 create mode 100644 tests/spec/arb_texture_rectangle/CMakeLists.gl.txt
 create mode 100644 tests/spec/arb_texture_rectangle/CMakeLists.txt
 create mode 100644 tests/spec/arb_texture_rectangle/texrect-simple.c

diff --git a/tests/all.tests b/tests/all.tests
index 3e2d3f8..9b9be9f 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -1128,6 +1128,7 @@ arb_texture_rectangle['copyteximage RECT'] = 
PlainExecTest(['copyteximage', '-au
 add_concurrent_test(arb_texture_rectangle, '1-1-linear-texture')
 add_plain_test(arb_texture_rectangle, 'texrect-many')
 add_concurrent_test(arb_texture_rectangle, 'getteximage-targets RECT')
+add_plain_test(arb_texture_rectangle, 'texrect_simple_arb_texrect')
 
 arb_texture_storage = Group()
 spec['ARB_texture_storage'] = arb_texture_storage
diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index df87181..1b72040 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -24,6 +24,7 @@ add_subdirectory (arb_texture_buffer_object)
 add_subdirectory (arb_texture_compression)
 add_subdirectory (arb_texture_cube_map_array)
 add_subdirectory (arb_texture_float)
+add_subdirectory (arb_texture_rectangle)
 add_subdirectory (arb_texture_storage)
 add_subdirectory (arb_timer_query)
 add_subdirectory (arb_transform_feedback2)
diff --git a/tests/spec/arb_texture_rectangle/CMakeLists.gl.txt 
b/tests/spec/arb_texture_rectangle/CMakeLists.gl.txt
new file mode 100644
index 000..d84a850
--- /dev/null
+++ b/tests/spec/arb_texture_rectangle/CMakeLists.gl.txt
@@ -0,0 +1,13 @@
+include_directories(
+   ${GLEXT_INCLUDE_DIR}
+   ${OPENGL_INCLUDE_PATH}
+   ${piglit_SOURCE_DIR}/tests/mesa/util
+)
+
+link_libraries (
+   piglitutil_${piglit_target_api}
+   ${OPENGL_gl_LIBRARY}
+   ${OPENGL_glu_LIBRARY}
+)
+
+piglit_add_executable (texrect_simple_arb_texrect texrect-simple.c)
diff --git a/tests/spec/arb_texture_rectangle/CMakeLists.txt 
b/tests/spec/arb_texture_rectangle/CMakeLists.txt
new file mode 100644
index 000..144a306
--- /dev/null
+++ b/tests/spec/arb_texture_rectangle/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git a/tests/spec/arb_texture_rectangle/texrect-simple.c 
b/tests/spec/arb_texture_rectangle/texrect-simple.c
new file mode 100644
index 000..1b6d66b
--- /dev/null
+++ b/tests/spec/arb_texture_rectangle/texrect-simple.c
@@ -0,0 +1,127 @@
+/* Copyright © 2013 Linaro Inc
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/**
+ * Ported from glean ttexrect.cpp into piglit.
+ * Test the ARB_texture_rectangle extension
+ *   Create a 255x127 texture of varying colors and bind it as a
+ *   GL_ARB_texture_recangle target.  Draw that rectangle to the window, and
+ *   check that the texture was drawn corre

Re: [Piglit] Fwd: [PATCH 1/2] port ttexrect.cpp to piglit from glean

2013-02-07 Thread Tom Gall
Hi Brian,

It has your reviewed by.

Ideally I was looking for it to be committed unless of course there's
something egregious about it that we both missed.

On Thu, Feb 7, 2013 at 9:04 AM, Brian Paul  wrote:
> LGTM.  Are you asking for another review or do you need someone to
> commit/push it for you?
>
> -Brian
>
>
> On 02/06/2013 03:38 PM, Tom Gall wrote:
>>
>> It was a little over two weeks ago when v2 of these 2 patches to port
>> ttexrect to piglit and remove it from glean were posted.
>>
>> It has a Reviewed-by: Brian Paul
>>
>> Any reason why this shouldn't go in?
>>
>> Thanks.
>>
>> -- Forwarded message --
>> From: Brian Paul
>> Date: Mon, Jan 21, 2013 at 4:46 PM
>> Subject: Re: [Piglit] [PATCH 1/2] port ttexrect.cpp to piglit from glean
>> To: Tom Gall
>> Cc: piglit@lists.freedesktop.org, patc...@linaro.org
>>
>>
>> On 01/21/2013 01:43 PM, Tom Gall wrote:
>>>
>>>
>>> This ported test goes into tests/spec/arb_texture_rectangle. It
>>> tests the ARB_texture_rectangle extension.
>>>
>>> Create a 255x127 texture of varying colors and bind it as a
>>> GL_ARB_texture_recangle target.  Draw that rectangle to the window, and
>>> check that the texture was drawn correctly.  The common failure to be
>>> caught with this test is not adjusting the non-normalized coordinates on
>>> hardware that expects normalized coordinates.
>>>
>>> To all.tests, add new texrect_simple_arb_texrect
>>>
>>> v2: add PIGLIT_GL_VISUAL_DOUBLE to the window_visual, move various
>>> setup bits to piglit_init and add forgotten all.tests change.
>>>
>>> Signed-off-by: Tom Gall
>>
>>
>>
>> For both:
>> Reviewed-by: Brian Paul
>>
>>
>> --
>> Regards,
>> Tom
>>
>> "Where's the kaboom!? There was supposed to be an earth-shattering
>> kaboom!" Marvin Martian
>> Tech Lead, Graphics Working Group | Linaro.org │ Open source software
>> for ARM SoCs
>> w) tom.gall att linaro.org
>> h) tom_gall att mac.com
>> ___
>> Piglit mailing list
>> Piglit@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/piglit
>
>



--
Regards,
Tom

"Where's the kaboom!? There was supposed to be an earth-shattering
kaboom!" Marvin Martian
Tech Lead, Graphics Working Group | Linaro.org │ Open source software
for ARM SoCs
w) tom.gall att linaro.org
h) tom_gall att mac.com
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] Fwd: [PATCH 1/2] port ttexrect.cpp to piglit from glean

2013-02-06 Thread Tom Gall
It was a little over two weeks ago when v2 of these 2 patches to port
ttexrect to piglit and remove it from glean were posted.

It has a Reviewed-by: Brian Paul 

Any reason why this shouldn't go in?

Thanks.

-- Forwarded message --
From: Brian Paul 
Date: Mon, Jan 21, 2013 at 4:46 PM
Subject: Re: [Piglit] [PATCH 1/2] port ttexrect.cpp to piglit from glean
To: Tom Gall 
Cc: piglit@lists.freedesktop.org, patc...@linaro.org


On 01/21/2013 01:43 PM, Tom Gall wrote:
>
> This ported test goes into tests/spec/arb_texture_rectangle. It
> tests the ARB_texture_rectangle extension.
>
> Create a 255x127 texture of varying colors and bind it as a
> GL_ARB_texture_recangle target.  Draw that rectangle to the window, and
> check that the texture was drawn correctly.  The common failure to be
> caught with this test is not adjusting the non-normalized coordinates on
> hardware that expects normalized coordinates.
>
> To all.tests, add new texrect_simple_arb_texrect
>
> v2: add PIGLIT_GL_VISUAL_DOUBLE to the window_visual, move various
> setup bits to piglit_init and add forgotten all.tests change.
>
> Signed-off-by: Tom Gall


For both:
Reviewed-by: Brian Paul 


--
Regards,
Tom

"Where's the kaboom!? There was supposed to be an earth-shattering
kaboom!" Marvin Martian
Tech Lead, Graphics Working Group | Linaro.org │ Open source software
for ARM SoCs
w) tom.gall att linaro.org
h) tom_gall att mac.com
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 0/7] RFC: Add Android Support via Android.mk

2013-02-05 Thread Tom Gall
On Tue, Feb 5, 2013 at 3:32 PM, Chad Versace
 wrote:
> On 02/02/2013 07:33 AM, Tom Gall wrote:
>> On Sat, Feb 2, 2013 at 12:02 AM, Eric Anholt  wrote:
>>> Tom Gall  writes:
>>>
>>>> This patch series builds piglit within the Android source tree. It's
>>>> still a bit of a work in progress but the build succeeds and the tests
>>>> that are built do pass.
>>>>
>>>> The 3rd patch is entirely written by Adrian M Negreanu and really is
>>>> the heart of the Android implementation for piglit as it adds the
>>>> framework support without which nothing would work.
>>>>
>>>> If anything these patches that create the various Android.mk files are
>>>> but the strings that hold together Adrian's bouquet. They allow for
>>>> piglit to build as part of an Android image build which is quite handy
>>>> for validation farms and such.
>>>>
>>>> While this patch series uses multiple Android.mk files, one could
>>>> implement all of this is one large Android.mk at the top level
>>>> directory.
>>>
>>> Instead of cooking up a brand new build system that will always be
>>> terribly maintained, it looks like there are a number of
>>> cmake-for-android projects out there.  Have you exhausted all of those
>>> as possibilities for sure?
>>
>> I entirely understand your concern. I understand that having two build
>> systems around can be viewed as being less than ideal. I did not take
>> this step lightly nor was it a thought influenced by appreciation of
>> one build system over the other.
>>
>> Consider:
>>
>> Within AOSP the projects that utilize cmake don't use it for Android,
>> rather they use the Android build system. llvm, libpng, sysbench,
>> jpeg, clang, libbcc as a for instance.
>>
>> Waffle uses the Android build system.
>>
>> Mesa uses the Android build system.
>>
>> Those coming from the world of Android when contributing know the
>> Android build system so there is a talent pool. Likewise when working
>> with Android, you have to know the Android build system.
>>
>> When building piglit (&waffle) for Android, one will always have to be
>> in the presence of the whole android setup with certain portions of
>> that source tree already built in order for it to work.
>>
>> I (or one of my team) can/will happily maintain this. Piglit is very
>> important to us long term on both Android and Linux.
>
>
> I'm afraid that if we have truly separate build systems for Piglit, then
> one build will frequently be broken. Very frequently. It's a maintenance 
> burden
> that I would like to avoid.

Thing is. Regardless of cmake or Android.mk, it's going to take those
interested in Android to keep an eye on Android anyway. It's like
GLES. I seem to be one of the few people that notices changes which
are problematic there.

> I'm hoping that there exists a solution that adds only a toplevel Android.mk
> to Piglit, and the Android.mk simply invokes CMake and then calls make. I
> expect that, using Adrian's patches from Nov 16, it is possible to do this.
> Adrian's patches add the necessary cmake files to inform cmake how to use
> the Android toolchain; all that is lacking is the toplevel Android.mk that
> calls into cmake.

Well Adrian's patches were able to build, they weren't creating
non-intel Android binaries. I do need to pull a fresh set. I know he's
made changes last I gave those a whirl.

Can these two worlds be knitted together? Anything is possible. The
puzzle is how to get cmake to not only use the android toolchain, but
also how to get it correctly interpret the env that lunch puts
together as well as correctly install. All of that is certainly
solvable. It just seems that it is likely to be quite the hack and
it's the maintaining of that hack that worries me. Given the choice of
a set of Android.mks that the Android types use or a hack that only we
piglit types grok is not a fun choice but we must have consensus.

Toward that end I am willing to work together on a prototype
Android.mk - cmake bridge between what Adrian has done and what I've
done just to give us all a reference point. Who knows perhaps it'll be
perfectly acceptable to all, or at least serve as a data point.

Don't suppose between Adrian, Chad, Eric, myself and others
interested, that some of this merry band might be at ELC here in a
couple weeks? This might be a good mini-bof over beverages.

> Maybe I'm hoping for something that's impossible. And if it's impossible
> we should figure out a way to make it un-impossible.

Nothing is impossible. It's all 1s and 0s.

--
Regards,
Tom

"Where's the kaboom!? There was supposed to be an earth-shattering
kaboom!" Marvin Martian
Tech Lead, Graphics Working Group | Linaro.org │ Open source software
for ARM SoCs
w) tom.gall att linaro.org
h) tom_gall att mac.com
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] Fwd: [PATCH 1/1] glsl: add explicit version 100 support

2013-02-05 Thread Tom Gall
Nearly two weeks since this was posted. Any reason this shouldn't go it?

Thanks!

-- Forwarded message --
From: Tom Gall 
Date: Wed, Jan 23, 2013 at 2:48 PM
Subject: [PATCH 1/1] glsl: add explicit version 100 support
To: piglit@lists.freedesktop.org
Cc: patc...@linaro.org, Tom Gall 


This is a small change to add explicit support for glsl
version 100 which is used by OpenGL ES 2. This allows for
100 to be passed on the command line.

In glslparsertest.c add 100 to the list of versions processed
by the switch. Also when version 100 is used, check for gles
and if running as gles don't require the
GL_ARB_ES2_compatibility extension.

In CMakeList.gles2.txt remove ${OPENGL_gles2_LIBRARY} as it's
not needed.

v2: detach patch from proposed python change.

Signed-off-by: Tom Gall 
---
 tests/glslparsertest/CMakeLists.gles2.txt |5 +
 tests/glslparsertest/glslparsertest.c |6 +-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/tests/glslparsertest/CMakeLists.gles2.txt
b/tests/glslparsertest/CMakeLists.gles2.txt
index 1e37bed..5b437f8 100644
--- a/tests/glslparsertest/CMakeLists.gles2.txt
+++ b/tests/glslparsertest/CMakeLists.gles2.txt
@@ -1,10 +1,7 @@
 link_libraries(
piglitutil_${piglit_target_api}
-   ${OPENGL_gles2_LIBRARY}
)

-piglit_add_executable(glslparsertest_${piglit_target_api}
-   glslparsertest.c
-   )
+piglit_add_executable(glslparsertest_${piglit_target_api} glslparsertest.c)

 # vim: ft=cmake:
diff --git a/tests/glslparsertest/glslparsertest.c
b/tests/glslparsertest/glslparsertest.c
index ff32da7..c91a56b 100644
--- a/tests/glslparsertest/glslparsertest.c
+++ b/tests/glslparsertest/glslparsertest.c
@@ -43,6 +43,10 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
const unsigned int int_version = parse_glsl_version(argv[3]);

switch (int_version) {
+   case 100:
+   config.supports_gl_compat_version = 10;
+   config.supports_gl_es_version = 20;
+   break;
case 110:
case 120:
case 130:
@@ -351,7 +355,7 @@ piglit_init(int argc, char**argv)
if (glsl_version_string != NULL)
glsl_version = parse_glsl_version(glsl_version_string);

-   if (requested_version == 100) {
+   if (!piglit_is_gles() && requested_version == 100) {
piglit_require_extension("GL_ARB_ES2_compatibility");
} else if (requested_version == 300) {
piglit_require_extension("GL_ARB_ES3_compatibility");
--
1.7.10.4



-- 
Regards,
Tom

"Where's the kaboom!? There was supposed to be an earth-shattering
kaboom!" Marvin Martian
Tech Lead, Graphics Working Group | Linaro.org │ Open source software
for ARM SoCs
w) tom.gall att linaro.org
h) tom_gall att mac.com
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 2/2] glsl2: add builtin-functions-100.vert

2013-02-05 Thread Tom Gall
Adds new output of gen_builtin_test.py creating
builtin-fuctions-100.vert.

Signed-off-by: Tom Gall 
---
 .../glsl2/builtin-functions-100.vert   |  266 
 1 file changed, 266 insertions(+)
 create mode 100644 tests/glslparsertest/glsl2/builtin-functions-100.vert

diff --git a/tests/glslparsertest/glsl2/builtin-functions-100.vert 
b/tests/glslparsertest/glsl2/builtin-functions-100.vert
new file mode 100644
index 000..94b5966
--- /dev/null
+++ b/tests/glslparsertest/glsl2/builtin-functions-100.vert
@@ -0,0 +1,266 @@
+/* PASS */
+#version 100
+
+uniform float u_float;
+uniform vec2 u_vec2;
+uniform vec3 u_vec3;
+uniform vec4 u_vec4;
+uniform ivec2 u_ivec2;
+uniform ivec3 u_ivec3;
+uniform ivec4 u_ivec4;
+uniform bvec2 u_bvec2;
+uniform bvec3 u_bvec3;
+uniform bvec4 u_bvec4;
+uniform mat2 u_mat2;
+uniform mat3 u_mat3;
+uniform mat4 u_mat4;
+
+void main()
+{
+  gl_Position = vec4(0.0);
+
+  float t_float = float(0.0);
+  bool t_bool = false;
+  vec2  t_vec2  = vec2 (0.0);
+  bvec2 t_bvec2 = bvec2(0.0);
+  mat2  t_mat2  = mat2 (0.0);
+  vec3  t_vec3  = vec3 (0.0);
+  bvec3 t_bvec3 = bvec3(0.0);
+  mat3  t_mat3  = mat3 (0.0);
+  vec4  t_vec4  = vec4 (0.0);
+  bvec4 t_bvec4 = bvec4(0.0);
+  mat4  t_mat4  = mat4 (0.0);
+
+  t_float += radians(u_float);
+  t_vec2 += radians(u_vec2);
+  t_vec3 += radians(u_vec3);
+  t_vec4 += radians(u_vec4);
+  t_float += degrees(u_float);
+  t_vec2 += degrees(u_vec2);
+  t_vec3 += degrees(u_vec3);
+  t_vec4 += degrees(u_vec4);
+  t_float += sin(u_float);
+  t_vec2 += sin(u_vec2);
+  t_vec3 += sin(u_vec3);
+  t_vec4 += sin(u_vec4);
+  t_float += cos(u_float);
+  t_vec2 += cos(u_vec2);
+  t_vec3 += cos(u_vec3);
+  t_vec4 += cos(u_vec4);
+  t_float += tan(u_float);
+  t_vec2 += tan(u_vec2);
+  t_vec3 += tan(u_vec3);
+  t_vec4 += tan(u_vec4);
+  t_float += asin(u_float);
+  t_vec2 += asin(u_vec2);
+  t_vec3 += asin(u_vec3);
+  t_vec4 += asin(u_vec4);
+  t_float += acos(u_float);
+  t_vec2 += acos(u_vec2);
+  t_vec3 += acos(u_vec3);
+  t_vec4 += acos(u_vec4);
+  t_float += atan(u_float);
+  t_vec2 += atan(u_vec2);
+  t_vec3 += atan(u_vec3);
+  t_vec4 += atan(u_vec4);
+  t_float += exp(u_float);
+  t_vec2 += exp(u_vec2);
+  t_vec3 += exp(u_vec3);
+  t_vec4 += exp(u_vec4);
+  t_float += log(u_float);
+  t_vec2 += log(u_vec2);
+  t_vec3 += log(u_vec3);
+  t_vec4 += log(u_vec4);
+  t_float += exp2(u_float);
+  t_vec2 += exp2(u_vec2);
+  t_vec3 += exp2(u_vec3);
+  t_vec4 += exp2(u_vec4);
+  t_float += log2(u_float);
+  t_vec2 += log2(u_vec2);
+  t_vec3 += log2(u_vec3);
+  t_vec4 += log2(u_vec4);
+  t_float += sqrt(u_float);
+  t_vec2 += sqrt(u_vec2);
+  t_vec3 += sqrt(u_vec3);
+  t_vec4 += sqrt(u_vec4);
+  t_float += inversesqrt(u_float);
+  t_vec2 += inversesqrt(u_vec2);
+  t_vec3 += inversesqrt(u_vec3);
+  t_vec4 += inversesqrt(u_vec4);
+  t_float += abs(u_float);
+  t_vec2 += abs(u_vec2);
+  t_vec3 += abs(u_vec3);
+  t_vec4 += abs(u_vec4);
+  t_float += sign(u_float);
+  t_vec2 += sign(u_vec2);
+  t_vec3 += sign(u_vec3);
+  t_vec4 += sign(u_vec4);
+  t_float += floor(u_float);
+  t_vec2 += floor(u_vec2);
+  t_vec3 += floor(u_vec3);
+  t_vec4 += floor(u_vec4);
+  t_float += ceil(u_float);
+  t_vec2 += ceil(u_vec2);
+  t_vec3 += ceil(u_vec3);
+  t_vec4 += ceil(u_vec4);
+  t_float += fract(u_float);
+  t_vec2 += fract(u_vec2);
+  t_vec3 += fract(u_vec3);
+  t_vec4 += fract(u_vec4);
+  t_float += length(u_float);
+  t_vec2 += length(u_vec2);
+  t_vec3 += length(u_vec3);
+  t_vec4 += length(u_vec4);
+  t_float += normalize(u_float);
+  t_vec2 += normalize(u_vec2);
+  t_vec3 += normalize(u_vec3);
+  t_vec4 += normalize(u_vec4);
+
+  t_float += atan(u_float, -u_float);
+  t_vec2 += atan(u_vec2, -u_vec2);
+  t_vec3 += atan(u_vec3, -u_vec3);
+  t_vec4 += atan(u_vec4, -u_vec4);
+  t_float += pow(u_float, -u_float);
+  t_vec2 += pow(u_vec2, -u_vec2);
+  t_vec3 += pow(u_vec3, -u_vec3);
+  t_vec4 += pow(u_vec4, -u_vec4);
+  t_float += mod(u_float, -u_float);
+  t_vec2 += mod(u_vec2, -u_vec2);
+  t_vec3 += mod(u_vec3, -u_vec3);
+  t_vec4 += mod(u_vec4, -u_vec4);
+  t_float += min(u_float, -u_float);
+  t_vec2 += min(u_vec2, -u_vec2);
+  t_vec3 += min(u_vec3, -u_vec3);
+  t_vec4 += min(u_vec4, -u_vec4);
+  t_float += max(u_float, -u_float);
+  t_vec2 += max(u_vec2, -u_vec2);
+  t_vec3 += max(u_vec3, -u_vec3);
+  t_vec4 += max(u_vec4, -u_vec4);
+  t_float += step(u_float, -u_float);
+  t_vec2 += step(u_vec2, -u_vec2);
+  t_vec3 += step(u_vec3, -u_vec3);
+  t_vec4 += step(u_vec4, -u_vec4);
+  t_float += distance(u_float, -u_float);
+  t_vec2 += distance(u_vec2, -u_vec2);
+  t_vec3 += distance(u_vec3, -u_vec3);
+  t_vec4 += distance(u_vec4, -u_vec4);
+  t_float += dot(u_float, -u_float);
+  t_vec2 += dot(u_vec2, -u_vec2);
+  t_vec3 += dot(u_vec3, -u_vec3);
+  t_vec4 += dot(u_vec4, -u_vec4);
+  t_float += reflect(u_float, -u_float);
+  t_vec2 += reflect(u_vec2, -u_vec2);
+  t_vec3 += reflect(u_vec3, -u_vec3);
+  t_vec4 += reflect(u_vec4, -u_vec4);
+
+  t_float += clamp

[Piglit] [PATCH 1/2] gen_builtin_test.py : add version 100 support

2013-02-05 Thread Tom Gall
Adds support to emit builtin-functions-100.vert
largely based on the 110 version.
- Don't use gl_Vertex.
- Create misc_parameter_100 which adds cross.

Signed-off-by: Tom Gall 
---
 tests/glslparsertest/glsl2/gen_builtin_test.py |   66 +++-
 1 file changed, 65 insertions(+), 1 deletion(-)

diff --git a/tests/glslparsertest/glsl2/gen_builtin_test.py 
b/tests/glslparsertest/glsl2/gen_builtin_test.py
index e1e05e3..a4ca72f 100755
--- a/tests/glslparsertest/glsl2/gen_builtin_test.py
+++ b/tests/glslparsertest/glsl2/gen_builtin_test.py
@@ -1,5 +1,17 @@
 #!/usr/bin/env python
 
+misc_parameter_100 = [
+[ "genType", "mod", "genType", "float" ],
+[ "genType", "min", "genType", "float" ],
+[ "genType", "max", "genType", "float" ],
+[ "genType", "clamp", "genType", "float", "float" ],
+[ "genType", "mix", "genType", "genType", "float" ],
+[ "genType", "step", "float", "genType" ],
+[ "genType", "smoothstep", "float", "float", "genType" ],
+[ "genType", "refract", "genType", "genType", "float" ],
+[ "vec3", "cross", "vec3", "vec3" ],
+]
+
 one_parameter_110 = [
 "radians",
 "degrees",
@@ -117,6 +129,55 @@ def emit_matrixCompMult(f, matTypes):
 f.write("  t_%s = matrixCompMult(u_%s, u_%s);\n" % (mat, mat, mat))
 
 
+def emit_100_tests(f):
+f.write("/* PASS */\n#version 100\n\n")
+f.write("uniform float u_float;\n")
+
+for s in ["vec", "ivec", "bvec", "mat"]:
+for i in [2, 3, 4]:
+f.write("uniform %s%d u_%s%d;\n" % (s, i, s, i))
+
+f.write("""\nvoid main()
+{
+  gl_Position = vec4(0.0);
+
+  float t_float = float(0.0);
+  bool t_bool = false;\n""")
+
+for i in [2, 3, 4]:
+f.write("  vec%d  t_vec%d  = vec%d (0.0);\n" % (i, i, i))
+f.write("  bvec%d t_bvec%d = bvec%d(0.0);\n" % (i, i, i))
+f.write("  mat%d  t_mat%d  = mat%d (0.0);\n" % (i, i, i))
+
+f.write("\n")
+
+for name in one_parameter_110:
+for t in genType:
+f.write("  t_%s += %s(u_%s);\n" % (t, name, t))
+
+f.write("\n")
+
+for name in two_parameter_110:
+for t in genType:
+f.write("  t_%s += %s(u_%s, -u_%s);\n" % (t, name, t, t))
+
+f.write("\n")
+
+for name in three_parameter_110:
+for t in genType:
+f.write("  t_%s += %s(u_%s, -u_%s, 11.7 * u_%s);\n" %
+(t, name, t, t, t))
+
+f.write("\n")
+
+emit_pattern_call(f, misc_parameter_100, genType)
+emit_pattern_call(f, vec_parameter_110, vecType)
+emit_pattern_call(f, bvec_parameter_110, bvecType)
+emit_matrixCompMult(f, ["mat2", "mat3", "mat4"])
+
+f.write("}\n")
+
+
 def emit_110_tests(f):
 f.write("/* PASS */\n#version 110\n\n")
 f.write("uniform float u_float;\n")
@@ -248,6 +309,10 @@ def emit_120_tests(f):
 f.write("}\n")
 
 
+f = open("builtin-functions-100.vert", "w")
+emit_100_tests(f)
+f.close()
+
 f = open("builtin-functions-110.vert", "w")
 emit_110_tests(f)
 f.close()
@@ -259,4 +324,3 @@ f.close()
 f = open("builtin-functions-120.vert", "w")
 emit_120_tests(f)
 f.close()
-
-- 
1.7.10.4

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


Re: [Piglit] [PATCH 0/7] RFC: Add Android Support via Android.mk

2013-02-02 Thread Tom Gall
On Sat, Feb 2, 2013 at 12:02 AM, Eric Anholt  wrote:
> Tom Gall  writes:
>
>> This patch series builds piglit within the Android source tree. It's
>> still a bit of a work in progress but the build succeeds and the tests
>> that are built do pass.
>>
>> The 3rd patch is entirely written by Adrian M Negreanu and really is
>> the heart of the Android implementation for piglit as it adds the
>> framework support without which nothing would work.
>>
>> If anything these patches that create the various Android.mk files are
>> but the strings that hold together Adrian's bouquet. They allow for
>> piglit to build as part of an Android image build which is quite handy
>> for validation farms and such.
>>
>> While this patch series uses multiple Android.mk files, one could
>> implement all of this is one large Android.mk at the top level
>> directory.
>
> Instead of cooking up a brand new build system that will always be
> terribly maintained, it looks like there are a number of
> cmake-for-android projects out there.  Have you exhausted all of those
> as possibilities for sure?

I entirely understand your concern. I understand that having two build
systems around can be viewed as being less than ideal. I did not take
this step lightly nor was it a thought influenced by appreciation of
one build system over the other.

Consider:

Within AOSP the projects that utilize cmake don't use it for Android,
rather they use the Android build system. llvm, libpng, sysbench,
jpeg, clang, libbcc as a for instance.

Waffle uses the Android build system.

Mesa uses the Android build system.

Those coming from the world of Android when contributing know the
Android build system so there is a talent pool. Likewise when working
with Android, you have to know the Android build system.

When building piglit (&waffle) for Android, one will always have to be
in the presence of the whole android setup with certain portions of
that source tree already built in order for it to work.

I (or one of my team) can/will happily maintain this. Piglit is very
important to us long term on both Android and Linux.

--
Regards,
Tom

"Where's the kaboom!? There was supposed to be an earth-shattering
kaboom!" Marvin Martian
Tech Lead, Graphics Working Group | Linaro.org │ Open source software
for ARM SoCs
w) tom.gall att linaro.org
h) tom_gall att mac.com
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 7/7] Android: Add Android.mk to build invalid-es3-queries & minmax

2013-02-01 Thread Tom Gall
Adds Android.mk to build invalid-es3-queries & minmax. Test
binaries are installed into /system/xbin/piglit/

Signed-off-by: Tom Gall 
---
 tests/spec/gles-2.0/Android.mk |   31 +++
 1 file changed, 31 insertions(+)
 create mode 100644 tests/spec/gles-2.0/Android.mk

diff --git a/tests/spec/gles-2.0/Android.mk b/tests/spec/gles-2.0/Android.mk
new file mode 100644
index 000..62137b4
--- /dev/null
+++ b/tests/spec/gles-2.0/Android.mk
@@ -0,0 +1,31 @@
+include $(call all-subdir-makefiles)
+
+LOCAL_PATH:= $(call my-dir)
+
+piglit_shared_libs := libGLESv2 libwaffle-1 libpiglitutil_gles2
+piglit_c_includes := $(piglit_top)/tests/util \
+   bionic \
+   $(piglit_top)/src \
+   external/waffle/include/waffle \
+   external/mesa3d/include \
+
+piglit_c_flags := -DPIGLIT_USE_WAFFLE -DPIGLIT_USE_OPENGL_ES2 
-DPIGLIT_HAS_ANDROID
+
+module_name = piglit-spec-gles2
+
+define $(module_name)_etc_add_executable
+include $(CLEAR_VARS)
+LOCAL_SHARED_LIBRARIES := $(piglit_shared_libs)
+LOCAL_C_INCLUDES := $(piglit_c_includes)
+LOCAL_CFLAGS := $(piglit_c_flags)
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_CLASS := tests
+LOCAL_MODULE := $1_gles2
+systemtarball: $1_gles2
+LOCAL_SRC_FILES := $1.c
+LOCAL_MODULE_PATH := 
$(TARGET_OUT_OPTIONAL_EXECUTABLES)/piglit/$(module_name)
+include $(BUILD_EXECUTABLE)
+endef
+
+test_names := invalid-es3-queries minmax
+$(foreach item,$(test_names),$(eval $(call $(module_name)_etc_add_executable, 
$(item
-- 
1.7.10.4

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


[Piglit] [PATCH 6/7] Android: add glsl es 1.00 sanity.shader_test to /data

2013-02-01 Thread Tom Gall
Adds Android.mk to copy the glsl es 1.00 shader test
sanity.shader_test to /data/shader-data/execution/

Signed-off-by: Tom Gall 
---
 tests/spec/Android.mk|3 +++
 tests/spec/glsl-es-1.00/Android.mk   |3 +++
 tests/spec/glsl-es-1.00/execution/Android.mk |   10 ++
 3 files changed, 16 insertions(+)
 create mode 100644 tests/spec/Android.mk
 create mode 100644 tests/spec/glsl-es-1.00/Android.mk
 create mode 100644 tests/spec/glsl-es-1.00/execution/Android.mk

diff --git a/tests/spec/Android.mk b/tests/spec/Android.mk
new file mode 100644
index 000..c455f97
--- /dev/null
+++ b/tests/spec/Android.mk
@@ -0,0 +1,3 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(call all-subdir-makefiles)
diff --git a/tests/spec/glsl-es-1.00/Android.mk 
b/tests/spec/glsl-es-1.00/Android.mk
new file mode 100644
index 000..c455f97
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/Android.mk
@@ -0,0 +1,3 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(call all-subdir-makefiles)
diff --git a/tests/spec/glsl-es-1.00/execution/Android.mk 
b/tests/spec/glsl-es-1.00/execution/Android.mk
new file mode 100644
index 000..b2f9a1f
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/execution/Android.mk
@@ -0,0 +1,10 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE:= sanity.shader_test
+LOCAL_MODULE_TAGS := eng
+LOCAL_MODULE_CLASS := data
+LOCAL_MODULE_PATH:=$(TARGET_OUT_DATA)/shader-data/execution
+LOCAL_SRC_FILES := sanity.shader_test
+userdatatarball: $(LOCAL_MODULE)
+include $(BUILD_PREBUILT)
-- 
1.7.10.4

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


[Piglit] [PATCH 5/7] Android: build shader_runner with Android.mk

2013-02-01 Thread Tom Gall
Adds Android.mk to build shader_runner.

Signed-off-by: Tom Gall 
---
 tests/shaders/Android.mk |   33 +
 1 file changed, 33 insertions(+)
 create mode 100644 tests/shaders/Android.mk

diff --git a/tests/shaders/Android.mk b/tests/shaders/Android.mk
new file mode 100644
index 000..5e81e3a
--- /dev/null
+++ b/tests/shaders/Android.mk
@@ -0,0 +1,33 @@
+include $(call all-subdir-makefiles)
+
+LOCAL_PATH:= $(call my-dir)
+
+piglit_shared_libs := libGLESv2 \
+  libwaffle-1 \
+ libpiglitutil_gles2 \
+
+piglit_c_includes := $(piglit_top)/tests/util \
+   bionic \
+   $(piglit_top)/src \
+   external/waffle/include/waffle \
+   external/mesa3d/include \
+
+piglit_c_flags := -DPIGLIT_USE_WAFFLE -DPIGLIT_USE_OPENGL_ES2 
-DPIGLIT_HAS_ANDROID
+
+module_name = piglit-shader-test
+
+define $(module_name)_etc_add_executable
+include $(CLEAR_VARS)
+LOCAL_SHARED_LIBRARIES := $(piglit_shared_libs)
+LOCAL_C_INCLUDES := $(piglit_c_includes)
+LOCAL_CFLAGS := $(piglit_c_flags)
+LOCAL_MODULE_TAGS := eng
+LOCAL_MODULE := $1_gles2
+systemtarball: $1_gles2
+LOCAL_SRC_FILES := $1.c
+LOCAL_MODULE_PATH := 
$(TARGET_OUT_OPTIONAL_EXECUTABLES)/piglit/$(module_name)
+include $(BUILD_EXECUTABLE)
+endef
+
+test_names := shader_runner
+$(foreach item,$(test_names),$(eval $(call $(module_name)_etc_add_executable, 
$(item
-- 
1.7.10.4

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


[Piglit] [PATCH 4/7] Android: Build libpiglitutil_gles2 in Android.mk

2013-02-01 Thread Tom Gall
Adds Android.mk to build libpiglitutil_gles2 as well as
autogenerate config.h, and generated_dispatch.ch

Signed-off-by: Tom Gall 
---
 tests/util/Android.mk |   98 +
 1 file changed, 98 insertions(+)
 create mode 100644 tests/util/Android.mk

diff --git a/tests/util/Android.mk b/tests/util/Android.mk
new file mode 100644
index 000..488325a
--- /dev/null
+++ b/tests/util/Android.mk
@@ -0,0 +1,98 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+# piglit_top := $(LOCAL_PATH)/../..
+
+piglit_major_version := 1
+piglit_minor_version := 0
+piglit_patch_version := 0
+
+LOCAL_MODULE := libpiglitutil_gles2
+LOCAL_MODULE_TAG := eng
+
+LOCAL_CFLAGS := -DPIGLIT_USE_WAFFLE \
+   -DPIGLIT_USE_OPENGL_ES2 \
+   -DPIGLIT_HAS_ANDROID \
+   -DSOURCE_DIR='"piglit";' \
+
+LOCAL_C_INCLUDES := . \
+   external/stlport/stlport \
+   bionic \
+   $(piglit_top)/src \
+   $(piglit_top)/tests/util \
+   external/waffle/include/waffle \
+
+$(pigit_top)/tests/util/generated_dispatch.h: \
+ $(piglit_top)/Android.mk \
+ $(LOCAL_PATH)/config.h.in
+   @echo "target  Generated dispatch tables"
+   python $(piglit_top)/glapi/parse_glspec.py $(piglit_top)/glapi/gl.tm 
$(piglit_top)/glapi/gl.spec $(piglit_top)/glapi/enumext.spec 
$(piglit_top)/glapi/glapi.json
+   python $(LOCAL_PATH)/gen_dispatch.py $(piglit_top)/glapi/glapi.json 
$(LOCAL_PATH)/generated_dispatch.c $(LOCAL_PATH)/generated_dispatch.h
+   @sed -e 's/#cmakedefine HAVE_STRCHRNUL/#define HAVE_STRCHRNUL/' \
+ -e 's/#cmakedefine HAVE_FOPEN_S//' \
+ -e 's/#cmakedefine HAVE_SETRLIMIT/#define HAVE_SETRLIMIT/' \
+ -e 's/#cmakedefine HAVE_FCNTL_H/#define HAVE_FCNTL_H/' \
+ -e 's/#cmakedefine HAVE_SYS_STAT_H/#define HAVE_SYS_STAT_H/' \
+ -e 's/#cmakedefine HAVE_SYS_TYPES_H/#define HAVE_SYS_TYPES_H/' \
+ -e 's/#cmakedefine HAVE_SYS_TIME_H/#define HAVE_TIME_H/' \
+ -e 's/#cmakedefine HAVE_SYS_RESOURCE_H/#define HAVE_SYS_RESOURCE_H/' \
+ -e 's/#cmakedefine HAVE_UNISTD_H/#define HAVE_UNISTD_H/' \
+  $(LOCAL_PATH)/config.h.in \
+ > $(LOCAL_PATH)/config.h
+
+LOCAL_SRC_FILES := \
+   piglit-vbo.cpp \
+piglit-shader.c \
+piglit-shader-gles2.c \
+piglit-util-gl-enum.c \
+piglit-util-gles.c \
+minmax-test.c \
+piglit-util.c \
+fdo-bitmap.c \
+piglit-util-gl-common.c \
+   piglit-framework-gl/piglit_gl_framework.c \
+   piglit-framework-gl.c \
+   piglit_ktx.c \
+   rgb9e5.c \
+   piglit-framework-gl/piglit_android_framework.c \
+   piglit-framework-gl/piglit_gbm_framework.c \
+   piglit-framework-gl/piglit_fbo_framework.c \
+   piglit-framework-gl/piglit_wfl_framework.c \
+   piglit-framework-gl/piglit_winsys_framework.c \
+   piglit-framework-gl/piglit_wl_framework.c \
+   piglit-util-waffle.c \
+
+LOCAL_SHARED_LIBRARIES := \
+   libGLESv2 \
+   libwaffle-1 \
+   libstdc++ \
+   libstlport \
+
+LOCAL_COPY_HEADERS := \
+   glxew.h \
+   piglit-framework-gl.h \
+   piglit-util-egl.h \
+   minmax-test.h \
+   piglit-glx-util.h \
+   piglit-util-gl-common.h \
+   piglit-dispatch.h \
+   piglit_ktx.h \
+   piglit-util.h \
+   piglit-framework-cl-api.h \
+   piglit-shader.h \
+   piglit-util-waffle.h \
+   piglit-framework-cl-custom.h \
+   piglit-util-cl-enum.h \
+   piglit-vbo.h \
+   piglit-framework-cl.h \
+   piglit-util-cl.h \
+   rgb9e5.h \
+   piglit-framework-cl-program.h \
+   piglit-util-compressed-grays.h \
+   sized-internalformats.h \
+   generated_dispatch.h \
+
+LOCAL_COPY_HEADERS_TO := piglit-$(piglit_major_version)
+
+include $(BUILD_SHARED_LIBRARY)
-- 
1.7.10.4

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


[Piglit] [PATCH 3/7] Android: Add Adrian M Negreanu's initial android support

2013-02-01 Thread Tom Gall
This are Adrian M Negreanu's changes for piglit to support Android.
These are included in this patch series for the purposes of completeness.

Signed-off-by: Tom Gall 
---
 .../piglit-framework-gl/piglit_android_framework.c |   86 
 .../piglit-framework-gl/piglit_android_framework.h |   29 +++
 .../piglit-framework-gl/piglit_wfl_framework.c |   11 +++
 .../piglit-framework-gl/piglit_winsys_framework.c  |5 ++
 4 files changed, 131 insertions(+)
 create mode 100644 tests/util/piglit-framework-gl/piglit_android_framework.c
 create mode 100644 tests/util/piglit-framework-gl/piglit_android_framework.h

diff --git a/tests/util/piglit-framework-gl/piglit_android_framework.c 
b/tests/util/piglit-framework-gl/piglit_android_framework.c
new file mode 100644
index 000..e05bf1f
--- /dev/null
+++ b/tests/util/piglit-framework-gl/piglit_android_framework.c
@@ -0,0 +1,86 @@
+/*
+ * Copyright © 2012 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include 
+#include 
+#include 
+
+#include "piglit-util-gl-common.h"
+#include "piglit_android_framework.h"
+
+static void
+enter_event_loop(struct piglit_winsys_framework *winsys_fw)
+{
+   const struct piglit_gl_test_config *test_config = 
winsys_fw->wfl_fw.gl_fw.test_config;
+
+   /* FINISHME: Write event loop for Android.
+*
+* Until we have proper Android support, give the user enough time
+* to view the window by sleeping.
+*/
+   sleep(8);
+}
+
+static void
+show_window(struct piglit_winsys_framework *winsys_fw)
+{
+   waffle_window_show(winsys_fw->wfl_fw.window);
+}
+
+static void
+destroy(struct piglit_gl_framework *gl_fw)
+{
+   struct piglit_winsys_framework *winsys_fw= 
piglit_winsys_framework(gl_fw);
+
+   if (winsys_fw == NULL)
+   return;
+
+   piglit_winsys_framework_teardown(winsys_fw);
+   free(winsys_fw);
+}
+
+struct piglit_gl_framework*
+piglit_android_framework_create(const struct piglit_gl_test_config 
*test_config)
+{
+   struct piglit_winsys_framework *winsys_fw = NULL;
+   struct piglit_gl_framework *gl_fw = NULL;
+   bool ok = true;
+
+   winsys_fw = calloc(1, sizeof(*winsys_fw));
+   gl_fw = &winsys_fw->wfl_fw.gl_fw;
+
+   ok = piglit_winsys_framework_init(winsys_fw, test_config,
+  WAFFLE_PLATFORM_ANDROID);
+   if (!ok)
+   goto fail;
+
+   winsys_fw->show_window = show_window;
+   winsys_fw->enter_event_loop = enter_event_loop;
+   gl_fw->destroy = destroy;
+
+   return gl_fw;
+
+fail:
+   destroy(gl_fw);
+   return NULL;
+}
diff --git a/tests/util/piglit-framework-gl/piglit_android_framework.h 
b/tests/util/piglit-framework-gl/piglit_android_framework.h
new file mode 100644
index 000..d7faf0c
--- /dev/null
+++ b/tests/util/piglit-framework-gl/piglit_android_framework.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright © 2012 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN 

[Piglit] [PATCH 2/7] Android: add tests/Android.mk

2013-02-01 Thread Tom Gall

Signed-off-by: Tom Gall 
---
 tests/Android.mk |3 +++
 1 file changed, 3 insertions(+)
 create mode 100644 tests/Android.mk

diff --git a/tests/Android.mk b/tests/Android.mk
new file mode 100644
index 000..c455f97
--- /dev/null
+++ b/tests/Android.mk
@@ -0,0 +1,3 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(call all-subdir-makefiles)
-- 
1.7.10.4

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


[Piglit] [PATCH 1/7] Android: add top level Android.mk

2013-02-01 Thread Tom Gall
Add top of the tree Android.mk, sets piglit_top

Signed-off-by: Tom Gall 
---
 Android.mk |5 +
 1 file changed, 5 insertions(+)
 create mode 100644 Android.mk

diff --git a/Android.mk b/Android.mk
new file mode 100644
index 000..8276ed9
--- /dev/null
+++ b/Android.mk
@@ -0,0 +1,5 @@
+LOCAL_PATH := $(call my-dir)
+
+piglit_top := $(LOCAL_PATH)
+
+include $(call all-subdir-makefiles)
-- 
1.7.10.4

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


[Piglit] [PATCH 0/7] RFC: Add Android Support via Android.mk

2013-02-01 Thread Tom Gall
This patch series builds piglit within the Android source tree. It's
still a bit of a work in progress but the build succeeds and the tests
that are built do pass.

The 3rd patch is entirely written by Adrian M Negreanu and really is
the heart of the Android implementation for piglit as it adds the
framework support without which nothing would work.

If anything these patches that create the various Android.mk files are
but the strings that hold together Adrian's bouquet. They allow for
piglit to build as part of an Android image build which is quite handy
for validation farms and such.

While this patch series uses multiple Android.mk files, one could
implement all of this is one large Android.mk at the top level
directory.

Instructions:
With these patches applied (and my just posted shader_runner compile
fix patches). If you like you can grab my git tree at:
git://git.linaro.org/people/tomgall/piglit.git (use the android
branch)

From your AOSP source tree:

cp -r waffle path/to/AOSP/external/waffle
cp -r piglit  path/to/AOSP/external/piglit

. build/envsetup.sh
lunch
make

Test and test data will result in the built image.

If you want to build just piglit,  after waffle is built you can

. build/envsetup.sh
lunch
cd external/piglit
mm TARGET_PRODUCT=

(To build waffle and just waffle, same instructions apply)

Before running on Android, make sure to issue the following command before hand.

export PIGLIT_PLATFORM="android"

This also available via my git tree located at:



--
Regards,
Tom

"Where's the kaboom!? There was supposed to be an earth-shattering
kaboom!" Marvin Martian
Tech Lead, Graphics Working Group | Linaro.org │ Open source software
for ARM SoCs
w) tom.gall att linaro.org
h) tom_gall att mac.com
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 2/2] android: add strchrnul to shader_runner.c

2013-02-01 Thread Tom Gall
strchrnul is used in shader_runner.c (and no where else in all
of piglit). Unfortunately bionic, Android's c library does not
include this function. I've writen an implementation of
strchrnul which is only used when compiling for Android.

Signed-off-by: Tom Gall 
---
 tests/shaders/shader_runner.c |   20 
 1 file changed, 20 insertions(+)

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index 20f1ee0..fab7296 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -38,6 +38,26 @@
 
 #include "shader_runner_gles_workarounds.h"
 
+#if defined(__ANDROID__)
+/* on Android there is no strchrnul which is used in this test, so we must fill
+ * in an implementation.
+ *
+ * The strchrnul() function is like strchr() except that if c is not found in 
s, then
+ * it returns a pointer to the null byte at the end of s, rather than NULL
+ */
+char *
+strchrnul(const char *s, int c)
+{
+   char * result = strchr(s, c);
+
+   if (result == NULL) {
+   result = s + strlen(s);
+   }
+
+   return result;
+}
+#endif /* __ANDROID__ */
+
 static void
 get_required_versions(const char *script_name,
  struct piglit_gl_test_config *config);
-- 
1.7.10.4

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


[Piglit] [PATCH 1/2] android: file compile errors w shader_runner.c

2013-02-01 Thread Tom Gall
On Android -Werror=return-type is set for C code, as such there
are two cases were I've added a return 0 after an assert.

Signed-off-by: Tom Gall 
---
 tests/shaders/shader_runner.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index d83228e..20f1ee0 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -351,6 +351,7 @@ compare(float ref, float value, enum comparison cmp)
}
 
assert(!"Should not get here.");
+   return 0;
 }
 
 
@@ -370,6 +371,7 @@ comparison_string(enum comparison cmp)
}
 
assert(!"Should not get here.");
+   return 0;
 }
 
 
-- 
1.7.10.4

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


Re: [Piglit] [PATCH 3/3] Make shader_runner require [require] and GLSL version requirement.

2013-01-31 Thread Tom Gall
There's one thing that kinda bothers me about this patch. A good
number of these tests are quite reusable between glsl and glsl es for
instance.

I've gone through a bit of work already to get ~400 to work for glsl
es with the goal of getting these back into piglit in some form. So
the question is, do I aim for commonality or should we just be
resigned that glsl and glsl es shader tests will be separate due to
the the require section can't specify both and if glsl es is
specified, gl es has to be specified too?

If there is consensus that shader tests will be separate between glsl
and glsl es then sure these patches look good.

Reviewed-by: Tom Gall 

On Thu, Jan 31, 2013 at 12:17 PM, Stuart Abercrombie
 wrote:
> Another step towards removing explicit #version directives.
>
> Signed-off-by: Stuart Abercrombie 
> ---
>  tests/shaders/shader_runner.c |   12 +++-
>  1 files changed, 11 insertions(+), 1 deletions(-)
>
> diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
> index d83228e..215e217 100644
> --- a/tests/shaders/shader_runner.c
> +++ b/tests/shaders/shader_runner.c
> @@ -914,8 +914,18 @@ parse_required_versions(struct requirement_parse_results 
> *results,
> }
>
> free(text);
> +
> +   if (!in_requirement_section) {
> +   printf("[require] section missing\n");
> +   piglit_report_result(PIGLIT_FAIL);
> +   }
> +
> +   if (!results->found_glsl) {
> +   printf("GLSL version requirement missing\n");
> +   piglit_report_result(PIGLIT_FAIL);
> +   }
>
> -   if (results->found_glsl && results->glsl_version.es && 
> !results->found_gl) {
> +   if (results->glsl_version.es && !results->found_gl) {
> printf("%s", "The test specifies a requirement for GLSL ES, "
>"but specifies no GL requirement\n.");
> piglit_report_result(PIGLIT_FAIL);
> --
> 1.7.5.4
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit



-- 
Regards,
Tom

"Where's the kaboom!? There was supposed to be an earth-shattering
kaboom!" Marvin Martian
Tech Lead, Graphics Working Group | Linaro.org │ Open source software
for ARM SoCs
w) tom.gall att linaro.org
h) tom_gall att mac.com
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] Fwd: [PATCH 1/1] RFC: add ability to report gl api supported by tests

2013-01-30 Thread Tom Gall
On Wed, Jan 30, 2013 at 3:25 PM, Eric Anholt  wrote:
> Tom Gall  writes:
>
>> Why is this is a good patch to add?
>>
>> In the not too distant future piglit tests will be able to be built
>> once and at runtime one cam choose to test against api family, IE GL,
>> GLES or both. I further assert that one will be able to specify what
>> context versions should be tested, IE GLES1, GLES2, GLES3, all.
>>
>> This patch is a small part of these goals. When a testcase using this
>> code reports what it can do, it allows the python test harness to
>> decide if a testcase is a appropriate for running by asking it.
>
> If the testcase is not appropriate to run, the test just reports skip
> when you run it.  You're adding an extra invocation of the program for
> supported tests, and not saving any invocations of the program at all.

Obviously the patch as it stands doesn't touch the python
infrastructure to gather what a test supports or use it as a basis for
formulating the population of what should be run across API or context
versions. That's a future patch and I figured this patch in RFC form
might broach that topic.

I do like the idea of not having all.tests and I see this is a step in
that direction.

Ergo, why not do a find for the binaries, do a find for the various
verts, geo, frags etc, and then run across the population of what's
available based on what the user wants.

So when/if there is agreement that this is sane, my intent is to first
query the tests as they are found, then run it across the derivations
of API/content version depending on user input.

So a pattern might be for piglit-run.py -api=gl,gles2,gles3
for all tests
   test-foo -supports
   if supported test-foo  for gl4.3
   if supported test-foo  for gles2
   if supported test-foo  for gles3
move on to next test

Obviously the cache will be hot so adding one invocation in what will
be likely several successive invocations of the actual test after that
shouldn't much matter.

Granted one could take the position that all api tests should be run
for a particular context before moving on to the next api/context
variation.   IE run all gl before moving on to gles.


Slightly different topic, following your logic above and presuming
we're in a universe where we build the test but once, how did you
envision that a test will know to run against a particular api (gl,
gles) and context version?

Another variation on this might be to modify the framework in
tests/util so that when the test starts, it would run across the
api/version variations within the test itself. This seemed ugly as
compared to keeping loop & filter logic in the python code. Besides
avoiding bugs where teardown was less than perfect is probably a good
thing.

--
Regards,
Tom

"Where's the kaboom!? There was supposed to be an earth-shattering
kaboom!" Marvin Martian
Tech Lead, Graphics Working Group | Linaro.org │ Open source software
for ARM SoCs
w) tom.gall att linaro.org
h) tom_gall att mac.com
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] Fwd: [PATCH 1/1] RFC: add ability to report gl api supported by tests

2013-01-30 Thread Tom Gall
Why is this is a good patch to add?

In the not too distant future piglit tests will be able to be built
once and at runtime one cam choose to test against api family, IE GL,
GLES or both. I further assert that one will be able to specify what
context versions should be tested, IE GLES1, GLES2, GLES3, all.

This patch is a small part of these goals. When a testcase using this
code reports what it can do, it allows the python test harness to
decide if a testcase is a appropriate for running by asking it.

It keeps the capabilities of the test inside of the test source code
(or shader_test, or vertex, etc data files) instead of having to have
some extra specification information as part of say all.tests or in
some database or whatever).

The patch as currently written does not change the well worn paths of
how testcases are currently used.

Why JSON? python has good JSON support to reconstitute into a python object.

I will point out this could set the stage where all.tests could go
away. Instead, piglit could do a find looking for test binaries, data
files in standard locations, IE *shader_tests, *frag, *vert, etc,
query using this param, ending up with an organized python structure
of candidates, running based on what the user specified.



On Tue, Jan 29, 2013 at 6:09 PM, Eric Anholt  wrote:
> Tom Gall  writes:
>
>> No feedback?
>
> I think what's missing is the explanation of "why do we want the tests
> to be able to print what apis they support?"



-- 
Regards,
Tom

"Where's the kaboom!? There was supposed to be an earth-shattering
kaboom!" Marvin Martian
Tech Lead, Graphics Working Group | Linaro.org │ Open source software
for ARM SoCs
w) tom.gall att linaro.org
h) tom_gall att mac.com
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] Fwd: [PATCH 1/1] RFC: add ability to report gl api supported by tests

2013-01-29 Thread Tom Gall
No feedback?

-- Forwarded message --
From: Tom Gall 
Date: Tue, Jan 22, 2013 at 6:51 PM
Subject: [PATCH 1/1] RFC: add ability to report gl api supported by tests
To: piglit@lists.freedesktop.org
Cc: patc...@linaro.org, Tom Gall 


This patch adds a new command line parameter -supports
to all tests that make use of
PIGLIT_GL_TEST_CONFIG_BEGIN/END. If passed when the
test is called, config->piglit_report_supported is set
to true and a JSON formated structure will be returned.
Within the structure is an encoded python dictionary with
  supports_gl_es_version : version
  supports_gl_core_version : version
  supports_gl_compat_version : version
The fields only exist in the structure if they are non-zero
in the test.

When -supports is passed only the JSON structure is returned
and the test is not run.

Within the piglit_gl_test_config structure a new fn pointer
named supported is added. If set and -supports is passed on the
command line, this function is called allowing tests that
read data files to report results based on the data file
passed on the command line.

Ex: With shader_runner it can via waffle utilize
GL or GL ES based on what is included in the
[required] section of that shader_test data file.

Signed-off-by: Tom Gall 
---
 tests/util/piglit-framework-gl.c |   54 +++---
 tests/util/piglit-framework-gl.h |   30 -
 2 files changed, 80 insertions(+), 4 deletions(-)

diff --git a/tests/util/piglit-framework-gl.c b/tests/util/piglit-framework-gl.c
index 441e271..cf14594 100644
--- a/tests/util/piglit-framework-gl.c
+++ b/tests/util/piglit-framework-gl.c
@@ -60,7 +60,8 @@ delete_arg(char *argv[], int argc, int arg)
  * length is returned in @a argc.
  */
 static void
-process_args(int *argc, char *argv[])
+process_args(int *argc, char *argv[],
+ struct piglit_gl_test_config *config)
 {
int j;

@@ -104,19 +105,34 @@ process_args(int *argc, char *argv[])
}
*argc -= 2;
j -= 2;
+   } else if (!strcmp(argv[j], "-supports")) {
+   /* request to return json structure with API / version
+* support information.
+*/
+   delete_arg(argv, *argc, j--);
+   *argc -= 1;
+   config->piglit_report_supported=true;
}
}
 }

 void
 piglit_gl_test_run(int argc, char *argv[],
-  const struct piglit_gl_test_config *config)
+  struct piglit_gl_test_config *config)
 {
-   process_args(&argc, argv);
+   process_args(&argc, argv, config);

piglit_width = config->window_width;
piglit_height = config->window_height;

+   if (config->piglit_report_supported) {
+   if (config->supported)
+   (config->supported)(argc,argv);
+   else
+   piglit_report_supported_apis(config);
+   exit(0);
+   }
+
gl_fw = piglit_gl_framework_factory(config);
if (gl_fw == NULL) {
printf("piglit: error: failed to create "
@@ -162,3 +178,35 @@ piglit_set_reshape_func(void (*func)(int w, int h))
if (!gl_fw->set_reshape_func)
gl_fw->set_reshape_func(gl_fw, func);
 }
+
+/* return JSON structure describing the capability of the test based
+ * on its supports_gl_core_version, supports_gl_compat_version and
+ * supports_gl_es_version as found in config.
+ */
+void
+piglit_report_supported_apis(const struct piglit_gl_test_config *config)
+{
+   bool print_comma = false;
+
+   printf("api: {");
+   if (config->supports_gl_es_version) {
+   printf("\"supports_gl_es_version\" : %d ",
+   config->supports_gl_es_version);
+   print_comma = true;
+   }
+   if (config->supports_gl_core_version) {
+   if (print_comma)
+   printf(",");
+   printf("\"supports_gl_core_version\" : %d ",
+   config->supports_gl_core_version);
+   print_comma = true;
+   }
+   if (config->supports_gl_compat_version) {
+   if (print_comma)
+   printf(",");
+   printf("\"supports_gl_compat_version\" : %d ",
+   config->supports_gl_compat_version);
+   }
+   printf("}\n" );
+   fflush(stdout);
+}
diff --git a/tests/util/piglit-framework-gl.h b/tests/util/piglit-framework-gl.h
index 6ab791a..d3b6331 100644
--- a/tests/util/piglit-framework-gl.h
+++ b/tests/util/piglit-framework-gl.h
@@ -188,6 +188,33 @@ struct piglit_gl_test_config {
 */
enum piglit_result
(*display)(void);

Re: [Piglit] [PATCH] piglit-dispatch: update gl.spec, gl.tm and enumext.spec from the registry

2013-01-29 Thread Tom Gall
Hi Christoph,

If you look at the bottom of http://www.opengl.org/registry/ you will find:

enum.spec - canonical description of the reserved OpenGL enumerants
and the ranges allocated for different purposes. New allocations are
made here and when extensions using values in allocated ranges are
registered, the enumerants in those extensions are added as well.
enumext.spec - derived variant of enum.spec containing the enumerant
values grouped by the extension or API core revision they correspond
to.
gl.spec - canonical description of the functions defined by core
OpenGL and extensions. When extensions are registered, the functions
they define are added here.
gl.tm - typemap used to convert the abstract typenames in gl.spec into
underlying GL types.
enumext.spec, gl.spec, and gl.tm are used to generate glext.h

Is that where you obtained your proposed update from ?

On Mon, Jan 28, 2013 at 2:53 PM, Christoph Bumiller
 wrote:
> Maybe there's a better way to do this, or a saner version of gl.spec
> somewhere ?
>
> ---
> Added GLDEBUGPROC typedef to piglit-dispatch.h.
>
> This update is required for the ARB_texture_buffer_range extension tests
> to get the definition of the TexBufferRange function.
>
> EDITs of gl.spec:
> Fixed alias of GenVertexArraysAPPLE to be GenVertexArrays
> instead of GenVertexArray (singular).
>
> Removed GetTransformFeedbackVarying and TransformFeedbackVaryings aliases
> in gl.spec from GetTransformFeedbackVaryingNV and
> TransformFeedbackVaryingsNV
> (different signatures).
>
> Made varyings parameter to TransformFeedbackVaryingsEXT const to match the
> non-EXT version and registry/specs/EXT/transform_feedback.txt.
>
> Added constcharPointerARB to gl.tm and used this in ShaderSourceARB to
> match constness of glShaderSource.
>
> Made indices pointer in MultiDrawElementsEXT const to match
> MultiDrawElements and registry/specs/EXT/multi_draw_arrays.txt.
> ---
> body of patch at
> http://people.freedesktop.org/~chrisbmr/0001-piglit-dispatch-update-gl.spec-gl.tm-and-enumext.spe.patch,
> too large for list (700 KiB).
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit



-- 
Regards,
Tom

"Where's the kaboom!? There was supposed to be an earth-shattering
kaboom!" Marvin Martian
Tech Lead, Graphics Working Group | Linaro.org │ Open source software
for ARM SoCs
w) tom.gall att linaro.org
h) tom_gall att mac.com
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 1/3] android: piglit-vbo.cpp compile error

2013-01-28 Thread Tom Gall
arm-linux-androideabi-gcc (GCC) 4.6.x-google 20120106 (prerelease)

external/piglit/tests/util/piglit_ktx.c: In function
'target_to_texture_binding':
external/piglit/tests/util/piglit_ktx.c:761:1: error: control reaches
end of non-void function [-Werror=return-type]

On Mon, Jan 28, 2013 at 7:18 PM, Matt Turner  wrote:
> On Mon, Jan 28, 2013 at 5:11 PM, Tom Gall  wrote:
>> Sure, but tell that to the compiler.
>>
>> It is bad form to not have a return at the end of a function which is
>> supposed to return something.  The other way perhaps is just knock out
>> the default case and return that. Either way.
>
> % cat t.cpp
> #include 
>
> int f(int n) {
> switch (n) {
> case 1:
> return 1;
> default:
> assert(!"FAIL");
> }
> }
>
> % gcc -O2 -Wall -pedantic -Wreturn-type -Wno-return-type -c t.cpp
>
> 
>
> What flags do I have to use to get an error or warning? I tried with
> an without optimization, C and C++, and gcc versions 4.5.4, 4.6.3, and
> 4.7.2.



-- 
Regards,
Tom

"Where's the kaboom!? There was supposed to be an earth-shattering
kaboom!" Marvin Martian
Tech Lead, Graphics Working Group | Linaro.org │ Open source software
for ARM SoCs
w) tom.gall att linaro.org
h) tom_gall att mac.com
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 1/3] android: piglit-vbo.cpp compile error

2013-01-28 Thread Tom Gall
Sure, but tell that to the compiler.

It is bad form to not have a return at the end of a function which is
supposed to return something.  The other way perhaps is just knock out
the default case and return that. Either way.

On Mon, Jan 28, 2013 at 7:01 PM, Matt Turner  wrote:
> On Mon, Jan 28, 2013 at 2:09 PM, Ian Romanick  wrote:
>> These changes seem innocuous enough.
>>
>> Reviewed-by: Ian Romanick 
>
> They are... but 2/3 and 3/3 are adding unreachable return statements
> after switches with a default case that asserts. Kind of bogus.



-- 
Regards,
Tom

"Where's the kaboom!? There was supposed to be an earth-shattering
kaboom!" Marvin Martian
Tech Lead, Graphics Working Group | Linaro.org │ Open source software
for ARM SoCs
w) tom.gall att linaro.org
h) tom_gall att mac.com
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 1/3] android: piglit-vbo.cpp compile error

2013-01-28 Thread Tom Gall
I'm using the "android" branch on:

git://git.linaro.org/people/tomgall/piglit.git

It's a WIP however what is there builds as long as you put it into
external/piglit as well as have waffle already built. It uses
Android.mk files as compared to Adrian's earlier patches that he
posted but the piglit-framework-gl code for android is his. The
Android.mk file is split up tho it could be all put together into one
toplevel Android.mk. Feedback on that design choice as well as the
rest would be most welcome.

On Mon, Jan 28, 2013 at 5:14 PM, Chad Versace
 wrote:
> Thanks. These are reviewed-by me and now committed.
>
> By the way, which Piglit branch are you using for Android?



-- 
Regards,
Tom

"Where's the kaboom!? There was supposed to be an earth-shattering
kaboom!" Marvin Martian
Tech Lead, Graphics Working Group | Linaro.org │ Open source software
for ARM SoCs
w) tom.gall att linaro.org
h) tom_gall att mac.com
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 3/3] Android: piglit_ktx.c compiler error

2013-01-28 Thread Tom Gall
A very minor change to fix build issue for Android. Needed return
statement at end of function which specifies a return type.

Signed-off-by: Tom Gall 
---
 tests/util/piglit_ktx.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/util/piglit_ktx.c b/tests/util/piglit_ktx.c
index 7febc8f..1d47102 100644
--- a/tests/util/piglit_ktx.c
+++ b/tests/util/piglit_ktx.c
@@ -758,6 +758,7 @@ target_to_texture_binding(GLuint target)
assert(0);
break;
}
+   return 0;
 }
 
 bool
-- 
1.7.10.4

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


[Piglit] [PATCH 2/3] android: piglit-shader.c compiler error

2013-01-28 Thread Tom Gall
A very minor change to fix build issue for Android. Needed return
statement at end of function which specifies a return type.

Signed-off-by: Tom Gall 
---
 tests/util/piglit-shader.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/util/piglit-shader.c b/tests/util/piglit-shader.c
index f41ae79..5f4d6c1 100644
--- a/tests/util/piglit-shader.c
+++ b/tests/util/piglit-shader.c
@@ -127,6 +127,7 @@ shader_name(GLenum target)
default:
   assert(!"Unexpected shader target in shader_name()");
}
+   return "error";
 }
 
 /**
-- 
1.7.10.4

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


[Piglit] [PATCH 1/3] android: piglit-vbo.cpp compile error

2013-01-28 Thread Tom Gall
Android is a bit more strict when it builds. Missing was ctype.h.
It doesn't break Linux.

Signed-off-by: Tom Gall 
---
 tests/util/piglit-vbo.cpp |1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/util/piglit-vbo.cpp b/tests/util/piglit-vbo.cpp
index 4900931..b2e2e63 100644
--- a/tests/util/piglit-vbo.cpp
+++ b/tests/util/piglit-vbo.cpp
@@ -93,6 +93,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "piglit-util-gl-common.h"
 #include "piglit-vbo.h"
-- 
1.7.10.4

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


[Piglit] [PATCH 1/1] glsl: add explicit version 100 support

2013-01-23 Thread Tom Gall
This is a small change to add explicit support for glsl
version 100 which is used by OpenGL ES 2. This allows for
100 to be passed on the command line.

In glslparsertest.c add 100 to the list of versions processed
by the switch. Also when version 100 is used, check for gles
and if running as gles don't require the
GL_ARB_ES2_compatibility extension.

In CMakeList.gles2.txt remove ${OPENGL_gles2_LIBRARY} as it's
not needed.

v2: detach patch from proposed python change.

Signed-off-by: Tom Gall 
---
 tests/glslparsertest/CMakeLists.gles2.txt |5 +
 tests/glslparsertest/glslparsertest.c |6 +-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/tests/glslparsertest/CMakeLists.gles2.txt 
b/tests/glslparsertest/CMakeLists.gles2.txt
index 1e37bed..5b437f8 100644
--- a/tests/glslparsertest/CMakeLists.gles2.txt
+++ b/tests/glslparsertest/CMakeLists.gles2.txt
@@ -1,10 +1,7 @@
 link_libraries(
piglitutil_${piglit_target_api}
-   ${OPENGL_gles2_LIBRARY}
)
 
-piglit_add_executable(glslparsertest_${piglit_target_api}
-   glslparsertest.c
-   )
+piglit_add_executable(glslparsertest_${piglit_target_api} glslparsertest.c)
 
 # vim: ft=cmake:
diff --git a/tests/glslparsertest/glslparsertest.c 
b/tests/glslparsertest/glslparsertest.c
index ff32da7..c91a56b 100644
--- a/tests/glslparsertest/glslparsertest.c
+++ b/tests/glslparsertest/glslparsertest.c
@@ -43,6 +43,10 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
const unsigned int int_version = parse_glsl_version(argv[3]);
 
switch (int_version) {
+   case 100:
+   config.supports_gl_compat_version = 10;
+   config.supports_gl_es_version = 20;
+   break;
case 110:
case 120:
case 130:
@@ -351,7 +355,7 @@ piglit_init(int argc, char**argv)
if (glsl_version_string != NULL)
glsl_version = parse_glsl_version(glsl_version_string);
 
-   if (requested_version == 100) {
+   if (!piglit_is_gles() && requested_version == 100) {
piglit_require_extension("GL_ARB_ES2_compatibility");
} else if (requested_version == 300) {
piglit_require_extension("GL_ARB_ES3_compatibility");
-- 
1.7.10.4

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


  1   2   3   >