Re: [Piglit] [PATCH] arb_gpu_shader_fp64: Add tests to check float to double conversion under non-uniform control flow

2016-10-16 Thread Samuel Iglesias Gonsálvez


On 14/10/16 11:22, Nicolai Hähnle wrote:
> On 13.10.2016 11:45, Samuel Iglesias Gonsálvez wrote:
>> We found issues with this case while developing i965's Ivybridge patches
>> to support arb_gpu_shader_fp64.
>>
>> Signed-off-by: Samuel Iglesias Gonsálvez 
>> ---
>>  tests/all.py   |   2 +
>>  tests/spec/arb_gpu_shader_fp64/CMakeLists.gl.txt   |   2 +
>>  .../fs-non-uniform-control-flow-f2d.c  | 135
>> +
>>  .../vs-non-uniform-control-flow-f2d.c  | 166
>> +
> 
> Couldn't this work as a shader_test? I wouldn't insist on that, but
> especially with the recent upgrade of shader_runner, that's generally
> preferable.
> 

Right. I will do it, please ignore this patch.

> 
>>  4 files changed, 305 insertions(+)
>>  create mode 100644
>> tests/spec/arb_gpu_shader_fp64/fs-non-uniform-control-flow-f2d.c
>>  create mode 100644
>> tests/spec/arb_gpu_shader_fp64/vs-non-uniform-control-flow-f2d.c
>>
>> diff --git a/tests/all.py b/tests/all.py
>> index 6d5826c..fec7137 100644
>> --- a/tests/all.py
>> +++ b/tests/all.py
>> @@ -2211,6 +2211,8 @@ with profile.group_manager(
>>  g(['arb_gpu_shader_fp64-fs-non-uniform-control-flow-alu'])
>>  g(['arb_gpu_shader_fp64-vs-non-uniform-control-flow-packing'])
>>  g(['arb_gpu_shader_fp64-fs-non-uniform-control-flow-packing'])
>> +g(['arb_gpu_shader_fp64-vs-non-uniform-control-flow-f2d'])
>> +g(['arb_gpu_shader_fp64-fs-non-uniform-control-flow-f2d'])
>>
>>  with profile.group_manager(
>>  PiglitGLTest,
>> diff --git a/tests/spec/arb_gpu_shader_fp64/CMakeLists.gl.txt
>> b/tests/spec/arb_gpu_shader_fp64/CMakeLists.gl.txt
>> index 209442f..d9f5dd5 100644
>> --- a/tests/spec/arb_gpu_shader_fp64/CMakeLists.gl.txt
>> +++ b/tests/spec/arb_gpu_shader_fp64/CMakeLists.gl.txt
>> @@ -19,3 +19,5 @@ piglit_add_executable
>> (arb_gpu_shader_fp64-fs-non-uniform-control-flow-alu fs-no
>>  piglit_add_executable
>> (arb_gpu_shader_fp64-vs-non-uniform-control-flow-alu
>> vs-non-uniform-control-flow-alu.c)
>>  piglit_add_executable
>> (arb_gpu_shader_fp64-fs-non-uniform-control-flow-packing
>> fs-non-uniform-control-flow-packing.c)
>>  piglit_add_executable
>> (arb_gpu_shader_fp64-vs-non-uniform-control-flow-packing
>> vs-non-uniform-control-flow-packing.c)
>> +piglit_add_executable
>> (arb_gpu_shader_fp64-fs-non-uniform-control-flow-f2d
>> fs-non-uniform-control-flow-f2d.c)
>> +piglit_add_executable
>> (arb_gpu_shader_fp64-vs-non-uniform-control-flow-f2d
>> vs-non-uniform-control-flow-f2d.c)
>> diff --git
>> a/tests/spec/arb_gpu_shader_fp64/fs-non-uniform-control-flow-f2d.c
>> b/tests/spec/arb_gpu_shader_fp64/fs-non-uniform-control-flow-f2d.c
>> new file mode 100644
>> index 000..b701dd0
>> --- /dev/null
>> +++ b/tests/spec/arb_gpu_shader_fp64/fs-non-uniform-control-flow-f2d.c
>> @@ -0,0 +1,135 @@
>> +/*
>> + * Copyright © 2016 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 fs-non-uniform-control-flow-f2d.c
>> + *
>> + * It checks that a float to double conversion works correctly when
>> it is
>> + * under non-uniform control flow.
>> + */
>> +
>> +#include "piglit-util-gl.h"
>> +
>> +PIGLIT_GL_TEST_CONFIG_BEGIN
>> +config.window_width = 62;
>> +config.window_height = 62;
> 
> I remember something about small window sizes being a problem on
> Windows. Did the exact window size matter for the driver bug? The rest
> of the test looks like it should be window size agnostic. (The same for
> the second test.)

It doesn't matter for the bug. I will fix this.

> 
> Apart from that:
> 
> Reviewed-by: Nicolai Hähnle 
> 

Thanks for the review!

Sam

> 
>> +config.supports_gl_compat_version = 32;
>> +config.supports_gl_core_version = 32;
>> +config.window_visual = PIGLIT_G

Re: [Piglit] [PATCH] arb_gpu_shader_fp64: Add tests to check float to double conversion under non-uniform control flow

2016-10-14 Thread Nicolai Hähnle

On 13.10.2016 11:45, Samuel Iglesias Gonsálvez wrote:

We found issues with this case while developing i965's Ivybridge patches
to support arb_gpu_shader_fp64.

Signed-off-by: Samuel Iglesias Gonsálvez 
---
 tests/all.py   |   2 +
 tests/spec/arb_gpu_shader_fp64/CMakeLists.gl.txt   |   2 +
 .../fs-non-uniform-control-flow-f2d.c  | 135 +
 .../vs-non-uniform-control-flow-f2d.c  | 166 +


Couldn't this work as a shader_test? I wouldn't insist on that, but 
especially with the recent upgrade of shader_runner, that's generally 
preferable.




 4 files changed, 305 insertions(+)
 create mode 100644 
tests/spec/arb_gpu_shader_fp64/fs-non-uniform-control-flow-f2d.c
 create mode 100644 
tests/spec/arb_gpu_shader_fp64/vs-non-uniform-control-flow-f2d.c

diff --git a/tests/all.py b/tests/all.py
index 6d5826c..fec7137 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -2211,6 +2211,8 @@ with profile.group_manager(
 g(['arb_gpu_shader_fp64-fs-non-uniform-control-flow-alu'])
 g(['arb_gpu_shader_fp64-vs-non-uniform-control-flow-packing'])
 g(['arb_gpu_shader_fp64-fs-non-uniform-control-flow-packing'])
+g(['arb_gpu_shader_fp64-vs-non-uniform-control-flow-f2d'])
+g(['arb_gpu_shader_fp64-fs-non-uniform-control-flow-f2d'])

 with profile.group_manager(
 PiglitGLTest,
diff --git a/tests/spec/arb_gpu_shader_fp64/CMakeLists.gl.txt 
b/tests/spec/arb_gpu_shader_fp64/CMakeLists.gl.txt
index 209442f..d9f5dd5 100644
--- a/tests/spec/arb_gpu_shader_fp64/CMakeLists.gl.txt
+++ b/tests/spec/arb_gpu_shader_fp64/CMakeLists.gl.txt
@@ -19,3 +19,5 @@ piglit_add_executable 
(arb_gpu_shader_fp64-fs-non-uniform-control-flow-alu fs-no
 piglit_add_executable (arb_gpu_shader_fp64-vs-non-uniform-control-flow-alu 
vs-non-uniform-control-flow-alu.c)
 piglit_add_executable (arb_gpu_shader_fp64-fs-non-uniform-control-flow-packing 
fs-non-uniform-control-flow-packing.c)
 piglit_add_executable (arb_gpu_shader_fp64-vs-non-uniform-control-flow-packing 
vs-non-uniform-control-flow-packing.c)
+piglit_add_executable (arb_gpu_shader_fp64-fs-non-uniform-control-flow-f2d 
fs-non-uniform-control-flow-f2d.c)
+piglit_add_executable (arb_gpu_shader_fp64-vs-non-uniform-control-flow-f2d 
vs-non-uniform-control-flow-f2d.c)
diff --git a/tests/spec/arb_gpu_shader_fp64/fs-non-uniform-control-flow-f2d.c 
b/tests/spec/arb_gpu_shader_fp64/fs-non-uniform-control-flow-f2d.c
new file mode 100644
index 000..b701dd0
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/fs-non-uniform-control-flow-f2d.c
@@ -0,0 +1,135 @@
+/*
+ * Copyright © 2016 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 fs-non-uniform-control-flow-f2d.c
+ *
+ * It checks that a float to double conversion works correctly when it is
+ * under non-uniform control flow.
+ */
+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+   config.window_width = 62;
+   config.window_height = 62;


I remember something about small window sizes being a problem on 
Windows. Did the exact window size matter for the driver bug? The rest 
of the test looks like it should be window size agnostic. (The same for 
the second test.)


Apart from that:

Reviewed-by: Nicolai Hähnle 



+   config.supports_gl_compat_version = 32;
+   config.supports_gl_core_version = 32;
+   config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
+PIGLIT_GL_TEST_CONFIG_END
+
+static const char vs_pass_thru_text[] =
+   "#version 130\n"
+   "\n"
+   "in vec4 piglit_vertex;\n"
+   "void main() {\n"
+   "gl_Position = piglit_vertex;\n"
+   "}\n";
+
+static const char fs_source[] =
+   "#version 330\n"
+   "#extension GL_ARB_gpu_shader_fp64 : require\n"
+   "\n"
+   "out vec4 color;\n"
+   "\n"
+   "void main() {\n"
+   "int cx