[Piglit] [PATCH] gl-2.0: Add test for pointsprite state with non-point primitives

2014-11-25 Thread Chris Forbes
Demonstrates an i965 bug, which wined3d hits in many apps.

V2: Fix comment describing vertex layout
V3: Simplify -- the vertex layout actually doesn't matter; the i965
bug is entirely in the SF setup.

Signed-off-by: Chris Forbes chr...@ijw.co.nz
---
 tests/all.py   |   1 +
 tests/spec/gl-2.0/CMakeLists.gl.txt|   1 +
 tests/spec/gl-2.0/pointsprite-non-points.c | 106 +
 3 files changed, 108 insertions(+)
 create mode 100644 tests/spec/gl-2.0/pointsprite-non-points.c

diff --git a/tests/all.py b/tests/all.py
index b3417a9..f199582 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -864,6 +864,7 @@ add_concurrent_test(gl20, 'attribs')
 add_concurrent_test(gl20, 'gl-2.0-edgeflag')
 add_concurrent_test(gl20, 'gl-2.0-edgeflag-immediate')
 add_concurrent_test(gl20, 'gl-2.0-vertexattribpointer')
+add_concurrent_test(gl20, 'gl-2.0-pointsprite-non-points')
 add_plain_test(gl20, 'attrib-assignments')
 add_plain_test(gl20, 'getattriblocation-conventional')
 add_plain_test(gl20, 'clip-flag-behavior')
diff --git a/tests/spec/gl-2.0/CMakeLists.gl.txt 
b/tests/spec/gl-2.0/CMakeLists.gl.txt
index 3ac0d68..a06bb8a 100644
--- a/tests/spec/gl-2.0/CMakeLists.gl.txt
+++ b/tests/spec/gl-2.0/CMakeLists.gl.txt
@@ -14,3 +14,4 @@ piglit_add_executable (vertex-program-two-side 
vertex-program-two-side.c)
 piglit_add_executable (gl-2.0-edgeflag edgeflag.c)
 piglit_add_executable (gl-2.0-edgeflag-immediate edgeflag-immediate.c)
 piglit_add_executable (gl-2.0-vertexattribpointer vertexattribpointer.c)
