[Piglit] [PATCH] spec/arb_blend_func_extended: Add test for SIMD16 dual source blending

2015-03-05 Thread Matt Turner
From: Iago Toral Quiroga ito...@igalia.com

On Intel hardware at least, SIMD16 dual source rendering requires handling
pixel data in two sets of 8 pixels each. Incorrect implementations may fail
to map correct colors for each pixel group (for example by using the color
for the first group as the color for the second group or viceversa). However,
tests that render using solid colors across the entire polygon won't catch
these cases (since in that case the color is the same for boths groups of
pixels).

This test blends using a checker board pattern where each cell is
10px wide and 10px tall. This makes it so that the two sets of 8 pixels
issued during SIMD16 operation pack different color data for the pixels
involved, enabling testing of correct behavior in that case.
---
This is the same patch Iago sent, just rebased on today's all.py changes.

Iago, the test doesn't seem to open a window. I expected it would render
to an offscreen FBO but then blit to a window to display if -auto wasn't
passed.


 tests/all.py   |   2 +
 .../execution/CMakeLists.gl.txt|   1 +
 .../execution/fbo-extended-blend-pattern.c | 209 +
 3 files changed, 212 insertions(+)
 create mode 100644 
tests/spec/arb_blend_func_extended/execution/fbo-extended-blend-pattern.c

diff --git a/tests/all.py b/tests/all.py
index 61fa1e2..9dc16db 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -3847,6 +3847,8 @@ with profile.group_manager(
 g(['arb_blend_func_extended-fbo-extended-blend'], run_concurrent=False)
 g(['arb_blend_func_extended-fbo-extended-blend-explicit'],
   run_concurrent=False)
+g(['arb_blend_func_extended-fbo-extended-blend-pattern'],
+  run_concurrent=False)
 
 with profile.group_manager(
 PiglitGLTest,
diff --git a/tests/spec/arb_blend_func_extended/execution/CMakeLists.gl.txt 
b/tests/spec/arb_blend_func_extended/execution/CMakeLists.gl.txt
index ebe0fa0..1db7fa1 100644
--- a/tests/spec/arb_blend_func_extended/execution/CMakeLists.gl.txt
+++ b/tests/spec/arb_blend_func_extended/execution/CMakeLists.gl.txt
@@ -12,4 +12,5 @@ link_libraries (
 
 piglit_add_executable (arb_blend_func_extended-fbo-extended-blend 
fbo-extended-blend.c)
 piglit_add_executable (arb_blend_func_extended-fbo-extended-blend-explicit 
fbo-extended-blend-explicit.c)
+piglit_add_executable (arb_blend_func_extended-fbo-extended-blend-pattern 
fbo-extended-blend-pattern.c)
 # vim: ft=cmake:
diff --git 
a/tests/spec/arb_blend_func_extended/execution/fbo-extended-blend-pattern.c 
b/tests/spec/arb_blend_func_extended/execution/fbo-extended-blend-pattern.c
new file mode 100644
index 000..488c380
--- /dev/null
+++ b/tests/spec/arb_blend_func_extended/execution/fbo-extended-blend-pattern.c
@@ -0,0 +1,209 @@
+/*
+ * Copyright (c) 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.
+ */
+
+/**
+ * @file fbo-extended-blend-pattern.c
+ * @author Iago Toral Quiroga ito...@igalia.com
+ *
+ * On Intel hardware at least, SIMD16 dual source rendering requires handling
+ * pixel data in two sets of 8 pixels each. Incorrect implementations may fail
+ * to map correct colors for each pixel group (for example by using the color
+ * for the first group as the color for the second group or viceversa). 
However,
+ * tests that render using solid colors across the entire polygon won't catch
+ * these cases (since in that case the color is the same for boths groups of
+ * pixels).
+ *
+ * This test blends using a checker board pattern where each cell is
+ * 10px wide and 10px tall. This makes it so that the two sets of 8 pixels
+ * issued during SIMD16 operation pack different color data for the pixels
+ * involved, enabling testing of correct behavior in that case.
+ *
+ * This only tests with one specific blend mode. There is no need to test
+ * others, since the details of SIMD16 operation are 

Re: [Piglit] [PATCH] spec/arb_blend_func_extended: Add test for SIMD16 dual source blending

2015-03-05 Thread Matt Turner
On Thu, Mar 5, 2015 at 10:50 AM, Matt Turner matts...@gmail.com wrote:
 From: Iago Toral Quiroga ito...@igalia.com

 On Intel hardware at least, SIMD16 dual source rendering requires handling
 pixel data in two sets of 8 pixels each. Incorrect implementations may fail
 to map correct colors for each pixel group (for example by using the color
 for the first group as the color for the second group or viceversa). However,
 tests that render using solid colors across the entire polygon won't catch
 these cases (since in that case the color is the same for boths groups of
 pixels).

 This test blends using a checker board pattern where each cell is
 10px wide and 10px tall. This makes it so that the two sets of 8 pixels
 issued during SIMD16 operation pack different color data for the pixels
 involved, enabling testing of correct behavior in that case.
 ---
 This is the same patch Iago sent, just rebased on today's all.py changes.

 Iago, the test doesn't seem to open a window. I expected it would render
 to an offscreen FBO but then blit to a window to display if -auto wasn't
 passed.

Ugh, I apparently used the message-id of the corresponding Mesa patch
in reply-to instead of the piglit test.
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] spec/arb_blend_func_extended: Add test for SIMD16 dual source blending

2015-03-05 Thread Iago Toral Quiroga
On Intel hardware at least, SIMD16 dual source rendering requires handling
pixel data in two sets of 8 pixels each. Incorrect implementations may fail
to map correct colors for each pixel group (for example by using the color
for the first group as the color for the second group or viceversa). However,
tests that render using solid colors across the entire polygon won't catch
these cases (since in that case the color is the same for boths groups of
pixels).

This test blends using a checker board pattern where each cell is
10px wide and 10px tall. This makes it so that the two sets of 8 pixels
issued during SIMD16 operation pack different color data for the pixels
involved, enabling testing of correct behavior in that case.
---

I sent this a few months ago, but since my SIMD16 dual source blending patch
for i965 never got reviewed this never became relevant. I have now updated my
version of that patch and hopefully I'll get it reviewed this time, so I am
sending the test here again too.

 tests/all.py   |   1 +
 .../execution/CMakeLists.gl.txt|   1 +
 .../execution/fbo-extended-blend-pattern.c | 209 +
 3 files changed, 211 insertions(+)
 create mode 100644 
tests/spec/arb_blend_func_extended/execution/fbo-extended-blend-pattern.c

diff --git a/tests/all.py b/tests/all.py
index d2ae5ea..1cc6e5f 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -3666,6 +3666,7 @@ add_plain_test(arb_blend_func_extended, 
['arb_blend_func_extended-error-at-begin
 add_plain_test(arb_blend_func_extended, 
['arb_blend_func_extended-getfragdataindex'])
 add_plain_test(arb_blend_func_extended, 
['arb_blend_func_extended-fbo-extended-blend'])
 add_plain_test(arb_blend_func_extended, 
['arb_blend_func_extended-fbo-extended-blend-explicit'])
+add_plain_test(arb_blend_func_extended, 
['arb_blend_func_extended-fbo-extended-blend-pattern'])
 
 arb_base_instance = {}
 spec['ARB_base_instance'] = arb_base_instance
diff --git a/tests/spec/arb_blend_func_extended/execution/CMakeLists.gl.txt 
b/tests/spec/arb_blend_func_extended/execution/CMakeLists.gl.txt
index ebe0fa0..1db7fa1 100644
--- a/tests/spec/arb_blend_func_extended/execution/CMakeLists.gl.txt
+++ b/tests/spec/arb_blend_func_extended/execution/CMakeLists.gl.txt
@@ -12,4 +12,5 @@ link_libraries (
 
 piglit_add_executable (arb_blend_func_extended-fbo-extended-blend 
fbo-extended-blend.c)
 piglit_add_executable (arb_blend_func_extended-fbo-extended-blend-explicit 
fbo-extended-blend-explicit.c)
+piglit_add_executable (arb_blend_func_extended-fbo-extended-blend-pattern 
fbo-extended-blend-pattern.c)
 # vim: ft=cmake:
diff --git 
a/tests/spec/arb_blend_func_extended/execution/fbo-extended-blend-pattern.c 
b/tests/spec/arb_blend_func_extended/execution/fbo-extended-blend-pattern.c
new file mode 100644
index 000..488c380
--- /dev/null
+++ b/tests/spec/arb_blend_func_extended/execution/fbo-extended-blend-pattern.c
@@ -0,0 +1,209 @@
+/*
+ * Copyright (c) 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.
+ */
+
+/**
+ * @file fbo-extended-blend-pattern.c
+ * @author Iago Toral Quiroga ito...@igalia.com
+ *
+ * On Intel hardware at least, SIMD16 dual source rendering requires handling
+ * pixel data in two sets of 8 pixels each. Incorrect implementations may fail
+ * to map correct colors for each pixel group (for example by using the color
+ * for the first group as the color for the second group or viceversa). 
However,
+ * tests that render using solid colors across the entire polygon won't catch
+ * these cases (since in that case the color is the same for boths groups of
+ * pixels).
+ *
+ * This test blends using a checker board pattern where each cell is
+ * 10px wide and 10px tall. This makes it so that the two sets of 8 pixels
+ * issued during SIMD16 operation pack different color data for the pixels
+ * involved, 

[Piglit] [PATCH] spec/arb_blend_func_extended: Add test for SIMD16 dual source blending

2014-09-18 Thread Iago Toral Quiroga
On Intel hardware at least, SIMD16 dual source rendering requires handling
pixel data in two sets of 8 pixels each. Incorrect implementations may fail
to map correct colors for each pixel group (for example by using the color
for the first group as the color for the second group or viceversa). However,
tests that render using solid colors across the entire polygon won't catch
these cases (since in that case the color is the same for boths groups of
pixels).

This test blends using a checker board pattern where each cell is
10px wide and 10px tall. This makes it so that the two sets of 8 pixels
issued during SIMD16 operation pack different color data for the pixels
involved, enabling testing of correct behavior in that case.
---
 tests/all.py   |   1 +
 .../execution/CMakeLists.gl.txt|   2 +
 .../execution/fbo-extended-blend-pattern.c | 208 +
 3 files changed, 211 insertions(+)
 create mode 100644 
tests/spec/arb_blend_func_extended/execution/fbo-extended-blend-pattern.c

diff --git a/tests/all.py b/tests/all.py
index 2732eb6..efc03f6 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -3529,6 +3529,7 @@ add_plain_test(arb_blend_func_extended, 
'arb_blend_func_extended-error-at-begin'
 add_plain_test(arb_blend_func_extended, 
'arb_blend_func_extended-getfragdataindex')
 add_plain_test(arb_blend_func_extended, 
'arb_blend_func_extended-fbo-extended-blend')
 add_plain_test(arb_blend_func_extended, 
'arb_blend_func_extended-fbo-extended-blend-explicit')
+add_plain_test(arb_blend_func_extended, 
'arb_blend_func_extended-fbo-extended-blend-pattern')
 
 arb_base_instance = {}
 spec['ARB_base_instance'] = arb_base_instance
diff --git a/tests/spec/arb_blend_func_extended/execution/CMakeLists.gl.txt 
b/tests/spec/arb_blend_func_extended/execution/CMakeLists.gl.txt
index ebe0fa0..f728306 100644
--- a/tests/spec/arb_blend_func_extended/execution/CMakeLists.gl.txt
+++ b/tests/spec/arb_blend_func_extended/execution/CMakeLists.gl.txt
@@ -12,4 +12,6 @@ link_libraries (
 
 piglit_add_executable (arb_blend_func_extended-fbo-extended-blend 
fbo-extended-blend.c)
 piglit_add_executable (arb_blend_func_extended-fbo-extended-blend-explicit 
fbo-extended-blend-explicit.c)
+piglit_add_executable (arb_blend_func_extended-fbo-extended-blend-pattern 
fbo-extended-blend-pattern.c)
+
 # vim: ft=cmake:
diff --git 
a/tests/spec/arb_blend_func_extended/execution/fbo-extended-blend-pattern.c 
b/tests/spec/arb_blend_func_extended/execution/fbo-extended-blend-pattern.c
new file mode 100644
index 000..a1cbaaf
--- /dev/null
+++ b/tests/spec/arb_blend_func_extended/execution/fbo-extended-blend-pattern.c
@@ -0,0 +1,208 @@
+/*
+ * Copyright (c) 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.
+ */
+
+/**
+ * @file fbo-extended-blend-pattern.c
+ * @author Iago Toral Quiroga ito...@igalia.com
+ *
+ * On Intel hardware at least, SIMD16 dual source rendering requires handling
+ * pixel data in two sets of 8 pixels each. Incorrect implementations may fail
+ * to map correct colors for each pixel group (for example by using the color
+ * for the first group as the color for the second group or viceversa). 
However,
+ * tests that render using solid colors across the entire polygon won't catch
+ * these cases (since in that case the color is the same for boths groups of
+ * pixels).
+ *
+ * This test blends using a checker board pattern where each cell is
+ * 10px wide and 10px tall. This makes it so that the two sets of 8 pixels
+ * issued during SIMD16 operation pack different color data for the pixels
+ * involved, enabling testing of correct behavior in that case.
+ *
+ * This only tests with one specific blend mode. There is no need to test
+ * others, since the details of SIMD16 operation are independent of the
+ * specific blend mode we use and general testing of the multiple blend