+piglit_add_executable (gl-2.0-pointsprite-non-points pointsprite-non-points.c)
diff --git a/tests/spec/gl-2.0/pointsprite-non-points.c 
b/tests/spec/gl-2.0/pointsprite-non-points.c
new file mode 100644
index 000..1827059
--- /dev/null
+++ b/tests/spec/gl-2.0/pointsprite-non-points.c
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2014 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.
+ */
+
+/**
+ * With point sprites enabled, and texcoord replacement enabled for
+ * the first set of texcoords, test DrawArrays with the following
+ * varying layout:
+ * - position
+ * - constant zero color
+ * - texcoord
+ *
+ * This demonstrates a bug in i965, which is hit by wined3d in many
+ * apps. To exercise this case, it is important that the texcoord
+ * not be in the first non-position varying slot.
+ */
+
+
+#include piglit-util-gl.h
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+   config.supports_gl_compat_version = 20;
+   config.window_visual = (PIGLIT_GL_VISUAL_RGBA |
+   PIGLIT_GL_VISUAL_DOUBLE);
+PIGLIT_GL_TEST_CONFIG_END
+
+
+static const char *vs_text =
+   void main() {\n
+  gl_Position = gl_Vertex;\n
+  gl_FrontColor = vec4(1, 0, 0, 0);\n
+  gl_TexCoord[0] = vec4(0, 1, 0, 0);\n
+   }\n;
+static const char *fs_text =
+   void main() { \n
+  gl_FragColor = gl_Color.yxyy + gl_TexCoord[0];\n
+   }\n;
+
+static GLuint program;
+
+GLuint vbo;
+float verts[] = {
+   -1, -1, 0, 0,
+   1, -1,  1, 0,
+   1, 1,   1, 1,
+   -1, 1,  0, 1
+};
+
+enum piglit_result
+piglit_display(void)
+{
+   const float green[] = {0, 1, 0};
+   bool pass = true;
+
+   glViewport(0, 0, piglit_width, piglit_height);
+   glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+   glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
+
+   piglit_probe_rect_rgb(0, 0, piglit_width, piglit_height, green);
+
+   piglit_present_results();
+
+   return pass ? PIGLIT_PASS : PIGLIT_FAIL;
+}
+
+
+void
+piglit_init(int argc, char **argv)
+{
+   piglit_require_GLSL();
+
+   program = piglit_build_simple_program(vs_text, fs_text);
+   glUseProgram(program);
+
+   glClearColor(0.25f, 0.25f, 0.25f, 1.0f);
+
+   glGenBuffers(1, vbo);
+   glBindBuffer(GL_ARRAY_BUFFER, vbo);
+   

Re: [Piglit] [PATCH] gl-2.0: Add test for interaction between pointsprites and const attribs

2014-11-25 Thread Chris Forbes
Disregard; has been superceded by a simpler test now that I've fully
understood where i965 was breaking.

On Tue, Nov 25, 2014 at 8:39 PM, Chris Forbes chr...@ijw.co.nz wrote:
 Demonstrates an i965 bug, which wined3d hits in many apps.

 V2: Fix comment describing vertex layout

 Signed-off-by: Chris Forbes chr...@ijw.co.nz
 ---
  tests/all.py |   1 +
  tests/spec/gl-2.0/CMakeLists.gl.txt  |   1 +
  tests/spec/gl-2.0/const-attrib-pointsprite-bug.c | 119 
 +++
  3 files changed, 121 insertions(+)
  create mode 100644 tests/spec/gl-2.0/const-attrib-pointsprite-bug.c

 diff --git a/tests/all.py b/tests/all.py
 index b3417a9..d9e7fbc 100644
 --- a/tests/all.py
 +++ b/tests/all.py
 @@ -864,6 +864,7 @@ add_concurrent_test(gl20, 'attribs')
  add_concurrent_test(gl20, 'gl-2.0-edgeflag')
  add_concurrent_test(gl20, 'gl-2.0-edgeflag-immediate')
  add_concurrent_test(gl20, 'gl-2.0-vertexattribpointer')
 +add_concurrent_test(gl20, 'gl-2.0-const-attrib-pointsprite-bug')
  add_plain_test(gl20, 'attrib-assignments')
  add_plain_test(gl20, 'getattriblocation-conventional')
  add_plain_test(gl20, 'clip-flag-behavior')
 diff --git a/tests/spec/gl-2.0/CMakeLists.gl.txt 
 b/tests/spec/gl-2.0/CMakeLists.gl.txt
 index 3ac0d68..8f1b709 100644
 --- a/tests/spec/gl-2.0/CMakeLists.gl.txt
 +++ b/tests/spec/gl-2.0/CMakeLists.gl.txt
 @@ -14,3 +14,4 @@ piglit_add_executable (vertex-program-two-side 
 vertex-program-two-side.c)
  piglit_add_executable (gl-2.0-edgeflag edgeflag.c)
  piglit_add_executable (gl-2.0-edgeflag-immediate edgeflag-immediate.c)
  piglit_add_executable (gl-2.0-vertexattribpointer vertexattribpointer.c)
 +piglit_add_executable (gl-2.0-const-attrib-pointsprite-bug 
 const-attrib-pointsprite-bug.c)
 diff --git a/tests/spec/gl-2.0/const-attrib-pointsprite-bug.c 
 b/tests/spec/gl-2.0/const-attrib-pointsprite-bug.c
 new file mode 100644
 index 000..16ade7a
 --- /dev/null
 +++ b/tests/spec/gl-2.0/const-attrib-pointsprite-bug.c
 @@ -0,0 +1,119 @@
 +/*
 + * Copyright 2014 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.
 + */
 +
 +/**
 + * With point sprites enabled, and texcoord replacement enabled for
 + * the first set of texcoords, test DrawArrays with the following
 + * vertex attribute layout:
 + * - vertex position, from a VBO
 + * - gl_Color, from current state (array not enabled)
 + * - texcoords, from the same VBO as position
 + *
 + * This demonstrates a bug in i965, which is hit by wined3d in many
 + * apps.
 + */
 +
 +
 +#include piglit-util-gl.h
 +
 +PIGLIT_GL_TEST_CONFIG_BEGIN
 +   config.supports_gl_compat_version = 20;
 +   config.window_visual = (PIGLIT_GL_VISUAL_RGBA |
 +   PIGLIT_GL_VISUAL_DOUBLE);
 +PIGLIT_GL_TEST_CONFIG_END
 +
 +
 +static const char *vs_text =
 +   void main() {\n
 +  gl_FrontColor = gl_Color;\n
 +  gl_Position = gl_Vertex;\n
 +  gl_TexCoord[0] = gl_MultiTexCoord0;\n
 +   }\n;
 +static const char *fs_text =
 +   void main() { \n
 +  if (gl_Color.xyz == vec3(1,0,0))\n
 +  gl_FragColor = gl_TexCoord[0];\n
 +  else\n
 +  gl_FragColor = vec4(0,0,1,0);\n
 +   }\n;
 +
 +static GLuint program;
 +
 +GLuint vbo;
 +float verts[] = {
 +   -1, -1, 0, 0,
 +   1, -1,  1, 0,
 +   1, 1,   1, 1,
 +   -1, 1,  0, 1
 +};
 +
 +enum piglit_result
 +piglit_display(void)
 +{
 +   bool pass = true;
 +   int x, y;
 +
 +   glViewport(0, 0, piglit_width, piglit_height);
 +   glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 +
 +   glColor3f(1, 0, 0);
 +   glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
 +
 +   for (x = 0; x  3; x++) {
 +   for (y = 0; y  3; y++) {
 +   float expected[] = { (x+1)/4.0f, (y+1)/4.0f, 0 };
 +

[Piglit] [PATCH] glsl-1.20: test implicitly sized arrays match explicitly sized arrays across the same stage

2014-11-25 Thread Timothy Arceri
Signed-off-by: Timothy Arceri t_arc...@yahoo.com.au
---
 .../intrastage-unsized-array-mismatch.shader_test  | 33 ++
 .../intrastage-unsized-array-mismatch2.shader_test | 33 ++
 .../linker/intrastage-unsized-array.shader_test| 33 ++
 .../linker/intrastage-unsized-array2.shader_test   | 33 ++
 4 files changed, 132 insertions(+)
 create mode 100644 
tests/spec/glsl-1.20/linker/intrastage-unsized-array-mismatch.shader_test
 create mode 100644 
tests/spec/glsl-1.20/linker/intrastage-unsized-array-mismatch2.shader_test
 create mode 100644 
tests/spec/glsl-1.20/linker/intrastage-unsized-array.shader_test
 create mode 100644 
tests/spec/glsl-1.20/linker/intrastage-unsized-array2.shader_test

diff --git 
a/tests/spec/glsl-1.20/linker/intrastage-unsized-array-mismatch.shader_test 
b/tests/spec/glsl-1.20/linker/intrastage-unsized-array-mismatch.shader_test
new file mode 100644
index 000..cdf3a91
--- /dev/null
+++ b/tests/spec/glsl-1.20/linker/intrastage-unsized-array-mismatch.shader_test
@@ -0,0 +1,33 @@
+# This test verifies that a link error is generated if implicitly sized
+# arrays dont match explicitly sized arrays across the same stage.
+
+[require]
+GLSL = 1.20
+
+[vertex shader]
+#version 120
+
+varying vec4 color[3];
+
+void f()
+{
+  color[1] = vec4(1, 0, 0, 1);
+}
+
+[vertex shader]
+#version 120
+
+varying vec4 color[];
+
+void f();
+
+void main()
+{
+  f();
+  color[3] = vec4(1, 0, 0, 1);
+
+  gl_Position = gl_Vertex;
+}
+
+[test]
+link error
diff --git 
a/tests/spec/glsl-1.20/linker/intrastage-unsized-array-mismatch2.shader_test 
b/tests/spec/glsl-1.20/linker/intrastage-unsized-array-mismatch2.shader_test
new file mode 100644
index 000..764469a
--- /dev/null
+++ b/tests/spec/glsl-1.20/linker/intrastage-unsized-array-mismatch2.shader_test
@@ -0,0 +1,33 @@
+# This test verifies that a link error is generated if implicitly sized
+# arrays dont match explicitly sized arrays across the same stage.
+
+[require]
+GLSL = 1.20
+
+[vertex shader]
+#version 120
+
+varying vec4 color[];
+
+void f()
+{
+  color[3] = vec4(1, 0, 0, 1);
+}
+
+[vertex shader]
+#version 120
+
+varying vec4 color[3];
+
+void f();
+
+void main()
+{
+  f();
+  color[2] = vec4(1, 0, 0, 1);
+
+  gl_Position = gl_Vertex;
+}
+
+[test]
+link error
diff --git a/tests/spec/glsl-1.20/linker/intrastage-unsized-array.shader_test 
b/tests/spec/glsl-1.20/linker/intrastage-unsized-array.shader_test
new file mode 100644
index 000..6fdd806
--- /dev/null
+++ b/tests/spec/glsl-1.20/linker/intrastage-unsized-array.shader_test
@@ -0,0 +1,33 @@
+# Test implicitly sized arrays match explicitly sized arrays
+# across the same stage.
+
+[require]
+GLSL = 1.20
+
+[vertex shader]
+#version 120
+
+varying vec4 color[4];
+
+void f()
+{
+  color[1] = vec4(1, 0, 0, 1);
+}
+
+[vertex shader]
+#version 120
+
+varying vec4 color[];
+
+void f();
+
+void main()
+{
+  f();
+  color[3] = vec4(1, 0, 0, 1);
+
+  gl_Position = gl_Vertex;
+}
+
+[test]
+link success
diff --git a/tests/spec/glsl-1.20/linker/intrastage-unsized-array2.shader_test 
b/tests/spec/glsl-1.20/linker/intrastage-unsized-array2.shader_test
new file mode 100644
index 000..6af80c2
--- /dev/null
+++ b/tests/spec/glsl-1.20/linker/intrastage-unsized-array2.shader_test
@@ -0,0 +1,33 @@
+# Test implicitly sized arrays match explicitly sized arrays
+# across the same stage.
+
+[require]
+GLSL = 1.20
+
+[vertex shader]
+#version 120
+
+varying vec4 color[];
+
+void f()
+{
+  color[3] = vec4(1, 0, 0, 1);
+}
+
+[vertex shader]
+#version 120
+
+varying vec4 color[4];
+
+void f();
+
+void main()
+{
+  f();
+  color[1] = vec4(1, 0, 0, 1);
+
+  gl_Position = gl_Vertex;
+}
+
+[test]
+link success
-- 
1.9.3

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


[Piglit] [PATCH piglit] Test doing a meta operation while there is an occlusion query

2014-11-25 Thread Neil Roberts
This adds a test which calls glClear while there is an occlusion query
in progress. The clear shouldn't affect the sample count in the
occlusion query. However in Mesa if the clear is implemented as a meta
operation then it will currently trigger a bug because the sample
count is not saved correctly and it gets reset to zero.
---
 tests/all.py   |   1 +
 tests/spec/arb_occlusion_query/CMakeLists.gl.txt   |   1 +
 .../occlusion_query_meta_save.c| 102 +
 3 files changed, 104 insertions(+)
 create mode 100644 tests/spec/arb_occlusion_query/occlusion_query_meta_save.c

diff --git a/tests/all.py b/tests/all.py
index b3417a9..d6470d2 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -1967,6 +1967,7 @@ add_concurrent_test(arb_occlusion_query, 
'occlusion_query')
 add_concurrent_test(arb_occlusion_query, 'occlusion_query_lifetime')
 add_concurrent_test(arb_occlusion_query, 'occlusion_query_meta_fragments')
 add_concurrent_test(arb_occlusion_query, 'occlusion_query_meta_no_fragments')
+add_concurrent_test(arb_occlusion_query, 'occlusion_query_meta_save')
 add_concurrent_test(arb_occlusion_query, 'occlusion_query_order')
 add_concurrent_test(arb_occlusion_query, 'gen_delete_while_active')
 
diff --git a/tests/spec/arb_occlusion_query/CMakeLists.gl.txt 
b/tests/spec/arb_occlusion_query/CMakeLists.gl.txt
index 188f07d..01a499d 100644
--- a/tests/spec/arb_occlusion_query/CMakeLists.gl.txt
+++ b/tests/spec/arb_occlusion_query/CMakeLists.gl.txt
@@ -13,5 +13,6 @@ piglit_add_executable (occlusion_query occlusion_query.c)
 piglit_add_executable (occlusion_query_lifetime occlusion_query_lifetime.c)
 piglit_add_executable (occlusion_query_meta_no_fragments 
occlusion_query_meta_no_fragments.c)
 piglit_add_executable (occlusion_query_meta_fragments 
occlusion_query_meta_fragments.c)
+piglit_add_executable (occlusion_query_meta_save occlusion_query_meta_save.c)
 piglit_add_executable (occlusion_query_order occlusion_query_order.c)
 piglit_add_executable (gen_delete_while_active gen_delete_while_active.c)
diff --git a/tests/spec/arb_occlusion_query/occlusion_query_meta_save.c 
b/tests/spec/arb_occlusion_query/occlusion_query_meta_save.c
new file mode 100644
index 000..927d72e
--- /dev/null
+++ b/tests/spec/arb_occlusion_query/occlusion_query_meta_save.c
@@ -0,0 +1,102 @@
+/*
+ * Copyright © 2014 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.
+ *
+ * Authors:
+ *Neil Roberts n...@linux.intel.com
+ */
+
+/**
+ * \file occlusion_query_meta_save.c
+ *
+ * Verify that doing a clear (which is potentially implemented as a
+ * meta operation) doesn't reset the samples-passed count back to
+ * zero.
+ */
+
+#include piglit-util-gl.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)
+{
+   GLuint query;
+   GLint result = -1;
+
+   piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
+
+   glClearColor(0.0, 1.0, 0.0, 0.0);
+   glClear(GL_COLOR_BUFFER_BIT);
+
+   glGenQueries(1, query);
+
+   glBeginQuery(GL_SAMPLES_PASSED, query);
+
+   /* Render 64 pixels. This should affect the query */
+   piglit_draw_rect(0, 0, 8, 8);
+
+   /* Clear the framebuffer. This shouldn't affect the query */
+   glClearColor(0.0, 0.0, 1.0, 0.0);
+   glClear(GL_COLOR_BUFFER_BIT);
+
+   /* Render another 64 pixels. This should continue adding to
+* the query */
+   piglit_draw_rect(4, 0, 8, 8);
+
+   glEndQuery(GL_SAMPLES_PASSED);
+
+   glGetQueryObjectiv(query, GL_QUERY_RESULT, result);
+
+   glDeleteQueries(1, query);
+
+   piglit_present_results();
+
+   if (result != 128) {
+   printf(Occlusion query resulted in %d samples 
+  

Re: [Piglit] [PATCH] util/gl: link against OPENGL_gl_LIBRARY on waffle aware systems

2014-11-25 Thread Mark Janes
This patched fixed the gl tests, but I encountered the same error for
gles1/gles2/gles3.

Piglit built for me when I added the same link instruction to:

tests/util/CMakeLists.gles1.txt
tests/util/CMakeLists.gles2.txt
tests/util/CMakeLists.gles3.txt

Is there a more specific (GLES) link instruction that should be used,
instead of linking the gles tests against GL?

-Mark

Emil Velikov emil.l.veli...@gmail.com writes:

 Similar to the earlier patch for waffle-less (glut) builds. The need
 for this patch became apparent as we removed the libGL link dependency
 in waffle.

 Cc: Mark Janes mark.a.ja...@intel.com
 Reported-by: Mark Janes mark.a.ja...@intel.com
 Signed-off-by: Emil Velikov emil.l.veli...@gmail.com
 ---
  tests/util/CMakeLists.gl.txt | 4 
  1 file changed, 4 insertions(+)

 diff --git a/tests/util/CMakeLists.gl.txt b/tests/util/CMakeLists.gl.txt
 index 34ad63e..ecd9be3 100644
 --- a/tests/util/CMakeLists.gl.txt
 +++ b/tests/util/CMakeLists.gl.txt
 @@ -30,6 +30,10 @@ IF(PIGLIT_BUILD_GLX_TESTS)
   ${UTIL_GL_SOURCES}
   piglit-glx-util.c
   )
 + link_libraries(
 + ${OPENGL_gl_LIBRARY}
 + )
 +
  ENDIF(PIGLIT_BUILD_GLX_TESTS)
  
  piglit_add_library (piglitutil_${piglit_target_api}
 -- 
 2.1.3
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 2/3] gl-2.1: Ported pbo test from Glean to Piglit.

2014-11-25 Thread Laura Ekstrand
---
 tests/all.py|1 +
 tests/spec/gl-2.1/CMakeLists.gl.txt |1 +
 tests/spec/gl-2.1/pbo.c | 1056 +++
 3 files changed, 1058 insertions(+)
 create mode 100644 tests/spec/gl-2.1/pbo.c

diff --git a/tests/all.py b/tests/all.py
index de32fe7..dc3e938 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -913,6 +913,7 @@ add_concurrent_test(gl20, gl-2.0-active-sampler-conflict)
 gl21 = {}
 spec['!OpenGL 2.1'] = gl21
 gl21['minmax'] = PiglitGLTest('gl-2.1-minmax', run_concurrent=True)
+gl21['pbo'] = PiglitGLTest('gl-2.1-pbo', run_concurrent=True)
 
 gl30 = {}
 spec['!OpenGL 3.0'] = gl30
diff --git a/tests/spec/gl-2.1/CMakeLists.gl.txt 
b/tests/spec/gl-2.1/CMakeLists.gl.txt
index 7e60f1d..f395e32 100644
--- a/tests/spec/gl-2.1/CMakeLists.gl.txt
+++ b/tests/spec/gl-2.1/CMakeLists.gl.txt
@@ -11,3 +11,4 @@ link_libraries (
 )
 
 piglit_add_executable (gl-2.1-minmax minmax.c)
+piglit_add_executable (gl-2.1-pbo pbo.c)
diff --git a/tests/spec/gl-2.1/pbo.c b/tests/spec/gl-2.1/pbo.c
new file mode 100644
index 000..b6c51e9
--- /dev/null
+++ b/tests/spec/gl-2.1/pbo.c
@@ -0,0 +1,1056 @@
+/* BEGIN_COPYRIGHT -*- glean -*-
+ *
+ * Copyright (C) 2007, 2014  Intel Corporation
+ * Copyright (C) 1999  Allen Akin  All Rights Reserved.
+ *
+ * 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 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.
+ *
+ * END_COPYRIGHT
+ */
+
+/** @file pbo.c
+ *
+ * Test OpenGL Extension GL_ARB_pixel_buffer_object
+ *
+ * Authors:
+ * Shuang He shuang...@intel.com
+ * Adapted to Piglit by Laura Ekstrand la...@jlekstrand.net, November 2014.
+ */
+
+#include piglit-util-gl.h
+
+#define WINSIZE 100
+#define BUFFER_OFFSET(i) ((char *)NULL + (i))
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_compat_version = 10;
+
+   config.window_visual = PIGLIT_GL_VISUAL_RGBA |
+   PIGLIT_GL_VISUAL_DOUBLE;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+void
+piglit_init(int argc, char **argv)
+{
+   piglit_require_extension(GL_ARB_pixel_buffer_object);
+
+   piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
+}
+
+static void
+report_failure(const char *msg, const int line)
+{
+   printf(FAILURE: %s (at pbo.c: %d)\n, msg, line);
+}
+
+#define REPORT_FAILURE(MSG) report_failure(MSG, __LINE__)
+
+#define TEXSIZE 64
+
+enum piglit_result
+test_sanity(void)
+{
+   GLuint pbs[1];
+   GLuint pb_binding;
+
+   glGetIntegerv(GL_PIXEL_UNPACK_BUFFER_BINDING_ARB,
+ (GLint *)  pb_binding);
+   if (pb_binding != 0) {
+   REPORT_FAILURE(Failed to bind unpack pixel buffer object);
+   return PIGLIT_FAIL;
+   }
+
+   glGetIntegerv(GL_PIXEL_PACK_BUFFER_BINDING_ARB,
+ (GLint *)  pb_binding);
+   if (pb_binding != 0) {
+   REPORT_FAILURE(Failed to bind pack pixel buffer object);
+   return PIGLIT_FAIL;
+   }
+
+   glGenBuffersARB(1, pbs);
+
+   if (glIsBufferARB(pbs[0]) != GL_FALSE) {
+   REPORT_FAILURE(glIsBufferARB failed);
+   return PIGLIT_FAIL;
+   }
+
+   glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, pbs[0]);
+   glGetIntegerv(GL_PIXEL_UNPACK_BUFFER_BINDING_ARB,
+ (GLint *)  pb_binding);
+   glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0);
+   if (pb_binding != pbs[0]) {
+   REPORT_FAILURE(Failed to bind unpack pixel buffer object);
+   return PIGLIT_FAIL;
+   }
+
+   glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, pbs[0]);
+   glGetIntegerv(GL_PIXEL_PACK_BUFFER_BINDING_ARB,
+ (GLint *)  pb_binding);
+   glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0);
+   if (pb_binding != pbs[0]) {
+   REPORT_FAILURE(Failed to bind unpack pixel buffer object);
+   return PIGLIT_FAIL;
+   }
+
+   glDeleteBuffersARB(1, pbs);
+
+   if (glIsBufferARB(pbs[0]) == GL_TRUE) {
+   

[Piglit] [PATCH 3/3] glean: Removed Glean pbo test.

2014-11-25 Thread Laura Ekstrand
---
 tests/all.py  |1 -
 tests/glean/CMakeLists.gl.txt |1 -
 tests/glean/tpbo.cpp  | 1094 -
 tests/glean/tpbo.h|   83 
 4 files changed, 1179 deletions(-)
 delete mode 100644 tests/glean/tpbo.cpp
 delete mode 100644 tests/glean/tpbo.h

diff --git a/tests/all.py b/tests/all.py
index dc3e938..310111e 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -109,7 +109,6 @@ glean['fbo'] = GleanTest('fbo')
 glean['getString'] = GleanTest('getString')
 glean['occluquery'] = GleanTest('occluQry')
 glean['paths'] = GleanTest('paths')
-glean['pbo'] = GleanTest('pbo')
 glean['pixelFormats'] = GleanTest('pixelFormats')
 glean['pointAtten'] = GleanTest('pointAtten')
 glean['pointSprite'] = GleanTest('pointSprite')
diff --git a/tests/glean/CMakeLists.gl.txt b/tests/glean/CMakeLists.gl.txt
index bb59788..355eadd 100644
--- a/tests/glean/CMakeLists.gl.txt
+++ b/tests/glean/CMakeLists.gl.txt
@@ -36,7 +36,6 @@ piglit_add_executable (glean
tmultitest.cpp
toccluqry.cpp
tpaths.cpp
-   tpbo.cpp
tpixelformats.cpp
tpointatten.cpp
tpointsprite.cpp
diff --git a/tests/glean/tpbo.cpp b/tests/glean/tpbo.cpp
deleted file mode 100644
index 002c444..000
--- a/tests/glean/tpbo.cpp
+++ /dev/null
@@ -1,1094 +0,0 @@
-// BEGIN_COPYRIGHT -*- glean -*-
-// 
-// Copyrigth (C) 2007  Intel Corporation
-// Copyright (C) 1999  Allen Akin   All Rights Reserved.
-// 
-// 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 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 ALLEN AKIN 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.
-// 
-// END_COPYRIGHT
-//
-// Authors:
-//  Shuang He shuang...@intel.com
-//
-// tpbo.cpp:  Test OpenGL Extension GL_ARB_pixel_buffer_object
-
-
-#define GL_GLEXT_PROTOTYPES
-
-#include stdlib.h
-#include cstring
-#include cassert
-#include math.h
-#include tpbo.h
-
-
-namespace GLEAN
-{
-
-static int usePBO;
-#define BUFFER_OFFSET(i) ((char *)NULL + (i))
-
-bool PBOTest::setup(void)
-{
-   glMatrixMode(GL_PROJECTION);
-
-   glLoadIdentity();
-   gluOrtho2D(0, 100, 0, 100);
-   glMatrixMode(GL_MODELVIEW);
-   glLoadIdentity();
-   glDrawBuffer(GL_FRONT);
-   glReadBuffer(GL_FRONT);
-
-   // compute error tolerances (may need fine-tuning)
-   int bufferBits[5];
-
-   glGetIntegerv(GL_RED_BITS, bufferBits[0]);
-   glGetIntegerv(GL_GREEN_BITS, bufferBits[1]);
-   glGetIntegerv(GL_BLUE_BITS, bufferBits[2]);
-   glGetIntegerv(GL_ALPHA_BITS, bufferBits[3]);
-   glGetIntegerv(GL_DEPTH_BITS, bufferBits[4]);
-
-   tolerance[0] = 2.0 / (1  bufferBits[0]);
-   tolerance[1] = 2.0 / (1  bufferBits[1]);
-   tolerance[2] = 2.0 / (1  bufferBits[2]);
-   if (bufferBits[3])
-  tolerance[3] = 2.0 / (1  bufferBits[3]);
-   else
-  tolerance[3] = 1.0;
-   if (bufferBits[4])
-  tolerance[4] = 16.0 / (1  bufferBits[4]);
-   else
-  tolerance[4] = 1.0;
-
-   // Check if GL_ARB_pixel_buffer_object is supported
-   if (!GLUtils::haveExtension(GL_ARB_pixel_buffer_object)) {
-  //printf(GL_ARB_pixel_buffer_object is not supported\n);
-  usePBO = 0;
-  return false;
-   }
-   else {
-  //printf(GL_ARB_pixel_buffer_object is supported\n);
-  usePBO = 1;
-   }
-
-   return true;
-}
-
-
-void
-PBOTest::reportFailure(const char *msg, const int line) const
-{
-   env-log  FAILURE:   msg   (at tpbo.cpp:  line  )\n;
-}
-
-void
-PBOTest::reportFailure(const char *msg, const GLenum target, const int line) 
const
-{
-   env-log  FAILURE:   msg;
-   if (target == GL_FRAGMENT_SHADER)
-  env-log   (fragment);
-   else
-  env-log   (vertex);
-   env-log   (at tpbo.cpp:  line  )\n;
-}
-
-#define REPORT_FAILURE(MSG) reportFailure(MSG, __LINE__)
-#define REPORT_FAILURE_T(MSG, TARGET) reportFailure(MSG, TARGET, __LINE__)
-// Compare actual and expected colors 
-bool PBOTest::equalColors(const GLfloat act[3], const GLfloat exp[3]) const
-{
-   if ((fabsf(act[0] - exp[0])  tolerance[0])
-   || (fabsf(act[1] - exp[1])  tolerance[1])
-   || (fabsf(act[2] - exp[2])  tolerance[2])) {
-  

[Piglit] [PATCH 1/3] util: Exposed piglit_compare_images_ubyte in piglit-util-gl.h so that tests can use it.

2014-11-25 Thread Laura Ekstrand
---
 tests/util/piglit-util-gl.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/util/piglit-util-gl.h b/tests/util/piglit-util-gl.h
index adf98d8..69544d3 100644
--- a/tests/util/piglit-util-gl.h
+++ b/tests/util/piglit-util-gl.h
@@ -140,6 +140,9 @@ int piglit_compare_images_color(int x, int y, int w, int h, 
int num_components,
 int piglit_probe_image_color(int x, int y, int w, int h, GLenum format, const 
float *image);
 int piglit_probe_image_rgb(int x, int y, int w, int h, const float *image);
 int piglit_probe_image_rgba(int x, int y, int w, int h, const float *image);
+int piglit_compare_images_ubyte(int x, int y, int w, int h,
+   const GLubyte *expected_image,
+   const GLubyte *observed_image);
 int piglit_probe_image_stencil(int x, int y, int w, int h, const GLubyte 
*image);
 int piglit_probe_image_ubyte(int x, int y, int w, int h, GLenum format,
 const GLubyte *image);
-- 
2.1.0

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


[Piglit] [Bug 86361] [Bisected]Piglit compile-program.c make fail

2014-11-25 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=86361

lu hua huax...@intel.com changed:

   What|Removed |Added

   Severity|major   |critical

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit