Re: [Piglit] [PATCH v4] framework: Add a vulkan tests profile

2018-11-05 Thread Samuel Iglesias Gonsálvez
This patch and the second patch of the v3 patch series are:

Reviewed-by: Samuel Iglesias Gonsálvez 

Thanks,

Sam

On Monday, 5 November 2018 11:04:44 (CET) Neil Roberts wrote:
> This searches for files named *.vk_shader_test in the tests/vulkan
> directory and runs them with VkRunner. VkRunner is executed as an
> external dependency. It is found either with the vkrunner:bin config
> option, by setting the PIGLIT_VKRUNNER_BINARY environment variable, or
> just in the search path.
> 
> v2: Move VkShaderTest to piglit_test.py and rename to VkRunnerTest.
> Add future imports. Remove unused import.
> v3: Support the PIGLIT_VKRUNNER_BINARY variable to specify the
> location of VkRunner.
> v4: Add documentation to the README. Add an option in piglit.conf to
> set the binary location. (Suggested by Samuel Iglesias)
> ---
>  README.md | 17 -
>  framework/test/piglit_test.py | 23 +++
>  piglit.conf.example   |  4 
>  tests/vulkan.py   | 33 +
>  4 files changed, 76 insertions(+), 1 deletion(-)
>  create mode 100644 tests/vulkan.py
> 
> diff --git a/README.md b/README.md
> index 2ae0febc6..c75c5f6c3 100644
> --- a/README.md
> +++ b/README.md
> @@ -47,6 +47,8 @@ Optionally, you can install the following:
>  (https://simplejson.readthedocs.org/en/latest/)
>- jsonstreams. A JSON stream writer for python.
>  (https://jsonstreams.readthedocs.io/en/stable/)
> +  - VkRunner. A shader script testing tool for Vulkan.
> +(https://github.com/igalia/vkrunner)
> 
>  For Python 2.x you can install the following to add features, these are
>  unnecessary for python3:
> @@ -285,6 +287,13 @@ behaves.
>  When this variable is true in python then any timeouts given by tests
>  will be ignored, and they will run until completion or they are killed.
> 
> +  - `PIGLIT_VKRUNNER_BINARY`
> +
> +Can be used to override the path to the vkrunner executable for
> +running Vulkan shader tests. Alternatively the config option
> +vkrunner:bin can be used instead. If neither are set then vkrunner
> +will be searched for in the search path.
> +
> 
>  ### 3.2 Note
> 
> @@ -338,7 +347,13 @@ The following test sets are currently available:
>  opencv and oclconform.
> 
> 
> -### 4.3 External Integration
> +### 4.3 Vulkan tests
> +
> +  - **vulkan.py** This suite contains all Vulkan tests. Note that
> +currently all of the Vulkan tests require VkRunner. If it is not
> +installed then all of the tests will be skipped.
> +
> +### 4.4 External Integration
> 
>- **xts.py** Support for running the X Test Suite using piglit.
>- **igt.py** Support for running Intel-gpu-tools test suite using piglit.
> diff --git a/framework/test/piglit_test.py b/framework/test/piglit_test.py
> index f52915d18..c80e355d1 100644
> --- a/framework/test/piglit_test.py
> +++ b/framework/test/piglit_test.py
> @@ -44,6 +44,7 @@ __all__ = [
>  'PiglitCLTest',
>  'PiglitGLTest',
>  'PiglitBaseTest',
> +'VkRunnerTest',
>  'CL_CONCURRENT',
>  'ROOT_DIR',
>  'TEST_BIN_DIR',
> @@ -229,3 +230,25 @@ class CLProgramTester(PiglitCLTest):
>  command = super(CLProgramTester, self).command
>  command.insert(1, os.path.join(ROOT_DIR, self.filename))
>  return command
> +
> +
> +class VkRunnerTest(PiglitBaseTest):
> +""" Make a PiglitTest instance for a VkRunner shader test file """
> +
> +def __init__(self, filename):
> +vkrunner_bin = os.environ.get('PIGLIT_VKRUNNER_BINARY')
> +
> +if vkrunner_bin is None:
> +vkrunner_bin = core.PIGLIT_CONFIG.safe_get(
> +'vkrunner', 'bin', fallback='vkrunner')
> +
> +super(VkRunnerTest, self).__init__(
> +[vkrunner_bin, filename],
> +run_concurrent=True)
> +
> +@PiglitBaseTest.command.getter
> +def command(self):
> +# This is overriden because we don’t want PiglitBaseTest to
> +# prepend TEST_BIN_DIR so that it will look for vkrunner in
> +# the search path.
> +return self._command
> diff --git a/piglit.conf.example b/piglit.conf.example
> index 5d1ff5474..1877187df 100644
> --- a/piglit.conf.example
> +++ b/piglit.conf.example
> @@ -187,6 +187,10 @@ run_test=./%(test_name)s
>  ; Default: True
>  ;process isolation=True
> 
> +[vkrunner]
> +; Path to the VkRunner executable
> +; bin=/home/neil/local/bin/vkrunner
> +
>  [expected-failures]
&g

Re: [Piglit] [PATCH v2 0/2] Vulkan testing with VkRunner

2018-11-04 Thread Samuel Iglesias Gonsálvez
Hello Neil,

On Saturday, 3 November 2018 8:03:42 (CET) Neil Roberts wrote:
> Here is a second attempt at incorporating VkRunner into Piglit. This
> time, instead of copying the source code into Piglit, it now just
> executes the VkRunner executable is an external dependency. I think
> there is now more interest in maintaining VkRunner as a separate repo
> because it may later be integrated into other testing frameworks as
> well such as CTS.
> 
> If the executable is not found then Piglit will automatically report
> the test as skipped. It will normally be searched for in the PATH, but
> its location can be overridden with the PIGLIT_VKRUNNER_BINARY
> environment variable.
> 

Thanks for submitting this patch series. I really like it :-)

Just a couple of comments:

* It would be great if we can add piglit.conf support to define where the 
vkrunner binary is. For example:

[vkrunner]
bin=/build/src/vkrunner

* Please add some documentation on the README.md file like: where VkRunner can 
be cloned from, the environment variable, the piglit.conf change (see above), 
etc.

With these two changes, I think the patch series should be ready for its merge 
:-)

Sam

> The VkRunner repo can be found here:
> https://github.com/igalia/vkrunner
> 
> In the meantime since the last patch series, VkRunner has been
> continuously developed and has gained features. Notably for Piglit, it
> now works on Windows including building with Visual Studio. It has
> also switched to using CMake for the build system.
> 
> Neil Roberts (2):
>   framework: Add a vulkan tests profile
>   vulkan: Add some tests for glsl450 builtin functions using doubles
> 
>  framework/test/piglit_test.py | 17 
>  tests/vulkan.py   | 33 +++
>  .../face-forward-double.vk_shader_test| 88 +++
>  .../glsl450/frexp-double.vk_shader_test   | 61 +
>  .../glsl450/isinf-double.vk_shader_test   | 81 +
>  .../glsl450/reflect-double.vk_shader_test | 55 
>  .../glsl450/refract-double.vk_shader_test | 88 +++
>  7 files changed, 423 insertions(+)
>  create mode 100644 tests/vulkan.py
>  create mode 100644 tests/vulkan/glsl450/face-forward-double.vk_shader_test
>  create mode 100644 tests/vulkan/glsl450/frexp-double.vk_shader_test
>  create mode 100644 tests/vulkan/glsl450/isinf-double.vk_shader_test
>  create mode 100644 tests/vulkan/glsl450/reflect-double.vk_shader_test
>  create mode 100644 tests/vulkan/glsl450/refract-double.vk_shader_test



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


[Piglit] XDC 2018: Call for Papers

2018-04-03 Thread Samuel Iglesias Gonsálvez
Hello,

I have the pleasure to announce that the X.org Developer Conference 2018
will be held in A Coruña, Spain from September 26th to September 28th.
The venue is located at the Computer Science faculty of the University
of Coruña.

This year, we have created a new website for the event:

https://xdc2018.x.org

And a Twitter account for announcing updates, please follow us!

https://twitter.com/xdc2018

However, we are going to keep updating the good old wiki too:

https://www.x.org/wiki/Events/XDC2018

As usual, we are open to talks across the layers of the graphics stack,
from the kernel to desktop environments / graphical applications and
about how to make things better for the developers who build them. Other
topics such as Virtual Reality are also welcome. If you're not sure if
something might fit, mail us or add it to the ideas list found in the
program page at:

https://www.x.org/wiki/Events/XDC2018/Program/

The Call for Papers information is here: https://xdc2018.x.org/#cfp.
Remember, the deadline for submissions is Wednesday 25th July 2018 17:00
UTC. Don't forget to send your proposals to bo...@foundation.x.org!

The conference is free of charge and open to the general public. If you
plan on coming, please add yourself to the attendees list:

https://www.x.org/wiki/Events/XDC2018/Attendees/

We'll use this list of attendees to make badges and plan for the
catering, so if you are attending please add your name as early as
possible.

I am looking forward to seeing you there. If you have any
inquiries/questions, please send an email to xdc2...@gpul.org, adding on
CC the X.org board (bo...@foundation.x.org).

Best regards,

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


Re: [Piglit] [PATCH v2] built-in-constants: check required GLSL versions for #extensions

2018-01-08 Thread Samuel Iglesias Gonsálvez
Reviewed-by: Samuel Iglesias Gonsálvez 


On 08/01/18 13:58, Juan A. Suarez Romero wrote:
> Please, could someone review this patch? Thank you in advance
>
>
>   J.A.
>
> On Tue, 2017-11-14 at 20:31 +0100, Juan A. Suarez Romero wrote:
>> GL_OES_geometry_shader and GL_OES_tessellation_shader specifications
>> require OpenGL ES Shading Language 3.10.
>>
>> So do not declare those extensions in shaders using older GLSL versions.
>> ---
>>  tests/shaders/built-in-constants.c | 5 -
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/tests/shaders/built-in-constants.c 
>> b/tests/shaders/built-in-constants.c
>> index d470fe1bf..32cd2638f 100644
>> --- a/tests/shaders/built-in-constants.c
>> +++ b/tests/shaders/built-in-constants.c
>> @@ -462,6 +462,7 @@ piglit_init(int argc, char **argv)
>>   * before version 3.20.
>>   */
>>  if (es_shader && required_glsl_version < 320 &&
>> +required_glsl_version >= 310 &&
>>  piglit_is_extension_supported("GL_OES_geometry_shader")) {
>>  assert(num_required_extensions < 
>> ARRAY_SIZE(required_extensions));
>>  required_extensions[num_required_extensions] =
>> @@ -473,7 +474,9 @@ piglit_init(int argc, char **argv)
>>  const char *const tess_ext_name = es_shader
>>  ? "GL_OES_tessellation_shader"
>>  : "GL_ARB_tessellation_shader";
>> -if (piglit_is_extension_supported(tess_ext_name)) {
>> +if (((es_shader && required_glsl_version >= 310) ||
>> +!es_shader) &&
>> +piglit_is_extension_supported(tess_ext_name)) {
>>  assert(num_required_extensions < 
>> ARRAY_SIZE(required_extensions));
>>  required_extensions[num_required_extensions] =
>>  strdup(tess_ext_name);
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit



signature.asc
Description: OpenPGP digital signature
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] arb_shader_storage_buffer_object: don't do out-of-bounds writes

2017-08-24 Thread Samuel Iglesias Gonsálvez
From GLGL 4.5 spec, 5.11 "Out-of-Bounds Accesses":

"In the subsections described above for array, vector, matrix and
 structure accesses, any out-of-bounds access produced undefined
 behavior. However, if robust buffer access is enabled via the
 OpenGL API, such accesses will be bound within the memory extent
 of the active program."

These tests perform writes to an unsized array, however some of
these writes can be out-of-bounds and the result is undefined. As
the tests are focused on in-bound access and they don't enable
robust buffer access, then this patch removes the out-of-bounds writes
because we cannot assume they will be ignored.

Signed-off-by: Samuel Iglesias Gonsálvez 
Cc: ahuil...@nvidia.com
---
 .../arb_shader_storage_buffer_object/layout-std140-write-shader.c   | 6 --
 .../arb_shader_storage_buffer_object/layout-std430-write-shader.c   | 6 --
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git 
a/tests/spec/arb_shader_storage_buffer_object/layout-std140-write-shader.c 
b/tests/spec/arb_shader_storage_buffer_object/layout-std140-write-shader.c
index c67248e7a..914fc000f 100644
--- a/tests/spec/arb_shader_storage_buffer_object/layout-std140-write-shader.c
+++ b/tests/spec/arb_shader_storage_buffer_object/layout-std140-write-shader.c
@@ -63,7 +63,8 @@ static const char vs_pass_thru_text[] =
"   f = 4.0;\n"
"   s.a2[0] = vec2(6.0, 7.0); \n"
"   int index = int(v.x); // index should be zero\n"
-   "   unsized_array[index + gl_VertexID] = unsized_array.length();\n"
+   "   if ((index + gl_VertexID) < 4)\n"
+   "  unsized_array[index + gl_VertexID] = 
unsized_array.length();\n"
 "}\n";
 
 static const char fs_source[] =
@@ -91,7 +92,8 @@ static const char fs_source[] =
"   s.a2[1] = vec2(8.0, 9.0);\n"
"   s.a4 = mat2(10.0, 11.0, 12.0, 13.0);\n"
"   int index = int(v.z + gl_FragCoord.x);\n"
-   "   unsized_array[index] = unsized_array.length() * 2.0;\n"
+   "   if (index >= 0 && index < 4)\n"
+   "  unsized_array[index] = unsized_array.length() * 2.0;\n"
"}\n";
 
 GLuint prog;
diff --git 
a/tests/spec/arb_shader_storage_buffer_object/layout-std430-write-shader.c 
b/tests/spec/arb_shader_storage_buffer_object/layout-std430-write-shader.c
index 70c87a164..3d5dcdc47 100644
--- a/tests/spec/arb_shader_storage_buffer_object/layout-std430-write-shader.c
+++ b/tests/spec/arb_shader_storage_buffer_object/layout-std430-write-shader.c
@@ -86,7 +86,8 @@ static const char vs_pass_thru_text[] =
"   v3a[0].xz = vec2(39.0, 41.0);\n"
"   v3a[1].y = 43.0;\n"
"   int index = int(v.x); // index should be zero\n"
-   "   unsized_array[index + gl_VertexID] = unsized_array.length();\n"
+   "   if ((index + gl_VertexID) < 4)\n"
+   "  unsized_array[index + gl_VertexID] = 
unsized_array.length();\n"
"}\n";
 
 static const char fs_source[] =
@@ -126,7 +127,8 @@ static const char fs_source[] =
"   v3a[0].y = 40.0;\n"
"   v3a[1].xz = vec2(42.0, 44.0);\n"
"   int index = int(v.z + gl_FragCoord.x);\n"
-   "   unsized_array[index] = unsized_array.length() * 2.0;\n"
+   "   if (index >= 0 && index < 4)\n"
+   "  unsized_array[index] = unsized_array.length() * 2.0;\n"
"}\n";
 
 GLuint prog;
-- 
2.14.1

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


Re: [Piglit] [PATCH 2/2] arb_gpu_shader_fp64: add non-uniform control flow test for indirect addressing

2017-02-27 Thread Samuel Iglesias Gonsálvez


On 24/02/17 20:39, Anuj Phogat wrote:
> On Tue, Feb 14, 2017 at 2:20 AM, Samuel Iglesias Gonsálvez
>  wrote:
>> Signed-off-by: Samuel Iglesias Gonsálvez 
>> ---
>>  ...t-indirect-non-uniform-control-flow.shader_test | 52 +
>>  ...t-indirect-non-uniform-control-flow.shader_test | 68 
>> ++
>>  2 files changed, 120 insertions(+)
>>  create mode 100644 
>> tests/spec/arb_gpu_shader_fp64/execution/fs-double-uniform-array-direct-indirect-non-uniform-control-flow.shader_test
>>  create mode 100644 
>> tests/spec/arb_gpu_shader_fp64/execution/vs-double-uniform-array-direct-indirect-non-uniform-control-flow.shader_test
>>
>> diff --git 
>> a/tests/spec/arb_gpu_shader_fp64/execution/fs-double-uniform-array-direct-indirect-non-uniform-control-flow.shader_test
>>  
>> b/tests/spec/arb_gpu_shader_fp64/execution/fs-double-uniform-array-direct-indirect-non-uniform-control-flow.shader_test
>> new file mode 100644
>> index 0..f2d4ac592
>> --- /dev/null
>> +++ 
>> b/tests/spec/arb_gpu_shader_fp64/execution/fs-double-uniform-array-direct-indirect-non-uniform-control-flow.shader_test
>> @@ -0,0 +1,52 @@
>> +[require]
>> +GLSL >= 4.00
>> +GL_ARB_gpu_shader_fp64
>> +
>> +[vertex shader passthrough]
>> +
>> +[fragment shader]
>> +#extension GL_ARB_gpu_shader_fp64 : enable
>> +
>> +uniform double arg0;
>> +uniform double tolerance;
>> +uniform dvec4 expected;
>> +
>> +uniform double arg[7];
>> +out vec4 color;
>> +
>> +void main()
>> +{
>> +   int index;
>> +   double tol = tolerance;
>> +   vec4 color2 = vec4(0.0, 1.0, 0.0, 1.0);
>> +   float cx = gl_FragCoord.x;
>> +   float cy = gl_FragCoord.y;
>> +   if (cx == cy) {
>> + index = int(arg[6]);
>> +   } else {
>> + index = int(arg[5]);
>> + tol = 0.35;
> tol = 0.1; ?

Good catch but actually tolerance should be 0.2 in this case:

* Distance is calculated as length(p1 - p0)
* Length is calculated as sqrt(x²+y²+z²+w²) for a 4-component vector.

In this case:

p1 - p0 = (0.1, 0.1, 0.1, 0.1)
distance = sqrt(x²+y²+z²+w²) = sqrt(0.01 + 0.01 + 0.01 + 0.01) =
sqrt(0.04) = 0.2


>> + color2 = vec4(0.0, 0.0, 1.0, 1.0);
>> +   }
>> +   dvec4 result = dvec4(arg[index] + arg0);
>> +   color = distance(result, expected) <= tol
>> +   ? color2 : vec4(1.0, 0.0, 0.0, 1.0);
>> +}
>> +
>> +[test]
>> +clear color 0.0 0.0 0.0 0.0
>> +
>> +clear
>> +uniform double arg0 0.25
>> +uniform double tolerance 0.0
>> +uniform dvec4 expected 0.65 0.65 0.65 0.65
>> +uniform double arg[0] 0.1
>> +uniform double arg[1] 0.2
>> +uniform double arg[2] 0.3
>> +uniform double arg[3] 0.4
>> +uniform double arg[4] 0.5
>> +uniform double arg[5] 2.0
>> +uniform double arg[6] 3.0
>> +draw rect -1 -1 2 2
>> +probe rgba 1 1 0.0 1.0 0.0 1.0
>> +probe rgba 1 0 0.0 0.0 1.0 1.0
>> diff --git 
>> a/tests/spec/arb_gpu_shader_fp64/execution/vs-double-uniform-array-direct-indirect-non-uniform-control-flow.shader_test
>>  
>> b/tests/spec/arb_gpu_shader_fp64/execution/vs-double-uniform-array-direct-indirect-non-uniform-control-flow.shader_test
>> new file mode 100644
>> index 0..80bcec7fc
>> --- /dev/null
>> +++ 
>> b/tests/spec/arb_gpu_shader_fp64/execution/vs-double-uniform-array-direct-indirect-non-uniform-control-flow.shader_test
>> @@ -0,0 +1,68 @@
>> +[require]
>> +GLSL >= 1.50
>> +GL_ARB_gpu_shader_fp64
>> +
>> +[vertex shader]
>> +#version 150
>> +#extension GL_ARB_gpu_shader_fp64 : require
>> +
>> +uniform double arg0;
>> +uniform dvec4 expected;
>> +
>> +uniform double arg[7];
>> +
>> +in vec4 piglit_vertex;
>> +flat out vec4 v;
>> +
>> +void main()
>> +{
>> +   gl_Position = piglit_vertex;
>> +
>> +   int index;
>> +   vec4 color2;
>> +   dvec4 result;
>> +   dvec4 exp;
>> +   double tol = 0.01;
>> +   if (gl_VertexID % 2 == 1) {
>> +  index = int(arg[6]);
>> +  color2 = vec4(0.0, 1.0, 0.0, 1.0);
>> +  result = dvec4(arg[index] + arg0);
>> +  exp = expected;
>> +   } else {
>> +  index = int(arg[5]);
>> +  color2 = vec4(0.0, 0.0, 1.0, 1.0);
>> +  result = dvec4(arg[index] + arg0);
> You can move above statement out of if-else block.

Right

>> +  exp = dvec4(0.55, 0.55, 0.5

[Piglit] [PATCH 1/2] arb_gpu_shader_fp64: fix vs-double-uniform-array-direct-indirect

2017-02-14 Thread Samuel Iglesias Gonsálvez
It was setting a wrong value in arg0.

Signed-off-by: Samuel Iglesias Gonsálvez 
---
 .../uniform_buffers/vs-double-uniform-array-direct-indirect.shader_test | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-double-uniform-array-direct-indirect.shader_test
 
b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-double-uniform-array-direct-indirect.shader_test
index 57873fae2..bc4702b4a 100644
--- 
a/tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-double-uniform-array-direct-indirect.shader_test
+++ 
b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/vs-double-uniform-array-direct-indirect.shader_test
@@ -37,7 +37,7 @@ void main()
 clear color 0.0 0.0 0.0 0.0
 
 clear
-uniform double arg0 0.25
+uniform double arg0 0.0
 uniform double tolerance 0.0
 uniform dvec4 expected 0.4 0.4 0.4 0.4
 uniform double arg[0] 0.1
-- 
2.11.0

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


[Piglit] [PATCH 2/2] arb_gpu_shader_fp64: add non-uniform control flow test for indirect addressing

2017-02-14 Thread Samuel Iglesias Gonsálvez
Signed-off-by: Samuel Iglesias Gonsálvez 
---
 ...t-indirect-non-uniform-control-flow.shader_test | 52 +
 ...t-indirect-non-uniform-control-flow.shader_test | 68 ++
 2 files changed, 120 insertions(+)
 create mode 100644 
tests/spec/arb_gpu_shader_fp64/execution/fs-double-uniform-array-direct-indirect-non-uniform-control-flow.shader_test
 create mode 100644 
tests/spec/arb_gpu_shader_fp64/execution/vs-double-uniform-array-direct-indirect-non-uniform-control-flow.shader_test

diff --git 
a/tests/spec/arb_gpu_shader_fp64/execution/fs-double-uniform-array-direct-indirect-non-uniform-control-flow.shader_test
 
b/tests/spec/arb_gpu_shader_fp64/execution/fs-double-uniform-array-direct-indirect-non-uniform-control-flow.shader_test
new file mode 100644
index 0..f2d4ac592
--- /dev/null
+++ 
b/tests/spec/arb_gpu_shader_fp64/execution/fs-double-uniform-array-direct-indirect-non-uniform-control-flow.shader_test
@@ -0,0 +1,52 @@
+[require]
+GLSL >= 4.00
+GL_ARB_gpu_shader_fp64
+
+[vertex shader passthrough]
+
+[fragment shader]
+#extension GL_ARB_gpu_shader_fp64 : enable
+
+uniform double arg0;
+uniform double tolerance;
+uniform dvec4 expected;
+
+uniform double arg[7];
+out vec4 color;
+
+void main()
+{
+   int index;
+   double tol = tolerance;
+   vec4 color2 = vec4(0.0, 1.0, 0.0, 1.0);
+   float cx = gl_FragCoord.x;
+   float cy = gl_FragCoord.y;
+   if (cx == cy) {
+ index = int(arg[6]);
+   } else {
+ index = int(arg[5]);
+ tol = 0.35;
+ color2 = vec4(0.0, 0.0, 1.0, 1.0);
+   }
+   dvec4 result = dvec4(arg[index] + arg0);
+   color = distance(result, expected) <= tol
+   ? color2 : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.0 0.0 0.0 0.0
+
+clear
+uniform double arg0 0.25
+uniform double tolerance 0.0
+uniform dvec4 expected 0.65 0.65 0.65 0.65
+uniform double arg[0] 0.1
+uniform double arg[1] 0.2
+uniform double arg[2] 0.3
+uniform double arg[3] 0.4
+uniform double arg[4] 0.5
+uniform double arg[5] 2.0
+uniform double arg[6] 3.0
+draw rect -1 -1 2 2
+probe rgba 1 1 0.0 1.0 0.0 1.0
+probe rgba 1 0 0.0 0.0 1.0 1.0
diff --git 
a/tests/spec/arb_gpu_shader_fp64/execution/vs-double-uniform-array-direct-indirect-non-uniform-control-flow.shader_test
 
b/tests/spec/arb_gpu_shader_fp64/execution/vs-double-uniform-array-direct-indirect-non-uniform-control-flow.shader_test
new file mode 100644
index 0..80bcec7fc
--- /dev/null
+++ 
b/tests/spec/arb_gpu_shader_fp64/execution/vs-double-uniform-array-direct-indirect-non-uniform-control-flow.shader_test
@@ -0,0 +1,68 @@
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader_fp64
+
+[vertex shader]
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : require
+
+uniform double arg0;
+uniform dvec4 expected;
+
+uniform double arg[7];
+
+in vec4 piglit_vertex;
+flat out vec4 v;
+
+void main()
+{
+   gl_Position = piglit_vertex;
+
+   int index;
+   vec4 color2;
+   dvec4 result;
+   dvec4 exp;
+   double tol = 0.01;
+   if (gl_VertexID % 2 == 1) {
+  index = int(arg[6]);
+  color2 = vec4(0.0, 1.0, 0.0, 1.0);
+  result = dvec4(arg[index] + arg0);
+  exp = expected;
+   } else {
+  index = int(arg[5]);
+  color2 = vec4(0.0, 0.0, 1.0, 1.0);
+  result = dvec4(arg[index] + arg0);
+  exp = dvec4(0.55, 0.55, 0.55, 0.55);
+  tol = 0.01;
+   }
+   v = distance(result, exp) <= tol
+   ? color2 : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 150
+
+flat in vec4 v;
+out vec4 color;
+
+void main()
+{
+   color = v;
+}
+
+[test]
+clear color 0.0 0.0 0.0 0.0
+
+clear
+uniform double arg0 0.25
+uniform dvec4 expected 0.65 0.65 0.65 0.65
+uniform double arg[0] 0.1
+uniform double arg[1] 0.2
+uniform double arg[2] 0.3
+uniform double arg[3] 0.4
+uniform double arg[4] 0.5
+uniform double arg[5] 2.0
+uniform double arg[6] 3.0
+draw rect -1 -1 2 2
+probe rgba 127 127 0.0 1.0 0.0 1.0
+probe rgba 1 1 0.0 0.0 1.0 1.0
-- 
2.11.0

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


[Piglit] [PATCH v2] arb_gpu_shader_fp64: add packDouble2x32 and unpackDouble2x32 tests for vertex shader

2016-12-21 Thread Samuel Iglesias Gonsálvez
Simple tests to make sure the packing is correct, along with constant
tests.

They are based on 04d7b02a.

v2: Removed vs-const* patches.

Signed-off-by: Samuel Iglesias Gonsálvez 
---
 .../vs-packDouble2x32.shader_test  | 59 ++
 .../vs-unpackDouble2x32-2.shader_test  | 57 +
 .../vs-unpackDouble2x32.shader_test| 54 
 3 files changed, 170 insertions(+)
 create mode 100644 
tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/vs-packDouble2x32.shader_test
 create mode 100644 
tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/vs-unpackDouble2x32-2.shader_test
 create mode 100644 
tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/vs-unpackDouble2x32.shader_test

diff --git 
a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/vs-packDouble2x32.shader_test
 
b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/vs-packDouble2x32.shader_test
new file mode 100644
index 000..c888773
--- /dev/null
+++ 
b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/vs-packDouble2x32.shader_test
@@ -0,0 +1,59 @@
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader_fp64
+
+[vertex shader]
+#extension GL_ARB_gpu_shader_fp64 : enable
+
+in vec4 vertex;
+out vec4 color;
+
+uniform double expected_doub;
+uniform uvec2 given_uval;
+
+void main() {
+   gl_Position = vertex;
+   /* Green if both pass. */
+   color = vec4(0.0, 1.0, 0.0, 1.0);
+
+   double packval;
+
+   packval = packDouble2x32(given_uval);
+
+   if (packval != expected_doub) {
+   color.r = 1.0;
+   }
+}
+
+[fragment shader]
+
+in vec4 color;
+out vec4 fs_color;
+
+void main()
+{
+   fs_color = color;
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0  1.0
+-1.0  1.0
+
+[test]
+uniform double expected_doub 0.0
+uniform uvec2 given_uval 0 0
+draw arrays GL_TRIANGLE_FAN 0 4
+probe rgba 0 0 0.0 1.0 0.0 1.0
+
+uniform double expected_doub 1.5
+uniform uvec2 given_uval 0 1073217536
+draw arrays GL_TRIANGLE_FAN 0 4
+probe rgba 1 0 0.0 1.0 0.0 1.0
+
+uniform double expected_doub 2.122e-311
+uniform uvec2 given_uval 8519181 1000
+draw arrays GL_TRIANGLE_FAN 0 4
+probe rgba 2 0 0.0 1.0 0.0 1.0
diff --git 
a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/vs-unpackDouble2x32-2.shader_test
 
b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/vs-unpackDouble2x32-2.shader_test
new file mode 100644
index 000..aa2a565
--- /dev/null
+++ 
b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/vs-unpackDouble2x32-2.shader_test
@@ -0,0 +1,57 @@
+# test unpack with a single channel specified
+# to demonstrate a bug in glsl->tgsi dead-code elimination
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader_fp64
+
+[vertex shader]
+#extension GL_ARB_gpu_shader_fp64 : enable
+
+in vec4 vertex;
+out vec4 color;
+
+uniform double given_doub;
+uniform uint expected_uval;
+
+void main()
+{
+   gl_Position = vertex;
+   /* Green if both pass. */
+   color = vec4(0.0, 1.0, 0.0, 1.0);
+
+   uint packval;
+
+   packval = unpackDouble2x32(abs(given_doub)).y;
+
+   if (packval != expected_uval) {
+   color.r = 1.0;
+   }
+}
+
+[fragment shader]
+
+in vec4 color;
+out vec4 fs_color;
+
+void main()
+{
+   fs_color = color;
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0  1.0
+-1.0  1.0
+
+[test]
+uniform double given_doub 0.0
+uniform uint expected_uval 0
+draw arrays GL_TRIANGLE_FAN 0 4
+probe rgba 0 0 0.0 1.0 0.0 1.0
+
+uniform double given_doub 1.5
+uniform uint expected_uval 1073217536
+draw arrays GL_TRIANGLE_FAN 0 4
+probe rgba 1 0 0.0 1.0 0.0 1.0
diff --git 
a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/vs-unpackDouble2x32.shader_test
 
b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/vs-unpackDouble2x32.shader_test
new file mode 100644
index 000..f6156cf
--- /dev/null
+++ 
b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/vs-unpackDouble2x32.shader_test
@@ -0,0 +1,54 @@
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader_fp64
+
+[vertex shader]
+#extension GL_ARB_gpu_shader_fp64 : enable
+in vec4 vertex;
+
+uniform double given_doub;
+uniform uvec2 expected_uval;
+
+out vec4 color;
+
+void main() {
+   gl_Position = vertex;
+   /* Green if both pass. */
+   color = vec4(0.0, 1.0, 0.0, 1.0);
+
+   uvec2 packval;
+
+   packval = unpackDouble2x32(given_doub);
+
+   if (packval != expected_uval) {
+   color.r = 1.0;
+   }
+}
+
+[fragment shader]
+
+in vec4 color;
+out vec4 fs_color;
+
+void main()
+{
+   fs_color = color;
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0  1.0
+-1.0  1.0
+
+[test]
+uniform double given_doub 0.0
+uniform uvec2 expected_uval 0 0
+draw arrays GL_TRIANGLE_FAN 0 4
+probe rgba 0 0 0.0 1.0 0.0 1.0
+
+uniform double given_doub 1.5
+uniform uvec2 expected_uval 0 1073217536

[Piglit] [PATCH] arb_gpu_shader_fp64: add packDouble2x32 and unpackDouble2x32 tests for vertex shader

2016-12-13 Thread Samuel Iglesias Gonsálvez
Simple tests to make sure the packing is correct, along with constant
tests.

They are based on 04d7b02a.

Signed-off-by: Samuel Iglesias Gonsálvez 
---
 .../vs-const-packDouble2x32.shader_test| 45 +
 .../vs-const-unpackDouble2x32.shader_test  | 45 +
 .../vs-packDouble2x32.shader_test  | 59 ++
 .../vs-unpackDouble2x32-2.shader_test  | 57 +
 .../vs-unpackDouble2x32.shader_test| 54 
 5 files changed, 260 insertions(+)
 create mode 100644 
tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/vs-const-packDouble2x32.shader_test
 create mode 100644 
tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/vs-const-unpackDouble2x32.shader_test
 create mode 100644 
tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/vs-packDouble2x32.shader_test
 create mode 100644 
tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/vs-unpackDouble2x32-2.shader_test
 create mode 100644 
tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/vs-unpackDouble2x32.shader_test

diff --git 
a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/vs-const-packDouble2x32.shader_test
 
b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/vs-const-packDouble2x32.shader_test
new file mode 100644
index 000..9198cc9
--- /dev/null
+++ 
b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/vs-const-packDouble2x32.shader_test
@@ -0,0 +1,45 @@
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader_fp64
+
+[vertex shader]
+#extension GL_ARB_gpu_shader_fp64 : enable
+
+#define STATIC_ASSERT(cond) { float array[(cond) ? -1 : 1]; }
+
+in vec4 vertex;
+out vec4 color;
+
+void main()
+{
+   gl_Position = vertex;
+   color = vec4(0.0, 1.0, 0.0, 1.0);
+
+   /* Compare the results after going through unpackDouble2x32() allows us
+* to distinguish -0.0f from 0.0f.
+*/
+   STATIC_ASSERT((packDouble2x32(uvec2(0, 0)) != 0.0lf));
+   STATIC_ASSERT((packDouble2x32(uvec2(0, 1073217536)) != 1.5lf));
+   STATIC_ASSERT((packDouble2x32(uvec2(1, 1000)) != 
2.1219957909657664e-311lf));
+}
+
+[fragment shader]
+
+in vec4 color;
+out vec4 fs_color;
+
+void main()
+{
+   fs_color = color;
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0  1.0
+-1.0  1.0
+
+[test]
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 0.0 1.0
diff --git 
a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/vs-const-unpackDouble2x32.shader_test
 
b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/vs-const-unpackDouble2x32.shader_test
new file mode 100644
index 000..67221be
--- /dev/null
+++ 
b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/vs-const-unpackDouble2x32.shader_test
@@ -0,0 +1,45 @@
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader_fp64
+
+[vertex shader]
+#extension GL_ARB_gpu_shader_fp64 : enable
+
+#define STATIC_ASSERT(cond) { float array[(cond) ? -1 : 1]; }
+
+in vec4 vertex;
+out vec4 color;
+
+void main()
+{
+   gl_Position = vertex;
+   color = vec4(0.0, 1.0, 0.0, 1.0);
+
+   /* Compare the results after going through unpackDouble2x32() allows us
+* to distinguish -0.0f from 0.0f.
+*/
+   STATIC_ASSERT((unpackDouble2x32(0.0lf) != uvec2(0, 0)));
+   STATIC_ASSERT((unpackDouble2x32(1.5lf) != uvec2(0, 1073217536)));
+   STATIC_ASSERT((unpackDouble2x32(2.1219957909657664e-311lf) != uvec2(1, 
1000)));
+}
+
+[fragment shader]
+
+in vec4 color;
+out vec4 fs_color;
+
+void main()
+{
+   fs_color = color;
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0  1.0
+-1.0  1.0
+
+[test]
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 0.0 1.0
diff --git 
a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/vs-packDouble2x32.shader_test
 
b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/vs-packDouble2x32.shader_test
new file mode 100644
index 000..c888773
--- /dev/null
+++ 
b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/vs-packDouble2x32.shader_test
@@ -0,0 +1,59 @@
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader_fp64
+
+[vertex shader]
+#extension GL_ARB_gpu_shader_fp64 : enable
+
+in vec4 vertex;
+out vec4 color;
+
+uniform double expected_doub;
+uniform uvec2 given_uval;
+
+void main() {
+   gl_Position = vertex;
+   /* Green if both pass. */
+   color = vec4(0.0, 1.0, 0.0, 1.0);
+
+   double packval;
+
+   packval = packDouble2x32(given_uval);
+
+   if (packval != expected_doub) {
+   color.r = 1.0;
+   }
+}
+
+[fragment shader]
+
+in vec4 color;
+out vec4 fs_color;
+
+void main()
+{
+   fs_color = color;
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0  1.0
+-1.0  1.0
+
+[test]
+uniform double expected_doub 0.0
+uniform uvec2 given_uval 0 0
+draw arrays GL_TRIANGLE_FAN 0 4
+probe rgba 0 0 0.0 1.0 0.0 1.0
+
+unifo

Re: [Piglit] [PATCH] gles-es-1.00: add linker test to check default precision qualifier redeclaration

2016-10-24 Thread Samuel Iglesias Gonsálvez


On 21/10/16 05:55, Timothy Arceri wrote:
> On Thu, 2016-10-20 at 12:37 +0200, Samuel Iglesias Gonsálvez wrote:
>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97804
>> Signed-off-by: Samuel Iglesias Gonsálvez 
>> ---
>>  ...t-precision-qualifier-redeclaration.shader_test | 34
>> ++
>>  1 file changed, 34 insertions(+)
>>  create mode 100644 tests/spec/glsl-es-1.00/linker/glsl-default-
>> precision-qualifier-redeclaration.shader_test
>>
>> diff --git a/tests/spec/glsl-es-1.00/linker/glsl-default-precision-
>> qualifier-redeclaration.shader_test b/tests/spec/glsl-es-
>> 1.00/linker/glsl-default-precision-qualifier-
>> redeclaration.shader_test
>> new file mode 100644
>> index 000..510ba20
>> --- /dev/null
>> +++ b/tests/spec/glsl-es-1.00/linker/glsl-default-precision-
>> qualifier-redeclaration.shader_test
>> @@ -0,0 +1,34 @@
>> +#
>> +# Test that vertex shader defaults to highp (only fragment shader
>> +# needs to specify float precision) and that later fragment shader
>> +# highp precision declaration overrides earlier mediump declaration.
>> +#
>> +[require]
>> +GL ES >= 2.0
>> +GLSL ES >= 1.00
>> +
>> +[vertex shader]
>> +
>> +uniform float a;
>> +
>> +void main(void)
>> +{
>> +gl_Position = vec4(a);
>> +}
>> +
>> +[fragment shader]
>> +#ifdef GL_ES
>> +precision mediump float;
>> +#endif
>> +#ifdef GL_ES
>> +precision highp float;
>> +#endif
> 
> The test is fine but I believe we need more tests for the scoping
> rules.
> 
> "The precision statement has the same scoping rules as variable 
> declarations. If it is declared inside a compound statement, its effect
> stops at the end of the innermost 
> statement it was declared in. Precision statements in nested scopes
> override precision statements in outer 
> scopes.

I verified these are already tested in:

tests/spec/glsl-es-1.00/compiler/precision-qualifiers/default-precision-nested-scope-0X.frag

with X from 1 to 4.

Multiple precision statements for the same basic type can
> appear inside the same scope, with later 
> statements overriding earlier statements within that scope"
> 
> This test only tests the last rule.
> 

Right.

So I think I can push this patch. Do you agree?

Sam

>> +
>> +uniform float a;
>> +
>> +void main(void)
>> +{
>> +gl_FragColor = vec4(a);
>> +}
>> +[test]
>> +link success
> 



signature.asc
Description: OpenPGP digital signature
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] gles-es-1.00: add linker test to check default precision qualifier redeclaration

2016-10-20 Thread Samuel Iglesias Gonsálvez


On 21/10/16 05:55, Timothy Arceri wrote:
> On Thu, 2016-10-20 at 12:37 +0200, Samuel Iglesias Gonsálvez wrote:
>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97804
>> Signed-off-by: Samuel Iglesias Gonsálvez 
>> ---
>>  ...t-precision-qualifier-redeclaration.shader_test | 34
>> ++
>>  1 file changed, 34 insertions(+)
>>  create mode 100644 tests/spec/glsl-es-1.00/linker/glsl-default-
>> precision-qualifier-redeclaration.shader_test
>>
>> diff --git a/tests/spec/glsl-es-1.00/linker/glsl-default-precision-
>> qualifier-redeclaration.shader_test b/tests/spec/glsl-es-
>> 1.00/linker/glsl-default-precision-qualifier-
>> redeclaration.shader_test
>> new file mode 100644
>> index 000..510ba20
>> --- /dev/null
>> +++ b/tests/spec/glsl-es-1.00/linker/glsl-default-precision-
>> qualifier-redeclaration.shader_test
>> @@ -0,0 +1,34 @@
>> +#
>> +# Test that vertex shader defaults to highp (only fragment shader
>> +# needs to specify float precision) and that later fragment shader
>> +# highp precision declaration overrides earlier mediump declaration.
>> +#
>> +[require]
>> +GL ES >= 2.0
>> +GLSL ES >= 1.00
>> +
>> +[vertex shader]
>> +
>> +uniform float a;
>> +
>> +void main(void)
>> +{
>> +gl_Position = vec4(a);
>> +}
>> +
>> +[fragment shader]
>> +#ifdef GL_ES
>> +precision mediump float;
>> +#endif
>> +#ifdef GL_ES
>> +precision highp float;
>> +#endif
> 
> The test is fine but I believe we need more tests for the scoping
> rules.
> 
> "The precision statement has the same scoping rules as variable 
> declarations. If it is declared inside a compound statement, its effect
> stops at the end of the innermost 
> statement it was declared in. Precision statements in nested scopes
> override precision statements in outer 
> scopes. Multiple precision statements for the same basic type can
> appear inside the same scope, with later 
> statements overriding earlier statements within that scope"
> 
> This test only tests the last rule.
> 

Thanks Timothy. I will write more tests to check the scoping rules.

Sam

>> +
>> +uniform float a;
>> +
>> +void main(void)
>> +{
>> +gl_FragColor = vec4(a);
>> +}
>> +[test]
>> +link success
> 



signature.asc
Description: OpenPGP digital signature
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] gles-es-1.00: add linker test to check default precision qualifier redeclaration

2016-10-20 Thread Samuel Iglesias Gonsálvez
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97804
Signed-off-by: Samuel Iglesias Gonsálvez 
---
 ...t-precision-qualifier-redeclaration.shader_test | 34 ++
 1 file changed, 34 insertions(+)
 create mode 100644 
tests/spec/glsl-es-1.00/linker/glsl-default-precision-qualifier-redeclaration.shader_test

diff --git 
a/tests/spec/glsl-es-1.00/linker/glsl-default-precision-qualifier-redeclaration.shader_test
 
b/tests/spec/glsl-es-1.00/linker/glsl-default-precision-qualifier-redeclaration.shader_test
new file mode 100644
index 000..510ba20
--- /dev/null
+++ 
b/tests/spec/glsl-es-1.00/linker/glsl-default-precision-qualifier-redeclaration.shader_test
@@ -0,0 +1,34 @@
+#
+# Test that vertex shader defaults to highp (only fragment shader
+# needs to specify float precision) and that later fragment shader
+# highp precision declaration overrides earlier mediump declaration.
+#
+[require]
+GL ES >= 2.0
+GLSL ES >= 1.00
+
+[vertex shader]
+
+uniform float a;
+
+void main(void)
+{
+gl_Position = vec4(a);
+}
+
+[fragment shader]
+#ifdef GL_ES
+precision mediump float;
+#endif
+#ifdef GL_ES
+precision highp float;
+#endif
+
+uniform float a;
+
+void main(void)
+{
+gl_FragColor = vec4(a);
+}
+[test]
+link success
-- 
2.7.4

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


[Piglit] [PATCH v2] 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
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 
---
 .../fs-non-uniform-control-flow-f2d.shader_test| 40 ++
 1 file changed, 40 insertions(+)
 create mode 100644 
tests/spec/arb_gpu_shader_fp64/execution/fs-non-uniform-control-flow-f2d.shader_test

diff --git 
a/tests/spec/arb_gpu_shader_fp64/execution/fs-non-uniform-control-flow-f2d.shader_test
 
b/tests/spec/arb_gpu_shader_fp64/execution/fs-non-uniform-control-flow-f2d.shader_test
new file mode 100644
index 000..4b4011e
--- /dev/null
+++ 
b/tests/spec/arb_gpu_shader_fp64/execution/fs-non-uniform-control-flow-f2d.shader_test
@@ -0,0 +1,40 @@
+# It checks that a float to double conversion works correctly when it is
+# under non-uniform control flow.
+
+[require]
+GLSL >= 3.30
+GL_ARB_gpu_shader_fp64
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 330
+#extension GL_ARB_gpu_shader_fp64 : require
+out vec4 color;
+
+void main() {
+int cx = int(gl_FragCoord.x) / 125;
+int cy = int(gl_FragCoord.y) / 125;
+dvec2 rg;
+vec2 value;
+if ((cx + cy) % 2 == 0)
+value = vec2(1.0f, 0.0f);
+else
+value = vec2(0.0f, 1.0f);
+rg = dvec2(value);
+if (rg == dvec2(0, 1))
+color = vec4(0, 0, 1, 1);
+else
+color = vec4(rg, 0, 1);
+}
+
+
+[test]
+clear color 0.0 0.0 0.0 0.0
+clear
+draw rect -1 -1 2 2
+probe rgba 0 0 1.0 0.0 0.0 1.0
+probe rgba 125 0 0.0 0.0 1.0 1.0
+probe rgba 0 125 0.0 0.0 1.0 1.0
+probe rgba 125 125 1.0 0.0 0.0 1.0
+
-- 
2.7.4

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


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
>>

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

2016-10-13 Thread Samuel Iglesias Gonsálvez
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 +
 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;
+   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 = int(gl_FragCoord.x) / 31;\n"
+   "int cy = int(gl_FragCoord.y) / 31;\n"
+   "dvec2 rg; \n"
+   "vec2 value;\n"
+   "if ((cx + cy) % 2 == 0)\n"
+   "valu

Re: [Piglit] [PATCH] shader_runner: Fix argument for received length.

2016-06-14 Thread Samuel Iglesias Gonsálvez
Reviewed-by: Samuel Iglesias Gonsálvez 

On 15/06/16 01:15, Vinson Lee wrote:
> shader_runner.c:2255:25: warning: variable 'got' is uninitialized when used 
> here [-Wuninitialized]
> expected, expected, got, got);
> ^~~
> shader_runner.c:2234:12: note: initialize the variable 'got' to silence this 
> warning
> GLint got;
>  ^
>   = 0
> 
> Fixes: b3fc3303d9379 ("shader_runner: Add ARB_program_interface_query 
> support")
> Signed-off-by: Vinson Lee 
> ---
>  tests/shaders/shader_runner.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
> index 564ae6375c2d..2f90fee7b8ee 100644
> --- a/tests/shaders/shader_runner.c
> +++ b/tests/shaders/shader_runner.c
> @@ -2252,7 +2252,7 @@ active_program_interface(const char *line)
>   "glGetProgramResourceName(%s, %s): "
>   "expected %d (0x%04x), got %d (0x%04x)\n",
>   name, prop_string,
> - expected, expected, got, got);
> + expected, expected, name_len, name_len);
>   pass = false;
>   }
>  
> 



signature.asc
Description: OpenPGP digital signature
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] arb_gpu_shader_fp64: add simple explicit location execution test

2016-05-30 Thread Samuel Iglesias Gonsálvez


On 31/05/16 08:47, Timothy Arceri wrote:
> On Tue, 2016-05-31 at 08:22 +0200, Samuel Iglesias Gonsálvez wrote:
>> It is failing in current i965 Mesa driver. This tests checks
>> VS, GS and FS stages.
>>
>> Signed-off-by: Samuel Iglesias Gonsálvez 
>> ---
>>  .../explicit-location-gs-fs-vs-double.shader_test  | 74 
> 
> Nit pick but you don't really need to add double to the filename since
> this in in the arb_gpu_shader_fp64 directory.
> 
> 
>> ++
>>  1 file changed, 74 insertions(+)
>>  create mode 100644
>> tests/spec/arb_gpu_shader_fp64/execution/explicit-location-gs-fs-vs-
>> double.shader_test
>>
>> diff --git a/tests/spec/arb_gpu_shader_fp64/execution/explicit-
>> location-gs-fs-vs-double.shader_test
>> b/tests/spec/arb_gpu_shader_fp64/execution/explicit-location-gs-fs-
>> vs-double.shader_test
>> new file mode 100644
>> index 000..42a6994
>> --- /dev/null
>> +++ b/tests/spec/arb_gpu_shader_fp64/execution/explicit-location-gs-
>> fs-vs-double.shader_test
>> @@ -0,0 +1,74 @@
>> +# test truncating a double holds precision using explicit locations.
>> +[require]
>> +GLSL >= 4.20
>> +GL_ARB_gpu_shader_fp64
> 
> Any reason for using 4.2? You should be able to just do
> 
> #version 150
> #extension GL_ARB_gpu_shader_fp64 : require
> #extension GL_ARB_separate_shader_objects : require
> 
> Otherwise Reviewed-by: Timothy Arceri 
> 
> Thanks for the test :)
> 

Thanks for the review! I will do these changes and push it!

Sam

>> +
>> +[vertex shader]
>> +#version 420
>> +#extension GL_ARB_gpu_shader_fp64 : require
>> +
>> +uniform dvec4 arg0;
>> +
>> +in vec4 vertex;
>> +layout(location = 0) out vec4 vertex_to_gs;
>> +layout(location = 1) out dvec4 dout1_to_gs;
>> +
>> +void main()
>> +{
>> +vertex_to_gs = vertex;
>> +dout1_to_gs = arg0;
>> +}
>> +
>> +[geometry shader]
>> +#version 420
>> +#extension GL_ARB_gpu_shader_fp64 : require
>> +
>> +layout(triangles) in;
>> +layout(triangle_strip, max_vertices = 3) out;
>> +
>> +layout(location = 0) in vec4 vertex_to_gs[3];
>> +layout(location = 1) in dvec4 dout1_to_gs[3];
>> +layout(location = 3) flat out dvec4 out_to_fs;
>> +
>> +void main()
>> +{
>> +for (int i = 0; i < 3; i++) {
>> +gl_Position = vertex_to_gs[i];
>> +out_to_fs = dout1_to_gs[i];
>> +EmitVertex();
>> +}
>> +}
>> +
>> +[fragment shader]
>> +#version 420
>> +#extension GL_ARB_gpu_shader_fp64 : require
>> +
>> +uniform double tolerance;
>> +uniform dvec4 expected;
>> +
>> +layout(location = 3) flat in dvec4 out_to_fs;
>> +out vec4 color;
>> +
>> +void main()
>> +{
>> +dvec4 result = trunc(out_to_fs);
>> +color = distance(result, dvec4(expected)) <= tolerance
>> +? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0,
>> 1.0);
>> +}
>> +
>> +[vertex data]
>> +vertex/float/2
>> +-1.0 -1.0
>> + 1.0 -1.0
>> + 1.0  1.0
>> +-1.0  1.0
>> +
>> +[test]
>> +clear color 0.0 0.0 0.0 0.0
>> +
>> +clear
>> +uniform dvec4 arg0 1.7976931348623157E+308 1.5 -1.5 -0.5
>> +uniform dvec4 expected 1.7976931348623157E+308 1.0 -1.0 0.0
>> +uniform double tolerance 2.0002e-05
>> +draw arrays GL_TRIANGLE_FAN 0 4
>> +probe rgba 0 0 0.0 1.0 0.0 1.0
> 



signature.asc
Description: OpenPGP digital signature
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] arb_gpu_shader_fp64: add simple explicit location execution test

2016-05-30 Thread Samuel Iglesias Gonsálvez
It is failing in current i965 Mesa driver. This tests checks
VS, GS and FS stages.

Signed-off-by: Samuel Iglesias Gonsálvez 
---
 .../explicit-location-gs-fs-vs-double.shader_test  | 74 ++
 1 file changed, 74 insertions(+)
 create mode 100644 
tests/spec/arb_gpu_shader_fp64/execution/explicit-location-gs-fs-vs-double.shader_test

diff --git 
a/tests/spec/arb_gpu_shader_fp64/execution/explicit-location-gs-fs-vs-double.shader_test
 
b/tests/spec/arb_gpu_shader_fp64/execution/explicit-location-gs-fs-vs-double.shader_test
new file mode 100644
index 000..42a6994
--- /dev/null
+++ 
b/tests/spec/arb_gpu_shader_fp64/execution/explicit-location-gs-fs-vs-double.shader_test
@@ -0,0 +1,74 @@
+# test truncating a double holds precision using explicit locations.
+[require]
+GLSL >= 4.20
+GL_ARB_gpu_shader_fp64
+
+[vertex shader]
+#version 420
+#extension GL_ARB_gpu_shader_fp64 : require
+
+uniform dvec4 arg0;
+
+in vec4 vertex;
+layout(location = 0) out vec4 vertex_to_gs;
+layout(location = 1) out dvec4 dout1_to_gs;
+
+void main()
+{
+   vertex_to_gs = vertex;
+   dout1_to_gs = arg0;
+}
+
+[geometry shader]
+#version 420
+#extension GL_ARB_gpu_shader_fp64 : require
+
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+layout(location = 0) in vec4 vertex_to_gs[3];
+layout(location = 1) in dvec4 dout1_to_gs[3];
+layout(location = 3) flat out dvec4 out_to_fs;
+
+void main()
+{
+   for (int i = 0; i < 3; i++) {
+   gl_Position = vertex_to_gs[i];
+   out_to_fs = dout1_to_gs[i];
+   EmitVertex();
+   }
+}
+
+[fragment shader]
+#version 420
+#extension GL_ARB_gpu_shader_fp64 : require
+
+uniform double tolerance;
+uniform dvec4 expected;
+
+layout(location = 3) flat in dvec4 out_to_fs;
+out vec4 color;
+
+void main()
+{
+   dvec4 result = trunc(out_to_fs);
+   color = distance(result, dvec4(expected)) <= tolerance
+   ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0  1.0
+-1.0  1.0
+
+[test]
+clear color 0.0 0.0 0.0 0.0
+
+clear
+uniform dvec4 arg0 1.7976931348623157E+308 1.5 -1.5 -0.5
+uniform dvec4 expected 1.7976931348623157E+308 1.0 -1.0 0.0
+uniform double tolerance 2.0002e-05
+draw arrays GL_TRIANGLE_FAN 0 4
+probe rgba 0 0 0.0 1.0 0.0 1.0
-- 
2.7.4

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


Re: [Piglit] [PATCH] arb_gpu_shader_fp64: add simple explicit location execution test

2016-05-24 Thread Samuel Iglesias Gonsálvez
Reviewed-by: Samuel Iglesias Gonsálvez 

On 23/05/16 06:11, Timothy Arceri wrote:
> This currently fail on the i965 Mesa driver and likely on the gallium
> drivers too.
> ---
>  .../execution/vs-fs-explicit-locations.shader_test | 51 
> ++
>  1 file changed, 51 insertions(+)
>  create mode 100644 
> tests/spec/arb_gpu_shader_fp64/execution/vs-fs-explicit-locations.shader_test
> 
> diff --git 
> a/tests/spec/arb_gpu_shader_fp64/execution/vs-fs-explicit-locations.shader_test
>  
> b/tests/spec/arb_gpu_shader_fp64/execution/vs-fs-explicit-locations.shader_test
> new file mode 100644
> index 000..d951552
> --- /dev/null
> +++ 
> b/tests/spec/arb_gpu_shader_fp64/execution/vs-fs-explicit-locations.shader_test
> @@ -0,0 +1,51 @@
> +# basic test passing varyings with explicit locations through vs->fs.
> +
> +[require]
> +GLSL >= 1.50
> +GL_ARB_gpu_shader_fp64
> +GL_ARB_separate_shader_objects
> +
> +[vertex shader]
> +#version 150
> +#extension GL_ARB_gpu_shader_fp64 : require
> +#extension GL_ARB_separate_shader_objects : require
> +
> +layout(location = 0) flat out dvec4 d1;
> +layout(location = 2) flat out dvec4 d2;
> +
> +in vec4 piglit_vertex;
> +
> +void main()
> +{
> +  gl_Position = piglit_vertex;
> +
> +  d1 = dvec4(1.0, 0.0, 1.0, 1.0);
> +  d2 = dvec4(0.0, 1.0, 0.0, 1.0);
> +}
> +
> +[fragment shader]
> +#version 150
> +#extension GL_ARB_gpu_shader_fp64 : require
> +#extension GL_ARB_separate_shader_objects : require
> +
> +layout(location = 0) flat in dvec4 d1;
> +layout(location = 2) flat in dvec4 d2;
> +
> +out vec4 color;
> +
> +void main()
> +{
> +  if ((dvec4(1.0, 0.0, 1.0, 1.0) == d1) &&
> +  (dvec4(0.0, 1.0, 0.0, 1.0) == d2)) {
> +color = vec4(1.0, 0.0, 1.0, 1.0);
> +return;
> +  }
> +
> +  color = vec4(0.0, 0.0, 1.0, 1.0);
> +}
> +
> +[test]
> +clear color 0.1 0.1 0.1 0.1
> +clear
> +draw rect -1 -1 2 2
> +probe all rgba 1.0 0.0 1.0 1.0
> 



signature.asc
Description: OpenPGP digital signature
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] arb_gpu_shader_fp64: Add tests to check non-uniform-control-flow writes

2016-05-14 Thread Samuel Iglesias Gonsálvez
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256



On 14/05/16 04:35, Andres Gomez wrote:
[...]
> 
> Other than the tiny nits it looks OK.
> 
> Reviewed-by: Andres Gomez 
> 

Thanks a lot!

Sam
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQIcBAEBCAAGBQJXNuERAAoJEH/0ujLxfcND7RUQAKyhald5goOtfCnUxeBfA4v1
jq8gnGHJrnPYIOSgIfzbz7H8VIwg9k+10OFqHhS5ns/zujO0mVTHvlLAPaTrCkXF
qpOtCc2z3yflUHGzutLXRe1s1vOa2TAoATRa1m8ZLmymRpnbNeS2suGBzyuEPhHq
KktPr0xPODvaqk7n2ZQZ39U+IoXFAqrzMluYkKkm8ll/10SkRxDC5jYIl/TfYJMj
tBu9wm3+x8Hs4zaA2FLzt6lq7VJVfcHa+63mMLG0MIbG54ozVzzC0mebmAtuBsdz
r2pkz5s8p35JFM2Uc+VKuMR9FDhY7S+LBktz6+E2Qi+0lm54XPebheDMHSF25yt+
l/Xbuh8Sgcshg0VEwiSWtXrHz2FiR/dn4bWXWm2QbG0hm9W3/kJV25lGuvLRe4A8
AohderyYEK1GCjbtAkHOCVVTxtXPppAU64/0ow93N70qNGQTE0LKazJxz+lDCv6O
oX3W3mjun6J9sImio7izWdZmyRqrwESspqINxwRMoJqNyrbPSR/NpxM64BoGMuVf
JAGAxqdCGKzG7MFqzhzaLpqOIQXu/pp5R/Zq3gFfWJcaPvHAylCx60MjylcCFSk+
pHuK//RxKBbgTnlJD3GJlxw81ILzqWaB712kdIhVLU0ZaZx6NHAPynjU4G32WVY5
QCfICOZFa/f60LD7rKSk
=vAWb
-END PGP SIGNATURE-
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] arb_gpu_shader_fp64: Add tests to check non-uniform-control-flow writes

2016-05-12 Thread Samuel Iglesias Gonsálvez
They are use to detect if a bug in i965 driver related to
operations working with doubles under non-uniform control flow
is still happening.

Signed-off-by: Samuel Iglesias Gonsálvez 
---
 tests/all.py   |  10 ++
 tests/spec/arb_gpu_shader_fp64/CMakeLists.gl.txt   |  10 ++
 .../fs-non-uniform-control-flow-alu.c  | 150 
 .../fs-non-uniform-control-flow-const.c| 131 ++
 .../fs-non-uniform-control-flow-packing.c  | 150 
 .../fs-non-uniform-control-flow-ssbo.c | 155 +
 .../fs-non-uniform-control-flow-ubo.c  | 152 
 .../vs-non-uniform-control-flow-alu.c  | 191 +
 .../vs-non-uniform-control-flow-const.c| 169 ++
 .../vs-non-uniform-control-flow-packing.c  | 191 +
 .../vs-non-uniform-control-flow-ssbo.c | 187 
 .../vs-non-uniform-control-flow-ubo.c  | 186 
 12 files changed, 1682 insertions(+)
 create mode 100644 
tests/spec/arb_gpu_shader_fp64/fs-non-uniform-control-flow-alu.c
 create mode 100644 
tests/spec/arb_gpu_shader_fp64/fs-non-uniform-control-flow-const.c
 create mode 100644 
tests/spec/arb_gpu_shader_fp64/fs-non-uniform-control-flow-packing.c
 create mode 100644 
tests/spec/arb_gpu_shader_fp64/fs-non-uniform-control-flow-ssbo.c
 create mode 100644 
tests/spec/arb_gpu_shader_fp64/fs-non-uniform-control-flow-ubo.c
 create mode 100644 
tests/spec/arb_gpu_shader_fp64/vs-non-uniform-control-flow-alu.c
 create mode 100644 
tests/spec/arb_gpu_shader_fp64/vs-non-uniform-control-flow-const.c
 create mode 100644 
tests/spec/arb_gpu_shader_fp64/vs-non-uniform-control-flow-packing.c
 create mode 100644 
tests/spec/arb_gpu_shader_fp64/vs-non-uniform-control-flow-ssbo.c
 create mode 100644 
tests/spec/arb_gpu_shader_fp64/vs-non-uniform-control-flow-ubo.c

diff --git a/tests/all.py b/tests/all.py
index 395f964..f8f70f8 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -2171,6 +2171,16 @@ with profile.group_manager(
 g(['arb_gpu_shader_fp64-wrong-type-setter'])
 g(['arb_gpu_shader_fp64-double_in_bool_uniform'])
 g(['arb_gpu_shader_fp64-uniform-invalid-operation'])
+g(['arb_gpu_shader_fp64-vs-non-uniform-control-flow-const'])
+g(['arb_gpu_shader_fp64-fs-non-uniform-control-flow-const'])
+g(['arb_gpu_shader_fp64-vs-non-uniform-control-flow-ubo'])
+g(['arb_gpu_shader_fp64-fs-non-uniform-control-flow-ubo'])
+g(['arb_gpu_shader_fp64-vs-non-uniform-control-flow-ssbo'])
+g(['arb_gpu_shader_fp64-fs-non-uniform-control-flow-ssbo'])
+g(['arb_gpu_shader_fp64-vs-non-uniform-control-flow-alu'])
+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'])
 
 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 84601b7..209442f 100644
--- a/tests/spec/arb_gpu_shader_fp64/CMakeLists.gl.txt
+++ b/tests/spec/arb_gpu_shader_fp64/CMakeLists.gl.txt
@@ -9,3 +9,13 @@ link_libraries (
 )
 
 piglit_add_executable (arb_gpu_shader_fp64-double_in_bool_uniform 
double_in_bool_uniform.c)
+piglit_add_executable (arb_gpu_shader_fp64-fs-non-uniform-control-flow-ssbo 
fs-non-uniform-control-flow-ssbo.c)
+piglit_add_executable (arb_gpu_shader_fp64-vs-non-uniform-control-flow-ssbo 
vs-non-uniform-control-flow-ssbo.c)
+piglit_add_executable (arb_gpu_shader_fp64-fs-non-uniform-control-flow-const 
fs-non-uniform-control-flow-const.c)
+piglit_add_executable (arb_gpu_shader_fp64-vs-non-uniform-control-flow-const 
vs-non-uniform-control-flow-const.c)
+piglit_add_executable (arb_gpu_shader_fp64-fs-non-uniform-control-flow-ubo 
fs-non-uniform-control-flow-ubo.c)
+piglit_add_executable (arb_gpu_shader_fp64-vs-non-uniform-control-flow-ubo 
vs-non-uniform-control-flow-ubo.c)
+piglit_add_executable (arb_gpu_shader_fp64-fs-non-uniform-control-flow-alu 
fs-non-uniform-control-flow-alu.c)
+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)
diff --git a/tests/spec/arb_gpu_shader_fp64/fs-non-uniform-control-flow-alu.c 
b/tests/spec/arb_gpu_shader_fp64/fs-non-uniform-control-flow-alu.c
new file mode 100644
index 000..0e67b70
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/fs-non-uniform-control-flow-alu.c
@@ -0,0 +1,150 @@
+/*
+ * C

Re: [Piglit] [PATCH] shader_runner: add LOCATION_COMPONENT to verify program_interface_query

2015-11-26 Thread Samuel Iglesias Gonsálvez
Reviewed-by: Samuel Iglesias Gonsálvez 

On 27/11/15 04:18, Timothy Arceri wrote:
> ---
>  tests/shaders/shader_runner.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
> index 5d26409..dc833c8 100644
> --- a/tests/shaders/shader_runner.c
> +++ b/tests/shaders/shader_runner.c
> @@ -2088,6 +2088,7 @@ active_program_interface(const char *line)
>   ENUM_STRING(GL_TOP_LEVEL_ARRAY_STRIDE),
>   ENUM_STRING(GL_LOCATION),
>   ENUM_STRING(GL_LOCATION_INDEX),
> + ENUM_STRING(GL_LOCATION_COMPONENT),
>   ENUM_STRING(GL_IS_PER_PATCH),
>   ENUM_STRING(GL_NUM_COMPATIBLE_SUBROUTINES),
>   ENUM_STRING(GL_COMPATIBLE_SUBROUTINES),
> 
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] shader_runner: fix GL_SHADER_STORAGE_BLOCK enum name

2015-11-24 Thread Samuel Iglesias Gonsálvez
Signed-off-by: Samuel Iglesias Gonsálvez 
---
 tests/shaders/shader_runner.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index 9308905..14bca06 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -2100,7 +2100,7 @@ active_program_interface(const char *line)
ENUM_STRING(GL_PROGRAM_INPUT),
ENUM_STRING(GL_PROGRAM_OUTPUT),
ENUM_STRING(GL_BUFFER_VARIABLE),
-   ENUM_STRING(GL_SHADER_STORAGE_BUFFER),
+   ENUM_STRING(GL_SHADER_STORAGE_BLOCK),
ENUM_STRING(GL_ATOMIC_COUNTER_BUFFER),
ENUM_STRING(GL_VERTEX_SUBROUTINE),
ENUM_STRING(GL_TESS_CONTROL_SUBROUTINE),
-- 
2.5.0

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


Re: [Piglit] [PATCH] arb_shader_storage_buffer_object: Test linking programs with large copies

2015-11-23 Thread Samuel Iglesias Gonsálvez
Reviewed-by: Samuel Iglesias Gonsálvez 

On 20/11/15 19:58, Jordan Justen wrote:
> We test linking of programs that copy a large array, and a large
> structure.
> 
> Signed-off-by: Jordan Justen 
> ---
>  
> tests/spec/arb_shader_storage_buffer_object/execution/large-field-copy.shader_test
>  seemed a bit too complex, when the more immediate issue was the linking
>  failure. Maybe it would be good to verify that the copy actually works, but
>  these at least expose the linking issue.
> 
>  .../linker/copy-large-array.shader_test| 27 +++
>  .../linker/copy-large-struct.shader_test   | 31 
> ++
>  2 files changed, 58 insertions(+)
>  create mode 100644 
> tests/spec/arb_shader_storage_buffer_object/linker/copy-large-array.shader_test
>  create mode 100644 
> tests/spec/arb_shader_storage_buffer_object/linker/copy-large-struct.shader_test
> 
> diff --git 
> a/tests/spec/arb_shader_storage_buffer_object/linker/copy-large-array.shader_test
>  
> b/tests/spec/arb_shader_storage_buffer_object/linker/copy-large-array.shader_test
> new file mode 100644
> index 000..e0b04e5
> --- /dev/null
> +++ 
> b/tests/spec/arb_shader_storage_buffer_object/linker/copy-large-array.shader_test
> @@ -0,0 +1,27 @@
> +# Tests linking of a fragment shader that copies a 'large' array field
> +# within an SSBO.
> +
> +[require]
> +GL >= 3.3
> +GLSL >= 3.30
> +GL_ARB_shader_storage_buffer_object
> +
> +[vertex shader passthrough]
> +
> +[fragment shader]
> +#version 330
> +#extension GL_ARB_shader_storage_buffer_object: require
> +
> +#define SIZE 16
> +
> +buffer SSBO {
> +mat4 src[SIZE];
> +mat4 dst[SIZE];
> +};
> +
> +void main() {
> +dst = src;
> +}
> +
> +[test]
> +link success
> diff --git 
> a/tests/spec/arb_shader_storage_buffer_object/linker/copy-large-struct.shader_test
>  
> b/tests/spec/arb_shader_storage_buffer_object/linker/copy-large-struct.shader_test
> new file mode 100644
> index 000..81de526
> --- /dev/null
> +++ 
> b/tests/spec/arb_shader_storage_buffer_object/linker/copy-large-struct.shader_test
> @@ -0,0 +1,31 @@
> +# Tests linking of a fragment shader that copies a 'large' struct
> +# field within an SSBO.
> +
> +[require]
> +GL >= 3.3
> +GLSL >= 3.30
> +GL_ARB_shader_storage_buffer_object
> +
> +[vertex shader passthrough]
> +
> +[fragment shader]
> +#version 330
> +#extension GL_ARB_shader_storage_buffer_object: require
> +
> +#define SIZE 16
> +
> +struct S {
> +mat4 m[SIZE];
> +};
> +
> +buffer SSBO {
> +S src;
> +S dst;
> +};
> +
> +void main() {
> +dst = src;
> +}
> +
> +[test]
> +link success
> 
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] arb_shader_storage_buffer_object: Test copying a large SSBO item

2015-11-19 Thread Samuel Iglesias Gonsálvez
Reviewed-by: Samuel Iglesias Gonsálvez 

Thanks for writing a test for this issue,

Sam

On 20/11/15 02:23, Jordan Justen wrote:
> Signed-off-by: Jordan Justen 
> Cc: Kristian Høgsberg 
> Cc: Samuel Iglesias Gonsalvez 
> Cc: Iago Toral Quiroga 
> ---
>  This fails to link on i965.
> 
>  .../execution/large-field-copy.shader_test | 66 
> ++
>  1 file changed, 66 insertions(+)
>  create mode 100644 
> tests/spec/arb_shader_storage_buffer_object/execution/large-field-copy.shader_test
> 
> diff --git 
> a/tests/spec/arb_shader_storage_buffer_object/execution/large-field-copy.shader_test
>  
> b/tests/spec/arb_shader_storage_buffer_object/execution/large-field-copy.shader_test
> new file mode 100644
> index 000..a949507
> --- /dev/null
> +++ 
> b/tests/spec/arb_shader_storage_buffer_object/execution/large-field-copy.shader_test
> @@ -0,0 +1,66 @@
> +# Test that a 'large' field of an SSBO can be copied.
> +
> +[require]
> +GL >= 3.3
> +GLSL >= 3.30
> +GL_ARB_shader_storage_buffer_object
> +
> +[vertex shader passthrough]
> +
> +[fragment shader]
> +#version 330
> +#extension GL_ARB_shader_storage_buffer_object: require
> +
> +#define SIZE 16
> +
> +layout (std430) buffer SSBO {
> +mat4 m1[SIZE];
> +mat4 m2[SIZE];
> +};
> +
> +out vec4 color;
> +
> +uniform uint mode;
> +
> +void main() {
> +bool pass = true;
> +int i;
> +
> +switch (mode) {
> +case 0u:
> +for (i = 0; i < SIZE; i++) {
> + m1[i] = mat4(vec4(i + 0), vec4(i + 1),
> +  vec4(i + 2), vec4(i + 3));
> + }
> + break;
> +case 1u:
> +m2 = m1;
> + break;
> +case 2u:
> +for (i = 0; i < SIZE; i++) {
> + pass = pass && (m2[i] == mat4(vec4(i + 0), vec4(i + 1),
> +   vec4(i + 2), vec4(i + 3)));
> + }
> + break;
> +}
> +
> +if (pass)
> +color = vec4(0.0, 1.0, 0.0, 1.0);
> +else
> +color = vec4(1.0, 0.0, 0.0, 1.0);
> +}
> +
> +[test]
> +ssbo 2048
> +
> +uniform uint mode 0
> +draw rect -1 -1 2 2
> +probe all rgba 0.0 1.0 0.0 1.0
> +
> +uniform uint mode 1
> +draw rect -1 -1 2 2
> +probe all rgba 0.0 1.0 0.0 1.0
> +
> +uniform uint mode 2
> +draw rect -1 -1 2 2
> +probe all rgba 0.0 1.0 0.0 1.0
> 
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] arb_shader_storage_buffer_object: Add compiler test for shared layout qualifier

2015-11-12 Thread Samuel Iglesias Gonsálvez
It verifies the regression added by Mesa's 8b28b35 commit.

Tested on NVIDIA proprietary driver version 352.55.

Signed-off-by: Samuel Iglesias Gonsálvez 
---
 .../compiler/shared-layout-qualifier.frag  | 18 ++
 1 file changed, 18 insertions(+)
 create mode 100644 
tests/spec/arb_shader_storage_buffer_object/compiler/shared-layout-qualifier.frag

diff --git 
a/tests/spec/arb_shader_storage_buffer_object/compiler/shared-layout-qualifier.frag
 
b/tests/spec/arb_shader_storage_buffer_object/compiler/shared-layout-qualifier.frag
new file mode 100644
index 000..207a23c
--- /dev/null
+++ 
b/tests/spec/arb_shader_storage_buffer_object/compiler/shared-layout-qualifier.frag
@@ -0,0 +1,18 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.30
+// require_extensions: GL_ARB_shader_storage_buffer_object 
GL_ARB_uniform_buffer_object GL_ARB_compute_shader
+// [end config]
+
+#version 130
+#extension GL_ARB_shader_storage_buffer_object: require
+#extension GL_ARB_uniform_buffer_object: require
+#extension GL_ARB_compute_shader: require
+
+layout (shared) buffer ssbo {
+   float a;
+};
+
+void foo(void) {
+   a = 1.0;
+}
-- 
2.5.0

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


Re: [Piglit] [PATCH] arb_gpu_shader5: test member stream qualifiers match a named blocks qualifier

2015-10-19 Thread Samuel Iglesias Gonsálvez
Reviewed-by: Samuel Iglesias Gonsálvez 

Thanks,

Sam

On 17/10/15 11:21, Timothy Arceri wrote:
> Named and unnamed interfaces have different code paths in Mesa this
> uncovers a bug with named instances.
> ---
>  ...ltiple-named-block-layout-qualifier-stream.geom | 32 
> ++
>  1 file changed, 32 insertions(+)
>  create mode 100644 
> tests/spec/arb_gpu_shader5/compiler/stream-qualifier/incorrect-multiple-named-block-layout-qualifier-stream.geom
> 
> diff --git 
> a/tests/spec/arb_gpu_shader5/compiler/stream-qualifier/incorrect-multiple-named-block-layout-qualifier-stream.geom
>  
> b/tests/spec/arb_gpu_shader5/compiler/stream-qualifier/incorrect-multiple-named-block-layout-qualifier-stream.geom
> new file mode 100644
> index 000..83a4ff3
> --- /dev/null
> +++ 
> b/tests/spec/arb_gpu_shader5/compiler/stream-qualifier/incorrect-multiple-named-block-layout-qualifier-stream.geom
> @@ -0,0 +1,32 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.50
> +// require_extensions: GL_ARB_gpu_shader5
> +// check_link: false
> +// [end config]
> +//
> +// ARB_gpu_shader5 spec says:
> +//   "A block member may be declared with a stream
> +//qualifier, but the specified stream must match the stream
> +//associated with the containing block."
> +//
> +// Tests for multiple declarations of layout qualifier 'stream' for
> +// block's fields.
> +//
> +
> +#version 150
> +#extension GL_ARB_gpu_shader5 : enable
> +
> +layout(points) in;
> +layout(triangle_strip, max_vertices=3) out;
> +
> +out Block1 { // By default, it uses stream = 0
> + layout(stream=1) vec4 var1; // Wrong: different than block's stream 
> value
> + layout(stream=3) vec4 var2; // Wrong: different than block's stream 
> value
> + layout(stream=0) vec4 var3; // Valid
> + vec4 var4; // Valid
> +} block_name;
> +
> +void main()
> +{
> +}
> 
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] arb_shader_storage_buffer_object: test buffer member swizzle

2015-10-19 Thread Samuel Iglesias Gonsálvez
Can you add what regression is in the commit log?

Something like:

"Checks if a shader with a buffer variable accessed with a swizzle links
successfully."

With that,

Reviewed-by: Samuel Iglesias Gonsálvez 

Sam

On 18/10/15 00:11, Timothy Arceri wrote:
> Tests a regression in Mesa.
> ---
>  .../compiler/atomicMin-swizzle.vert   | 19 
> +++
>  1 file changed, 19 insertions(+)
>  create mode 100644 
> tests/spec/arb_shader_storage_buffer_object/compiler/atomicMin-swizzle.vert
> 
> diff --git 
> a/tests/spec/arb_shader_storage_buffer_object/compiler/atomicMin-swizzle.vert 
> b/tests/spec/arb_shader_storage_buffer_object/compiler/atomicMin-swizzle.vert
> new file mode 100644
> index 000..0a07ba5
> --- /dev/null
> +++ 
> b/tests/spec/arb_shader_storage_buffer_object/compiler/atomicMin-swizzle.vert
> @@ -0,0 +1,19 @@
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.20
> +// require_extensions: GL_ARB_shader_storage_buffer_object
> +// check_link: true
> +// [end config]
> +
> +#version 120
> +#extension GL_ARB_shader_storage_buffer_object: require
> +
> +buffer bufblock {
> +  ivec4 iface_var;
> +};
> +
> +void main()
> +{
> +  atomicMin(iface_var.x, 2);
> +  gl_Position = vec4(0.0);
> +}
> 
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] arb_shader_storage_buffer_object: Add linker test for indirect indexing of a buffer variable

2015-10-19 Thread Samuel Iglesias Gonsálvez


On 19/10/15 11:41, Timothy Arceri wrote:
> On Mon, 2015-10-19 at 10:57 +0200, Samuel Iglesias Gonsalvez wrote:
>> Signed-off-by: Samuel Iglesias Gonsalvez 
> 
> Looks ok to me. Reviewed-by: Timothy Arceri 
> 
> I take it this was the test with segfault?

Yes, it was this test.

Sam

> 
>> ---
>>  .../buffer-variable-indirect-indexing.shader_test  | 30
>> ++
>>  1 file changed, 30 insertions(+)
>>  create mode 100644
>> tests/spec/arb_shader_storage_buffer_object/linker/buffer-variable
>> -indirect-indexing.shader_test
>>
>> diff --git
>> a/tests/spec/arb_shader_storage_buffer_object/linker/buffer-variable
>> -indirect-indexing.shader_test
>> b/tests/spec/arb_shader_storage_buffer_object/linker/buffer-variable
>> -indirect-indexing.shader_test
>> new file mode 100644
>> index 000..1fedfc8
>> --- /dev/null
>> +++ b/tests/spec/arb_shader_storage_buffer_object/linker/buffer
>> -variable-indirect-indexing.shader_test
>> @@ -0,0 +1,30 @@
>> +# Test checks the success of linking a shader with indirect indexing
>> of
>> +# a buffer variable.
>> +
>> +[require]
>> +GL >= 3.3
>> +GLSL >= 3.30
>> +GL_ARB_shader_storage_buffer_object
>> +
>> +[fragment shader]
>> +
>> +#version 330
>> +#extension GL_ARB_shader_storage_buffer_object : enable
>> +
>> +
>> +buffer Fragments {
>> +   mat4 m;
>> +   int index;
>> +};
>> +
>> +in vec4 fragmentColor;
>> +out vec4 color;
>> +
>> +void main()
>> +{
>> +   m[index] = vec4(1.0, 1.0, 0.0, 1.0);
>> +   color = m[index];
>> +}
>> +
>> +[test]
>> +link success
> 
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 00/13] Add more arb_shader_storage_buffer_object tests

2015-10-05 Thread Samuel Iglesias Gonsálvez


On 28/09/15 10:17, Samuel Iglesias Gonsálvez wrote:
> 
> 
> On 25/09/15 22:56, Mark Janes wrote:
>> Emil Velikov  writes:
>>
>>> On 25 September 2015 at 16:40, Mark Janes  wrote:
>>>> With the push of SSBO support in mesa, one of these tests continues to
>>>> fail, but only on broadwell:
>>>>
>>>> piglit.spec.arb_shader_storage_buffer_object.array-ssbo-binding
>>
>> A subsequent run on the CI shows this test to fail intermittently on
>> broadwell.  I'm supposed to be taking the day off today, but I'll look
>> at this more thoroughly on Monday.
> 
> We don't have any Broadwell machine. However we can help you with the
> debugging, don't hesitate to contact Iago or me.
> 

Is there any news?

Sam

> Thanks,
> 
> Sam
> 
>>
>>>>
>>>> Standard Output
>>>>
>>>> 
>>>> /tmp/build_root/m64/lib/piglit/bin/arb_shader_storage_buffer_object-array-ssbo-binding
>>>>  -auto -fbo
>>>> piglit: debug: Requested an OpenGL 3.2 Core Context, and received a 
>>>> matching 3.3 context
>>>>
>>>> Wrong 0 value in buffer[1]: 0.00
>>>>
>>> The test seems to be comparing a float with an integer there. Perhaps
>>> one should use {+,-}0.0f or lambda ?
>>>
>>> float *map;
>>> ...
>>> if (map[i] != 0) {
>>>printf("Wrong %d value in buffer[0]: %.2f\n",
>>>   i, map[i]);
>>>
>>> -Emil
>>
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] arb_shader_storage_buffer_object: global scope binding qualifier test

2015-10-05 Thread Samuel Iglesias Gonsálvez


On 05/10/15 12:03, Tapani Pälli wrote:
> 
> 
> On 10/05/2015 12:49 PM, Tapani Pälli wrote:
>> Signed-off-by: Tapani Pälli 
>> ---
>>   .../compiler/global-scope-binding-qualifier.frag | 20
>> 
>>   1 file changed, 20 insertions(+)
>>   create mode 100644
>> tests/spec/arb_shader_storage_buffer_object/compiler/global-scope-binding-qualifier.frag
>>
>>
>> diff --git
>> a/tests/spec/arb_shader_storage_buffer_object/compiler/global-scope-binding-qualifier.frag
>> b/tests/spec/arb_shader_storage_buffer_object/compiler/global-scope-binding-qualifier.frag
>>
>> new file mode 100644
>> index 000..249663a
>> --- /dev/null
>> +++
>> b/tests/spec/arb_shader_storage_buffer_object/compiler/global-scope-binding-qualifier.frag
>>
>> @@ -0,0 +1,20 @@
>> +// [config]
>> +// expect_result: fail
>> +// glsl_version: 1.50
>> +// require_extensions: GL_ARB_shader_storage_buffer_object
>> +// [end config]
>> +
>> +/* From the GL_ARB_shader_storage_buffer_object spec:
> 
> That is a lie, extension spec does not say it but it is GLSL (and GLSL
> ES) spec, I will correct it when committing if everything else is fine.
> 

GL_ARB_shader_storage_buffer_object spec modified that paragraph to add
shader storage block case.

However, it is GLSL (GLSL ES) spec who add that sentence in the first place.

Reviewed-by: Samuel Iglesias Gonsálvez 

>> + *
>> + *  "It is an error to specify the binding identifier for the global
>> + *  scope or for block member declarations."
>> + */
>> +
>> +#version 150
>> +#extension GL_ARB_shader_storage_buffer_object: require
>> +
>> +layout(binding=1) buffer;
>> +
>> +void main()
>> +{
>> +}
>>
> 
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] arb_shader_storage_buffer_object: invalid binding qualifier test

2015-10-02 Thread Samuel Iglesias Gonsálvez
Reviewed-by: Samuel Iglesias Gonsálvez 

On 02/10/15 09:08, Tapani Pälli wrote:
> Signed-off-by: Tapani Pälli 
> ---
>  .../compiler/member-invalid-binding-qualifier.frag   | 16 
> 
>  1 file changed, 16 insertions(+)
>  create mode 100644 
> tests/spec/arb_shader_storage_buffer_object/compiler/member-invalid-binding-qualifier.frag
> 
> diff --git 
> a/tests/spec/arb_shader_storage_buffer_object/compiler/member-invalid-binding-qualifier.frag
>  
> b/tests/spec/arb_shader_storage_buffer_object/compiler/member-invalid-binding-qualifier.frag
> new file mode 100644
> index 000..4e3b678
> --- /dev/null
> +++ 
> b/tests/spec/arb_shader_storage_buffer_object/compiler/member-invalid-binding-qualifier.frag
> @@ -0,0 +1,16 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.50
> +// require_extensions: GL_ARB_shader_storage_buffer_object
> +// [end config]
> +
> +#version 150
> +#extension GL_ARB_shader_storage_buffer_object: require
> +
> +buffer buf {
> + layout(binding=42) float f;
> +};
> +
> +float foo(void) {
> + return f;
> +}
> 
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] arb_shader_storage_buffer_object: add compiler test for dynamic indexing

2015-10-01 Thread Samuel Iglesias Gonsálvez
On 01/10/15 13:54, Tapani Pälli wrote:
> Signed-off-by: Tapani Pälli 
> ---
>  ...hader-storage-block-array-dynamic-indexing.frag | 24 
> ++
>  1 file changed, 24 insertions(+)
>  create mode 100644 
> tests/spec/arb_shader_storage_buffer_object/compiler/shader-storage-block-array-dynamic-indexing.frag
> 
> diff --git 
> a/tests/spec/arb_shader_storage_buffer_object/compiler/shader-storage-block-array-dynamic-indexing.frag
>  
> b/tests/spec/arb_shader_storage_buffer_object/compiler/shader-storage-block-array-dynamic-indexing.frag
> new file mode 100644
> index 000..a05e7fc
> --- /dev/null
> +++ 
> b/tests/spec/arb_shader_storage_buffer_object/compiler/shader-storage-block-array-dynamic-indexing.frag
> @@ -0,0 +1,24 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.50

As this is a test that checks one case of OpenGL ES 3.1 spec,
I think it should be "glsl_version: 3.10 es" if we supported it. If not,
maybe: glsl_version: 3.00 es

> +// require_extensions: GL_ARB_shader_storage_buffer_object
> +// [end config]
> +
> +#version 150

And here, in theory "#version 310 es"

Do we supported it in Mesa? If not... "#version 300 es" ??

But they are just suggestions. In any case,

Reviewed-by: Samuel Iglesias Gonsálvez 

Sam

> +#extension GL_ARB_shader_storage_buffer_object: require
> +
> +/* Page 50 in section 4.3.9 of the OpenGL ES 3.10 spec says:
> + *
> + *"All indices used to index a uniform or shader storage block
> + *array must be constant integral expressions."
> + */
> +
> +buffer buf {
> + vec4 v;
> +} array[2];
> +
> +uniform int index;
> +
> +vec4 foo(void) {
> + return array[index].v;
> +}
> 
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 00/13] Add more arb_shader_storage_buffer_object tests

2015-09-28 Thread Samuel Iglesias Gonsálvez


On 25/09/15 22:56, Mark Janes wrote:
> Emil Velikov  writes:
> 
>> On 25 September 2015 at 16:40, Mark Janes  wrote:
>>> With the push of SSBO support in mesa, one of these tests continues to
>>> fail, but only on broadwell:
>>>
>>> piglit.spec.arb_shader_storage_buffer_object.array-ssbo-binding
> 
> A subsequent run on the CI shows this test to fail intermittently on
> broadwell.  I'm supposed to be taking the day off today, but I'll look
> at this more thoroughly on Monday.

We don't have any Broadwell machine. However we can help you with the
debugging, don't hesitate to contact Iago or me.

Thanks,

Sam

> 
>>>
>>> Standard Output
>>>
>>> 
>>> /tmp/build_root/m64/lib/piglit/bin/arb_shader_storage_buffer_object-array-ssbo-binding
>>>  -auto -fbo
>>> piglit: debug: Requested an OpenGL 3.2 Core Context, and received a 
>>> matching 3.3 context
>>>
>>> Wrong 0 value in buffer[1]: 0.00
>>>
>> The test seems to be comparing a float with an integer there. Perhaps
>> one should use {+,-}0.0f or lambda ?
>>
>> float *map;
>> ...
>> if (map[i] != 0) {
>>printf("Wrong %d value in buffer[0]: %.2f\n",
>>   i, map[i]);
>>
>> -Emil
> 
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] glsl-1.50: test shader compiles with unused uniform block

2015-09-23 Thread Samuel Iglesias Gonsálvez
Reviewed-by: Samuel Iglesias Gonsálvez 

On 23/09/15 05:36, Timothy Arceri wrote:
> Tests the second bug mentioned in the bug report.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83508
> ---
>  .../uniform_block/unused-interface-array.vert | 19 
> +++
>  1 file changed, 19 insertions(+)
>  create mode 100644 
> tests/spec/glsl-1.50/compiler/uniform_block/unused-interface-array.vert
> 
> diff --git 
> a/tests/spec/glsl-1.50/compiler/uniform_block/unused-interface-array.vert 
> b/tests/spec/glsl-1.50/compiler/uniform_block/unused-interface-array.vert
> new file mode 100644
> index 000..e28ffe9
> --- /dev/null
> +++ b/tests/spec/glsl-1.50/compiler/uniform_block/unused-interface-array.vert
> @@ -0,0 +1,19 @@
> +/* [config]
> + * expect_result: pass
> + * glsl_version: 1.50
> + * [end config]
> + * 
> + * Tests that shader still compiles with an unused uniform block. A packed
> + * layout means the implementation can eliminate the block entirely.
> + */
> +#version 150
> +
> +layout(packed) uniform ArrayBlock
> +{
> +  mat4 a;
> +} i[4];
> +
> +void main()
> +{
> +  gl_Position = vec4(1.0);
> +}
> 
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 0/2] shader_runner: Add ARB_program_interface_query support

2015-09-22 Thread Samuel Iglesias Gonsálvez


On 22/09/15 07:35, Tapani Pälli wrote:
> 
> 
> On 09/21/2015 04:35 PM, Samuel Iglesias Gonsálvez wrote:
>>
>>
>> On 17/09/15 08:53, Tapani Pälli wrote:
>>>
>>> On 09/16/2015 11:31 AM, Samuel Iglesias Gonsalvez wrote:
>>>> Hello,
>>>>
>>>> Following my idea described here [0], I modified shader_runner to
>>>> accept
>>>> other program interfaces.
>>>>
>>>> The format of the command is:
>>>>
>>>>active program_interface GL_INTERFACE_TYPE_ENUM var_name
>>>> GL_PROPS_ENUM integer
>>>>
>>>> or, if we include the GL type enum:
>>>>
>>>>active program_interface GL_INTERFACE_TYPE_ENUM var_name
>>>> GL_PROPS_ENUM GL_TYPE_ENUM
>>>>
>>>> Some examples:
>>>>
>>>> active program_interface GL_UNIFORM i1 GL_MATRIX_STRIDE 0
>>>> active program_interface GL_UNIFORM i1 GL_IS_ROW_MAJOR 0
>>>> active program_interface GL_PROGRAM_OUTPUT piglit_fragcolor GL_TYPE
>>>> GL_FLOAT_VEC4
>>>> active program_interface GL_PROGRAM_INPUT piglit_vertex GL_TYPE
>>>> GL_FLOAT_VEC4
>>>
>>>  From user/reader perspective it is not obvious what 'active
>>> program_interface' does. I think it should have something like
>>> 'validate' or 'query' in it so that reader knows what is going on. These
>>> sounds more like setters now than queries?
>>
>> OK, What about the following?
>>
>> active program_interface_query  ??
>>
>>   Also, why 'active', you can't
>>> query inactive ones?
>>>
>>
>> As it is, you can't. The code is searching an active resource by the
>> provided name and when it founds it, the query is done and validated
>> with the expected value.
>>
>> Looking at the spec [0], it defines the queries only for active
>> resources. Knowing that, we can even remove the word "active" from the
>> aforementioned format as we cannot query inactive ones.
>>
>> What do you think?
> 
> Yes, "program_interface_query" sounds good to me!
> 

Taking into account Ian's opinion, I will use:

verify program_interface_query 

I will wait until tomorrow before send the new version of the patches,
just in case someone wants to add something else.

Thanks! :-)

Sam

>> Sam
>>
>> [0] https://www.opengl.org/registry/specs/ARB/program_interface_query.txt
>>
>>> Otherwise, I think it is fine addition if it helps in writing more
>>> tests.
>>>
>>>
>>>> What do you think?
>>>>
>>>> Thanks,
>>>>
>>>> Sam
>>>>
>>>> [0]
>>>> http://lists.freedesktop.org/archives/piglit/2015-September/017080.html
>>>>
>>>> Samuel Iglesias Gonsalvez (2):
>>>> shader_runner: make active_uniforms's all_types variable be global
>>>> shader_runner: Add ARB_program_interface_query support
>>>>
>>>>tests/shaders/shader_runner.c | 322
>>>> --
>>>>1 file changed, 244 insertions(+), 78 deletions(-)
>>>>
>>>
>>>
>>> // Tapani
>>>
> 
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 0/2] shader_runner: Add ARB_program_interface_query support

2015-09-21 Thread Samuel Iglesias Gonsálvez


On 17/09/15 08:53, Tapani Pälli wrote:
> 
> On 09/16/2015 11:31 AM, Samuel Iglesias Gonsalvez wrote:
>> Hello,
>>
>> Following my idea described here [0], I modified shader_runner to accept
>> other program interfaces.
>>
>> The format of the command is:
>>
>>   active program_interface GL_INTERFACE_TYPE_ENUM var_name
>> GL_PROPS_ENUM integer
>>
>> or, if we include the GL type enum:
>>
>>   active program_interface GL_INTERFACE_TYPE_ENUM var_name
>> GL_PROPS_ENUM GL_TYPE_ENUM
>>
>> Some examples:
>>
>> active program_interface GL_UNIFORM i1 GL_MATRIX_STRIDE 0
>> active program_interface GL_UNIFORM i1 GL_IS_ROW_MAJOR 0
>> active program_interface GL_PROGRAM_OUTPUT piglit_fragcolor GL_TYPE
>> GL_FLOAT_VEC4
>> active program_interface GL_PROGRAM_INPUT piglit_vertex GL_TYPE
>> GL_FLOAT_VEC4
> 
> From user/reader perspective it is not obvious what 'active
> program_interface' does. I think it should have something like
> 'validate' or 'query' in it so that reader knows what is going on. These
> sounds more like setters now than queries?

OK, What about the following?

active program_interface_query  ??

 Also, why 'active', you can't
> query inactive ones?
> 

As it is, you can't. The code is searching an active resource by the
provided name and when it founds it, the query is done and validated
with the expected value.

Looking at the spec [0], it defines the queries only for active
resources. Knowing that, we can even remove the word "active" from the
aforementioned format as we cannot query inactive ones.

What do you think?

Sam

[0] https://www.opengl.org/registry/specs/ARB/program_interface_query.txt

> Otherwise, I think it is fine addition if it helps in writing more tests.
> 
> 
>> What do you think?
>>
>> Thanks,
>>
>> Sam
>>
>> [0]
>> http://lists.freedesktop.org/archives/piglit/2015-September/017080.html
>>
>> Samuel Iglesias Gonsalvez (2):
>>shader_runner: make active_uniforms's all_types variable be global
>>shader_runner: Add ARB_program_interface_query support
>>
>>   tests/shaders/shader_runner.c | 322
>> --
>>   1 file changed, 244 insertions(+), 78 deletions(-)
>>
> 
> 
> // Tapani
> 
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH v2] glsl-1.10 Adds tests on how void functions are handled

2015-07-13 Thread Samuel Iglesias Gonsálvez
Reviewed-by: Samuel Iglesias Gonsálvez 

I have already pushed this piglit patch. Just confirm me to do the same
for the mesa patch.

Sam

On Sat, 2015-07-11 at 22:59 +0200, Renaud Gaubert wrote:
> Mesa currently doesn't handle void functions and segfaults on
> almost all of the test cases.
> 
> This also references the bug 85252 Segfault in compiler while
> processing ternary operator with void arguments:
> 
> This will be fixed with the following commit sent to mesa-dev:
> [PATCH] glsl: fix Bug 85252 - Segfault in compiler while processing
> ternary operator with void arguments
> 
> Signed-off-by: Renaud Gaubert 
> Reviewed-By: Gabriel Laskar 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85252
> 
> ---
> As discussed in [PATCH] glsl 1.10: Fix broken ternary void test
> I've merged my 2nd patch in this one as it wasn't pushed yet.
> 
> Chris Forbes: Yes I need someone to push it for me
> 
>  .../glsl-1.10/compiler/void/void-array_subscript.vert| 15 +++
>  tests/spec/glsl-1.10/compiler/void/void-assignment.vert  | 15 +++
>  tests/spec/glsl-1.10/compiler/void/void-equal.vert   | 16 
> 
>  .../glsl-1.10/compiler/void/void-field_selection.vert| 15 +++
>  tests/spec/glsl-1.10/compiler/void/void-logical_and.vert | 15 +++
>  tests/spec/glsl-1.10/compiler/void/void-logical_or.vert  | 15 +++
>  tests/spec/glsl-1.10/compiler/void/void-logical_xor.vert | 15 +++
>  tests/spec/glsl-1.10/compiler/void/void-lt.vert  | 16 
> 
>  tests/spec/glsl-1.10/compiler/void/void-plus.vert| 15 +++
>  tests/spec/glsl-1.10/compiler/void/void-plus_assign.vert | 16 
> 
>  .../glsl-1.10/compiler/void/void-postfix_increment.vert  | 15 +++
>  .../glsl-1.10/compiler/void/void-prefix_increment.vert   | 15 +++
>  tests/spec/glsl-1.10/compiler/void/void-unary_plus.vert  | 15 +++
>  tests/spec/glsl-1.10/execution/void-ternary.shader_test  |  3 ++-
>  tests/spec/glsl-1.30/compiler/void/void-and_assign.vert  | 16 
> 
>  tests/spec/glsl-1.30/compiler/void/void-bitwise_and.vert | 15 +++
>  tests/spec/glsl-1.30/compiler/void/void-lshift.vert  | 15 +++
>  tests/spec/glsl-1.30/compiler/void/void-mod.vert | 15 +++
>  tests/spec/glsl-1.30/compiler/void/void-mod_assign.vert  | 16 
> 
>  tests/spec/glsl-1.30/compiler/void/void-rshift.vert  | 15 +++
>  .../spec/glsl-1.30/compiler/void/void-shift_assign.vert  | 16 
> 
>  tests/spec/glsl-1.30/compiler/void/void-unary_not.vert   | 15 +++
>  tests/spec/glsl-1.30/compiler/void/void-unary_tilde.vert | 15 +++
>  23 files changed, 338 insertions(+), 1 deletion(-)
>  create mode 100644 
> tests/spec/glsl-1.10/compiler/void/void-array_subscript.vert
>  create mode 100644 tests/spec/glsl-1.10/compiler/void/void-assignment.vert
>  create mode 100644 tests/spec/glsl-1.10/compiler/void/void-equal.vert
>  create mode 100644 
> tests/spec/glsl-1.10/compiler/void/void-field_selection.vert
>  create mode 100644 tests/spec/glsl-1.10/compiler/void/void-logical_and.vert
>  create mode 100644 tests/spec/glsl-1.10/compiler/void/void-logical_or.vert
>  create mode 100644 tests/spec/glsl-1.10/compiler/void/void-logical_xor.vert
>  create mode 100644 tests/spec/glsl-1.10/compiler/void/void-lt.vert
>  create mode 100644 tests/spec/glsl-1.10/compiler/void/void-plus.vert
>  create mode 100644 tests/spec/glsl-1.10/compiler/void/void-plus_assign.vert
>  create mode 100644 
> tests/spec/glsl-1.10/compiler/void/void-postfix_increment.vert
>  create mode 100644 
> tests/spec/glsl-1.10/compiler/void/void-prefix_increment.vert
>  create mode 100644 tests/spec/glsl-1.10/compiler/void/void-unary_plus.vert
>  create mode 100644 tests/spec/glsl-1.30/compiler/void/void-and_assign.vert
>  create mode 100644 tests/spec/glsl-1.30/compiler/void/void-bitwise_and.vert
>  create mode 100644 tests/spec/glsl-1.30/compiler/void/void-lshift.vert
>  create mode 100644 tests/spec/glsl-1.30/compiler/void/void-mod.vert
>  create mode 100644 tests/spec/glsl-1.30/compiler/void/void-mod_assign.vert
>  create mode 100644 tests/spec/glsl-1.30/compiler/void/void-rshift.vert
>  create mode 100644 tests/spec/glsl-1.30/compiler/void/void-shift_assign.vert
>  create mode 100644 tests/spec/glsl-1.30/compiler/void/void-unary_not.vert
>  create mode 100644 tests/spec/glsl-1.30/compiler/void/void-unary_tilde.vert
> 
> diff --git a/tests/spec/glsl-1.10/compiler/void/void-array_subscript.vert 
> b/tests/spec/glsl-1.10/compiler/void/void-array_subscript.vert
> new file mode 100644
> in

Re: [Piglit] [PATCH] arb_uniform_buffer_object: fix UNIFORM_BUFFER_START and UNIFORM_BUFFER_SIZE queries when no buffer object is bound

2015-06-08 Thread Samuel Iglesias Gonsálvez
I plan to push this patch at the end of this week if no complains.

Sam

On 14/05/15 08:56, Samuel Iglesias Gonsalvez wrote:
> According to ARB_uniform_buffer_object spec:
> 
> "If the parameter (starting offset or size) was not specified when the
>  buffer object was bound (e.g. if bound with BindBufferBase), or if no
>  buffer object is bound to , zero is returned."
> 
> Tested on NVIDIA's proprietary driver version 340.65 and ATI proprietary
> driver version 13.35.1005.
> 
> Signed-off-by: Samuel Iglesias Gonsalvez 
> ---
>  tests/spec/arb_uniform_buffer_object/getintegeri_v.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/spec/arb_uniform_buffer_object/getintegeri_v.c 
> b/tests/spec/arb_uniform_buffer_object/getintegeri_v.c
> index d1b685f..9ed5fcc 100644
> --- a/tests/spec/arb_uniform_buffer_object/getintegeri_v.c
> +++ b/tests/spec/arb_uniform_buffer_object/getintegeri_v.c
> @@ -79,7 +79,7 @@ piglit_init(int argc, char **argv)
>  
>   piglit_require_extension("GL_ARB_uniform_buffer_object");
>  
> - test_range(__LINE__, 0, 0, -1, -1);
> + test_range(__LINE__, 0, 0, 0, 0);
>  
>   glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, &alignment);
>  
> @@ -117,7 +117,7 @@ piglit_init(int argc, char **argv)
>* of the GL API, including glBindBuffer(), to allow it
>*/
>   glBindBufferBase(GL_UNIFORM_BUFFER, 0, 0);
> - test_range(__LINE__, 0, 0, -1, -1);
> + test_range(__LINE__, 0, 0, 0, 0);
>  
>   /* Test the error condition. */
>   glGetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, &max_bindings);
> 
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 00/13] Add more arb_shader_storage_buffer_object tests

2015-06-07 Thread Samuel Iglesias Gonsálvez


On 05/06/15 09:50, Jordan Justen wrote:
> On 2015-05-13 23:17:12, Samuel Iglesias Gonsalvez wrote:
>> This patchset adds piglit tests for arb_shader_storage_buffer_object
>> extension.
>>
>> They are also available on this repository:
>>
>> $ git clone -b arb_shader_storage_buffer_object-v1 \
>>   https://github.com/Igalia/piglit.git
>>
>> Thanks,
>>
>> Sam
>>
>> Samuel Iglesias Gonsalvez (13):
>>   arb_shader_storage_buffer_object: Add preprocessor tests
>>   arb_shader_storage_buffer_object: add compiler tests
>>   arb_shader_storage_buffer_object: Add linker tests
>>   arb_shader_storage_buffer: Add rendering test
>>   arb_shader_storage_buffer_object: add test for
>> GL_MAX_SHADER_STORAGE_BUFFER_SIZE
>>   arb_shader_storage_buffer_object: add test to check glGetIntegeri_v()
>> queries
>>   arb_shader_storage_buffer_object: Add new test for glDeleteBuffers()
>> behavior
>>   arb_shader_storage_buffer_object: Add test to check maximum number of
>> allowed SSBOs
>>   arb_shader_storage_buffer_object: New test for setting/getting block
>> bindings.
>>   arb_shader_storage_buffer_object: Add test for setting binding point
>> to an array of SSBOs
>>   arb_shader_storage_buffer_object: add test to check SSBO writes with
>> layout(std430)
>>   arb_shader_storage_buffer_object: add test to check SSBO writes with
>> layout(std140)
>>   arb_shader_storage_buffer_object: Add test for buffer variable queries
>>
>>  tests/all.py   |  21 ++
>>  .../CMakeLists.gl.txt  |  10 +
>>  .../array-ssbo-binding.c   | 149 +
>>  .../extension-disabled-shader-storage-block.frag   |  15 +
>>  .../compiler/extension-disabled-std430.frag|  13 +
>>  .../compiler/layout-std430-non-shader-storage.frag |  24 ++
>>  .../compiler/layout-std430-within-block.frag   |  22 ++
>>  .../compiler/shader-storage-block-initializer.frag |  21 ++
>>  .../compiler/shader-storage-block-sampler.frag |  23 ++
>>  .../compiler/shader-storage-outside-block.frag |  20 ++
>>  .../compiler/unsized-array-argument-function.frag  |  29 ++
>>  .../unsized-array-not-in-last-position.frag|  24 ++
>>  .../deletebuffers.c| 105 ++
>>  .../getintegeri_v.c| 120 +++
>>  .../layout-std140-write-shader.c   | 161 +
>>  .../layout-std430-write-shader.c   | 185 +++
>>  ...hader-storage-block-different-def-2.shader_test |  40 +++
>>  ...hader-storage-block-different-def-3.shader_test |  40 +++
>>  .../shader-storage-block-different-def.shader_test |  38 +++
>>  ...shader-storage-block-different-size.shader_test |  41 +++
>>  .../arb_shader_storage_buffer_object/maxblocks.c   | 358 
>> +
>>  .../maxshaderstorageblocksize.c| 240 ++
>>  .../preprocessor/define.frag   |  19 ++
>>  .../preprocessor/define.vert   |  19 ++
>>  .../program-interface-query.c  | 166 ++
>>  .../arb_shader_storage_buffer_object/rendering.c   | 232 +
>>  .../shaderstorageblockbinding.c| 125 +++
>>  27 files changed, 2260 insertions(+)
>>  create mode 100644 
>> tests/spec/arb_shader_storage_buffer_object/array-ssbo-binding.c
>>  create mode 100644 
>> tests/spec/arb_shader_storage_buffer_object/compiler/extension-disabled-shader-storage-block.frag
>>  create mode 100644 
>> tests/spec/arb_shader_storage_buffer_object/compiler/extension-disabled-std430.frag
>>  create mode 100644 
>> tests/spec/arb_shader_storage_buffer_object/compiler/layout-std430-non-shader-storage.frag
>>  create mode 100644 
>> tests/spec/arb_shader_storage_buffer_object/compiler/layout-std430-within-block.frag
>>  create mode 100644 
>> tests/spec/arb_shader_storage_buffer_object/compiler/shader-storage-block-initializer.frag
>>  create mode 100644 
>> tests/spec/arb_shader_storage_buffer_object/compiler/shader-storage-block-sampler.frag
>>  create mode 100644 
>> tests/spec/arb_shader_storage_buffer_object/compiler/shader-storage-outside-block.frag
>>  create mode 100644 
>> tests/spec/arb_shader_storage_buffer_object/compiler/unsized-array-argument-function.frag
>>  create mode 100644 
>> tests/spec/arb_shader_storage_buffer_object/compiler/unsized-array-not-in-last-position.frag
>>  create mode 100644 
>> tests/spec/arb_shader_storage_buffer_object/deletebuffers.c
>>  create mode 100644 
>> tests/spec/arb_shader_storage_buffer_object/getintegeri_v.c
>>  create mode 100644 
>> tests/spec/arb_shader_storage_buffer_object/layout-std140-write-shader.c
>>  create mode 100644 
>> tests/spec/arb_shader_storage_buffer_object/layout-std430-write-shader.c
>>  create mode 100644 
>> tests/spec/arb_shader_storage_buffer_object/linker/shader-storage-block-different-def-2.shader_test
>>  create mode 100644 
>> tests/spe

Re: [Piglit] [PATCH] program_interface_query: add new subtest for getprogramresourceiv

2015-05-20 Thread Samuel Iglesias Gonsálvez
On 19/05/15 12:02, Martin Peres wrote:
> On 19/05/15 08:46, Samuel Iglesias Gonsalvez wrote:
>> Test that uniforms inside arrays of uniform blocks with instance name are
>> queried properly.
>>
>> Tested on NVIDIA's proprietary driver version 340.65
>>
>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90397
>>
>> Signed-off-by: Samuel Iglesias Gonsalvez 
>> ---
>>   tests/spec/arb_program_interface_query/common.h   | 12 +---
>>   .../getprogramresourceiv.c| 19
>> +++
>>   .../spec/arb_program_interface_query/resource-query.c | 16
>> 
>>   tests/spec/arb_shader_storage_buffer_object/minmax.c  |  4 ++--
>>   4 files changed, 42 insertions(+), 9 deletions(-)
>>
>> diff --git a/tests/spec/arb_program_interface_query/common.h
>> b/tests/spec/arb_program_interface_query/common.h
>> index 55f0358..4079ac8 100755
>> --- a/tests/spec/arb_program_interface_query/common.h
>> +++ b/tests/spec/arb_program_interface_query/common.h
>> @@ -102,13 +102,19 @@ static const char fs_std[] =
>>   "uniform fs_uniform_block {"
>>   "vec4 fs_color;\n"
>>   "float fs_array[4];\n"
>> -"};"
>> +"};\n"
>> +"uniform fs_array_uniform_block {\n"
>> +"vec4 fs_color;\n"
>> +"float fs_array[4];\n"
>> +"} ubo[4];\n"
> 
> Hmm, aside from the obvious problem of having ubo != uniform_block,

I am going to rename that name uniform block in the second version of
the patch.

> I
> wonder what would happen if you instead had:
> 
> +"} faub1[2], faub2[2];\n"
> 

That kind of definition is not allowed in the spec. I think it is only
one instance name per interface block.

I tried defining "faub2[2]" by repeating the fs_array_uniform_block
definition but i965 doesn't allowed it, although NVIDIA does.

> 
> I am worried that you would get the following resources listed:
> 
> +   "fs_array_uniform_block[0]",
> +   "fs_array_uniform_block[1]",
> +   "fs_array_uniform_block[0]",
> +   "fs_array_uniform_block[1]",
> 

In my tests on NVIDIA, I get:

+   "fs_array_uniform_block[0]",
+   "fs_array_uniform_block[1]",

But they are not repeated. I guess NVIDIA thinks they are the same
uniform block but I did not check it further.

> 
> which would be a clear indication that the driver is broken. My view on
> this is that named uniform blocks should use their named version when
> being referenced. What do you think?

I have been checking what the specs say about it.

* In ARB_program_interface_query, GetProgramResourceName() is equivalent
to GetActiveUniformBlockName().

* Looking at ARB_uniform_buffer_object, GetActiveUniformBlockName() is
talking about uniform block name.

* Looking at GLSL spec (for example 4.4), when talking about interface
block (4.3.9 Interface Blocks), its definition is:

layout-qualifieropt interface-qualifier block-name { member-list }
instance-nameopt ;

But also, the same sections talks about the name:

"For blocks declared as arrays, the array index must also be included
 when accessing members, as in this example

  uniform Transform { // API uses “Transform[2]” to refer to instance 2
mat4 ModelViewMatrix;
mat4 ModelViewProjectionMatrix;
vec4 a[]; // array will get implicitly sized
float Deformation;
  } transforms[4];

 [...]
 When using OpenGL API entry points to identify the name of an
 individual block in an array of blocks, the name string must include
 an array index (e.g., Transform[2])."

Notice that it is talking about the block name, not the instance name.
So the current behaviour is right.


>>   "in vec4 fs_input1;\n"
>>   "out vec4 fs_output0;\n"
>>   "out vec4 fs_output1;\n"
>>   "void main() {\n"
>> -"fs_output0 = fs_color * fs_input1 * fs_array[2];\n"
>> -"fs_output1 = fs_color * fs_input1 * fs_array[3];\n"
>> +"fs_output0 = fs_color * fs_input1 * fs_array[2] * \n"
>> +"  ubo[0].fs_array[2] * ubo[2].fs_array[2];\n"
>> +"fs_output1 = fs_color * fs_input1 * fs_array[3] * \n"
>> +" ubo[1].fs_array[3] * ubo[3].fs_array[3];\n"
>>   "}";
>> static const char vs_stor[] =
>> diff --git
>> a/tests/spec/arb_program_interface_query/getprogramresourceiv.c
>> b/tests/spec/arb_program_interface_query/getprogramresourceiv.c
>> index da9751a..03f2fc6 100755
>> --- a/tests/spec/arb_program_interface_query/getprogramresourceiv.c
>> +++ b/tests/spec/arb_program_interface_query/getprogramresourceiv.c
>> @@ -454,6 +454,25 @@ static const struct subtest_t subtests[] = {
>>   { GL_REFERENCED_BY_COMPUTE_SHADER, 1, { 0 } },
>>   { 0, 0, { 0 } }}
>>},
>> + { &prog_std, GL_UNIFORM, "fs_array_uniform_block.fs_array",
>> "fs_array_uniform_block[0]", {
>> +{ GL_NAME_LENGTH, 1, { 35 } },
>> +{ GL_TYPE, 1, { GL_FLOAT } },
>> +{ GL_ARRAY_SIZE, 1, { 4 } },
>> +{ GL_

Re: [Piglit] [PATCH v2 1/2] shaders: add test to check (0 cmp x+y) optimization

2015-03-11 Thread Samuel Iglesias Gonsálvez
On Tue, 2015-03-10 at 18:23 -0700, Matt Turner wrote:
> On Sun, Mar 1, 2015 at 11:31 PM, Samuel Iglesias Gonsalvez
>  wrote:
> > Signed-off-by: Samuel Iglesias Gonsalvez 
> > ---
> >
> > v2:
> > * Implement it as shader_runner test
> >
> >  tests/shaders/glsl-opt-0-cmp-xy.shader_test | 33 
> > +
> >  1 file changed, 33 insertions(+)
> >  create mode 100644 tests/shaders/glsl-opt-0-cmp-xy.shader_test
> >
> > diff --git a/tests/shaders/glsl-opt-0-cmp-xy.shader_test 
> > b/tests/shaders/glsl-opt-0-cmp-xy.shader_test
> > new file mode 100644
> > index 000..57c5716
> > --- /dev/null
> > +++ b/tests/shaders/glsl-opt-0-cmp-xy.shader_test
> > @@ -0,0 +1,33 @@
> > +/* Test (0 cmp x+y) optimization. */
> > +
> > +[require]
> > +GLSL >= 1.10
> > +
> > +[vertex shader]
> 
> You can use [vertex shader passthrough] and drop the vertex shader body.
> 
> > +
> > +void main()
> > +{
> > +   gl_Position = ftransform();
> > +}
> > +
> > +[fragment shader]
> > +
> > +uniform float a;
> > +
> > +void main()
> > +{
> > +   if (0.0 >= (a - 1.0))
> > +   gl_FragColor = vec4(0, 1, 0, 1);
> > +   else
> > +   gl_FragColor = vec4(1, 0, 0, 1);
> > +}
> > +
> > +[test]
> > +clear color 0.5 0.5 0.5 0.5
> > +clear
> 
> You can remove these two lines since the test is painting the whole window.
> 
> Reviewed-by: Matt Turner 
> 
> Thanks!
> 

I will do those changes.

Thanks for the review!

Sam



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


Re: [Piglit] [PATCH v2 1/2] shaders: add test to check (0 cmp x+y) optimization

2015-03-10 Thread Samuel Iglesias Gonsálvez
On Fri, 2015-03-06 at 08:12 +0100, Samuel Iglesias Gonsálvez wrote:
> Hello,
> 
> I plan to push these two patches next week, just in case someone wants
> to review them in the coming days.

Tomorrow I will push these two patches.

Sam


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


Re: [Piglit] [PATCH v2 1/2] shaders: add test to check (0 cmp x+y) optimization

2015-03-05 Thread Samuel Iglesias Gonsálvez
Hello,

I plan to push these two patches next week, just in case someone wants
to review them in the coming days.

Thanks,

Sam

On Mon, 2015-03-02 at 08:31 +0100, Samuel Iglesias Gonsalvez wrote:
> Signed-off-by: Samuel Iglesias Gonsalvez 
> ---
> 
> v2:
> * Implement it as shader_runner test
> 
>  tests/shaders/glsl-opt-0-cmp-xy.shader_test | 33 
> +
>  1 file changed, 33 insertions(+)
>  create mode 100644 tests/shaders/glsl-opt-0-cmp-xy.shader_test
> 
> diff --git a/tests/shaders/glsl-opt-0-cmp-xy.shader_test 
> b/tests/shaders/glsl-opt-0-cmp-xy.shader_test
> new file mode 100644
> index 000..57c5716
> --- /dev/null
> +++ b/tests/shaders/glsl-opt-0-cmp-xy.shader_test
> @@ -0,0 +1,33 @@
> +/* Test (0 cmp x+y) optimization. */
> +
> +[require]
> +GLSL >= 1.10
> +
> +[vertex shader]
> +
> +void main()
> +{
> + gl_Position = ftransform();
> +}
> +
> +[fragment shader]
> +
> +uniform float a;
> +
> +void main()
> +{
> + if (0.0 >= (a - 1.0))
> + gl_FragColor = vec4(0, 1, 0, 1);
> + else
> + gl_FragColor = vec4(1, 0, 0, 1);
> +}
> +
> +[test]
> +clear color 0.5 0.5 0.5 0.5
> +clear
> +uniform float a 0
> +draw rect -1 -1 1 2
> +uniform float a 2
> +draw rect 0 -1 1 2
> +probe rgb 125 0 1.0 0.0 0.0
> +probe rgb 0 0 0.0 1.0 0.0




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


Re: [Piglit] [PATCH 1/2] shaders: add test to check (0 cmp x+y) optimization

2015-03-01 Thread Samuel Iglesias Gonsálvez
On Fri, 2015-02-27 at 08:16 -0800, Ian Romanick wrote:
> Why were these implemented as C tests instead of shader-runner tests?
> 

Oh, you are right. They should be shader-runner tests. Please ignore
these patches, I will send a new version of them but implemented as
shader-runner tests instead.

Thanks,

Sam 

> On 02/27/2015 05:57 AM, Samuel Iglesias Gonsálvez wrote:
> > This patch is meant to check that a Mesa patch [0] fixes a bug in (0 cmp
> > x+y) optimization, as it was suggested by Ian [1]. Patch 2/2 checks (x+y
> > cmp 0) optimization.
> > 
> > My idea is to push these patches into master branch next week in order
> > to have everything in place before pushing Mesa patch [0]. I am going to
> > wait some days more before pushing them, just in case someone wants to
> > review them.
> > 
> > Thanks,
> > 
> > Sam
> > 
> > [0]
> > http://lists.freedesktop.org/archives/mesa-dev/2015-February/077740.html
> > [1]
> > http://lists.freedesktop.org/archives/mesa-dev/2015-February/077767.html
> > 
> > 
> > On Wed, 2015-02-25 at 15:03 +0100, Samuel Iglesias Gonsalvez wrote:
> >> ---
> >>  tests/all.py  |   1 +
> >>  tests/shaders/CMakeLists.gl.txt   |   1 +
> >>  tests/shaders/glsl-opt-0-cmp-xy.c | 130 
> >> ++
> >>  3 files changed, 132 insertions(+)
> >>  create mode 100644 tests/shaders/glsl-opt-0-cmp-xy.c
> >>
> >> diff --git a/tests/all.py b/tests/all.py
> >> index 40f38cf..d07ae35 100644
> >> --- a/tests/all.py
> >> +++ b/tests/all.py
> >> @@ -506,6 +506,7 @@ add_concurrent_test(shaders, ['glsl-link-bug30552'])
> >>  add_concurrent_test(shaders, ['glsl-link-bug38015'])
> >>  add_concurrent_test(shaders, ['glsl-link-empty-prog-01'])
> >>  add_concurrent_test(shaders, ['glsl-link-empty-prog-02'])
> >> +add_concurrent_test(shaders, ['glsl-opt-0-cmp-xy'])
> >>  shaders['GLSL link single global initializer, 2 shaders'] = \
> >>  PiglitGLTest(['glsl-link-test',
> >>os.path.join('shaders', 
> >> 'glsl-link-initializer-01a.vert'),
> >> diff --git a/tests/shaders/CMakeLists.gl.txt 
> >> b/tests/shaders/CMakeLists.gl.txt
> >> index 3efc6bf..521282b 100644
> >> --- a/tests/shaders/CMakeLists.gl.txt
> >> +++ b/tests/shaders/CMakeLists.gl.txt
> >> @@ -145,6 +145,7 @@ piglit_add_executable (glsl-routing glsl-routing.c)
> >>  piglit_add_executable (shader_runner shader_runner.c parser_utils.c)
> >>  piglit_add_executable (glsl-vs-point-size glsl-vs-point-size.c)
> >>  piglit_add_executable (glsl-sin glsl-sin.c)
> >> +piglit_add_executable (glsl-opt-0-cmp-xy glsl-opt-0-cmp-xy.c)
> >>  IF (UNIX)
> >>target_link_libraries(glsl-sin m)
> >>  ENDIF (UNIX)
> >> diff --git a/tests/shaders/glsl-opt-0-cmp-xy.c 
> >> b/tests/shaders/glsl-opt-0-cmp-xy.c
> >> new file mode 100644
> >> index 000..65cb555
> >> --- /dev/null
> >> +++ b/tests/shaders/glsl-opt-0-cmp-xy.c
> >> @@ -0,0 +1,130 @@
> >> +/*
> >> + * Copyright © 2015 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 O

Re: [Piglit] [PATCH 1/2] shaders: add test to check (0 cmp x+y) optimization

2015-02-27 Thread Samuel Iglesias Gonsálvez
This patch is meant to check that a Mesa patch [0] fixes a bug in (0 cmp
x+y) optimization, as it was suggested by Ian [1]. Patch 2/2 checks (x+y
cmp 0) optimization.

My idea is to push these patches into master branch next week in order
to have everything in place before pushing Mesa patch [0]. I am going to
wait some days more before pushing them, just in case someone wants to
review them.

Thanks,

Sam

[0]
http://lists.freedesktop.org/archives/mesa-dev/2015-February/077740.html
[1]
http://lists.freedesktop.org/archives/mesa-dev/2015-February/077767.html


On Wed, 2015-02-25 at 15:03 +0100, Samuel Iglesias Gonsalvez wrote:
> ---
>  tests/all.py  |   1 +
>  tests/shaders/CMakeLists.gl.txt   |   1 +
>  tests/shaders/glsl-opt-0-cmp-xy.c | 130 
> ++
>  3 files changed, 132 insertions(+)
>  create mode 100644 tests/shaders/glsl-opt-0-cmp-xy.c
> 
> diff --git a/tests/all.py b/tests/all.py
> index 40f38cf..d07ae35 100644
> --- a/tests/all.py
> +++ b/tests/all.py
> @@ -506,6 +506,7 @@ add_concurrent_test(shaders, ['glsl-link-bug30552'])
>  add_concurrent_test(shaders, ['glsl-link-bug38015'])
>  add_concurrent_test(shaders, ['glsl-link-empty-prog-01'])
>  add_concurrent_test(shaders, ['glsl-link-empty-prog-02'])
> +add_concurrent_test(shaders, ['glsl-opt-0-cmp-xy'])
>  shaders['GLSL link single global initializer, 2 shaders'] = \
>  PiglitGLTest(['glsl-link-test',
>os.path.join('shaders', 'glsl-link-initializer-01a.vert'),
> diff --git a/tests/shaders/CMakeLists.gl.txt b/tests/shaders/CMakeLists.gl.txt
> index 3efc6bf..521282b 100644
> --- a/tests/shaders/CMakeLists.gl.txt
> +++ b/tests/shaders/CMakeLists.gl.txt
> @@ -145,6 +145,7 @@ piglit_add_executable (glsl-routing glsl-routing.c)
>  piglit_add_executable (shader_runner shader_runner.c parser_utils.c)
>  piglit_add_executable (glsl-vs-point-size glsl-vs-point-size.c)
>  piglit_add_executable (glsl-sin glsl-sin.c)
> +piglit_add_executable (glsl-opt-0-cmp-xy glsl-opt-0-cmp-xy.c)
>  IF (UNIX)
>   target_link_libraries(glsl-sin m)
>  ENDIF (UNIX)
> diff --git a/tests/shaders/glsl-opt-0-cmp-xy.c 
> b/tests/shaders/glsl-opt-0-cmp-xy.c
> new file mode 100644
> index 000..65cb555
> --- /dev/null
> +++ b/tests/shaders/glsl-opt-0-cmp-xy.c
> @@ -0,0 +1,130 @@
> +/*
> + * Copyright © 2015 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:
> + *Samuel Iglesias Gonsalvez 
> + *
> + */
> +
> +/** @file glsl-opt-0-cmp-xy.c
> + *
> + * It checks (0 cmp x+y) optimization (if any) works fine.
> + *
> + * Test renders two rectangles: left rect's color is green, right rect's 
> color
> + * is red. Left rectangle's width is one pixel larger than right rectangle's.
> + *
> + */
> +
> +#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_VISUAL_DOUBLE;
> +config.window_width = 50;
> +config.window_height = 50;
> +
> +PIGLIT_GL_TEST_CONFIG_END
> +
> +static char vs_code[] =
> +"uniform float a;\n"
> +
> +"void main()\n"
> +"{\n"
> +"gl_Position = ftransform();\n"
> +"}\n";
> +
> +static char fs_code[] =
> +"uniform float a;\n"
> +
> +"void main()\n"
> +"{\n"
> +"if (0.0 >= (a - 1.0))\n"
> +"gl_FragColor = vec4(0, 1, 0, 1);\n"
> +"else\n"
> +"gl_FragColor = vec4(1, 0, 0, 1);\n"
> +"}\n";
> +
> +static GLuint setup_shaders()
> +{
> +GLuint vs, fs, prog;
> +
> +vs = piglit_compile_shader_text(GL_VERTEX_SHADER, vs_code);
> +fs = piglit_compile_shader_text(GL_FRAGMENT_SHADER, fs_code);
> +prog = piglit_link_simple_program(vs, fs);
> +
> +glUseProgram(prog);
> +return prog;
> +}
> +
> +static GLboolean test()
> 

Re: [Piglit] [PATCH] glean/pixelformats: restrict GL_ABGR_EXT format test to the types in the spec

2015-01-14 Thread Samuel Iglesias Gonsálvez
On Wednesday, January 14, 2015 10:06:00 AM Jason Ekstrand wrote:
> On Tue, Jan 13, 2015 at 11:49 PM, Samuel Iglesias Gonsalvez <
> 
> sigles...@igalia.com> wrote:
> > Packed types are not explicitly allowed to work with GL_ABGR_EXT format in
> > the OpenGL spec nor GL_EXT_abgr spec.
> > 
> > NVIDIA allows it but AMD doesn't and Intel driver hasn't allowed it with
> > UNSIGNED_SHORT_5_5_5_1 and UNSIGNED_INT_10_10_10_2 as of c471b09bf4.
> > 
> > Signed-off-by: Samuel Iglesias Gonsalvez 
> > ---
> > 
> >  tests/glean/tpixelformats.cpp | 6 ++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/tests/glean/tpixelformats.cpp b/tests/glean/tpixelformats.cpp
> > index 27881bf..b040957 100644
> > --- a/tests/glean/tpixelformats.cpp
> > +++ b/tests/glean/tpixelformats.cpp
> > @@ -612,6 +612,12 @@ PixelFormatsTest::CompatibleFormatAndType(GLenum
> > format, GLenum datatype) const
> > 
> > if (format == GL_ABGR_EXT && !haveABGR)
> > 
> > return false;
> > 
> > +   // Special case: GL_ABGR_EXT can't be used with packed types
> > +   // because they are not explicitely allowed by GL_ABGR_EXT spec or
> > +   // OpenGL spec.
> 
> I'd word this differently:
> 
> ...because the packed formats specs (which were all written after the
> GL_EXT_abgr) explicitly say that the packed formats can only be used with
> GL_RGB, GL_BGR, GL_RGBA, or GL_BGRA and do not mention GL_ABGR_EXT.
> 
> Either way,
> Reviewed-by: Jason Ekstrand 
> 

Thanks Jason!

Sam

> > +   if (format == GL_ABGR_EXT && IsPackedType(datatype))
> > +   return false;
> > +
> > 
> > if (format == GL_RG && !haveRG)
> > 
> > return false;
> > 
> > --
> > 2.1.0
> > 
> > ___
> > Piglit mailing list
> > Piglit@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/piglit


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


Re: [Piglit] [PATCH] texture-packed-formats: Don't try bother with ABGR_EXT formats

2015-01-13 Thread Samuel Iglesias Gonsálvez
On Monday, January 12, 2015 01:14:23 PM Jason Ekstrand wrote:
> Since GL_ABGR_EXT was extension number 1 to the GL spec, it didn't take
> packed formats into account.  As far as I can tell from the way the packed
> formats extensions are written, packed formats with GL_ABGR_EXT isn't
> allowed by the spec.  NVIDIA allows it but AMD doesn't and our driver
> hasn't allowed ith with UNSIGNED_INT_5_5_5_1 as of c471b09bf4.  Let's stop
> testing invalid things.

Reviewed-by: Samuel Iglesias Gonsalvez 

I sent yesterday morning a similar patch [0] that also stop testing those 
GL_ABGR_EXT format and type combinations in texture-packed-formats.c  and 
tests/glean/tpixelformats.cpp.

As your patch is more complete than mine for texture-packed-formats.c , I am 
going to modify mine and resend it once you have pushed this patch to master.

Sam

[0]  http://lists.freedesktop.org/archives/piglit/2015-January/014052.html

> ---
>  tests/texturing/texture-packed-formats.c | 13 -
>  1 file changed, 13 deletions(-)
> 
> diff --git a/tests/texturing/texture-packed-formats.c
> b/tests/texturing/texture-packed-formats.c index 1c92b1c..87da808 100644
> --- a/tests/texturing/texture-packed-formats.c
> +++ b/tests/texturing/texture-packed-formats.c
> @@ -89,19 +89,6 @@ static const struct pixel_format Formats[] = {
>   { "GL_BGRA/GL_UNSIGNED_SHORT_1_5_5_5_REV",
> GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, 2, 0xfc00, 0x83e0 },
> 
> - { "GL_ABGR_EXT/GL_UNSIGNED_INT_8_8_8_8",
> -   GL_ABGR_EXT, GL_UNSIGNED_INT_8_8_8_8, 4, 0x80ff, 0x8000ff00 },
> - { "GL_ABGR_EXT/GL_UNSIGNED_INT_8_8_8_8_REV",
> -   GL_ABGR_EXT, GL_UNSIGNED_INT_8_8_8_8_REV, 4, 0xff80, 0x00ff0080 },
> - { "GL_ABGR_EXT/GL_UNSIGNED_SHORT_4_4_4_4",
> -   GL_ABGR_EXT, GL_UNSIGNED_SHORT_4_4_4_4, 2, 0x800f, 0x80f0 },
> - { "GL_ABGR_EXT/GL_UNSIGNED_SHORT_4_4_4_4_REV",
> -   GL_ABGR_EXT, GL_UNSIGNED_SHORT_4_4_4_4_REV, 2, 0xf008, 0x0f08 },
> - { "GL_ABGR_EXT/GL_UNSIGNED_SHORT_5_5_5_1",
> -   GL_ABGR_EXT, GL_UNSIGNED_SHORT_5_5_5_1, 2, 0xf801, 0xf83e },
> - { "GL_ABGR_EXT/GL_UNSIGNED_SHORT_1_5_5_5_REV",
> -   GL_ABGR_EXT, GL_UNSIGNED_SHORT_1_5_5_5_REV, 2, 0x800f, 0x7c0f },
> -
>   { "GL_RGB/GL_UNSIGNED_SHORT_5_6_5",
> GL_RGB, GL_UNSIGNED_SHORT_5_6_5, 2, 0xf800, 0x7e0 },
>   { "GL_RGB/GL_UNSIGNED_SHORT_5_6_5_REV",


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


Re: [Piglit] [PATCH] arb_gpu_shader5: Remove unused vars in tf-wrong-stream-value

2014-09-17 Thread Samuel Iglesias Gonsálvez
On Wed, 2014-09-17 at 18:54 +1200, Chris Forbes wrote:
> Signed-off-by: Chris Forbes 
> ---
>  tests/spec/arb_gpu_shader5/linker/tf-wrong-stream-value.c | 4 
>  1 file changed, 4 deletions(-)
> 
> diff --git a/tests/spec/arb_gpu_shader5/linker/tf-wrong-stream-value.c 
> b/tests/spec/arb_gpu_shader5/linker/tf-wrong-stream-value.c
> index afc79ad..4d098c7 100644
> --- a/tests/spec/arb_gpu_shader5/linker/tf-wrong-stream-value.c
> +++ b/tests/spec/arb_gpu_shader5/linker/tf-wrong-stream-value.c
> @@ -80,12 +80,8 @@ static const char *varyings[] = {
>  void
>  piglit_init(int argc, char **argv)
>  {
> - bool pass;
> - unsigned primitive_n;
> - GLint gs_invocation_n;
>   GLuint prog;
>  
> -
>   piglit_require_extension("GL_ARB_gpu_shader5");
>   piglit_require_extension("GL_ARB_transform_feedback3");
>  

Reviewed-by: Samuel Iglesias Gonsalvez 

Sam


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


Re: [Piglit] [PATCH 0/3] arb_gpu_shader5: tests to verify 'stream' layout qualifier

2014-06-25 Thread Samuel Iglesias Gonsálvez
On Wed, 2014-06-25 at 08:25 +0200, Samuel Iglesias Gonsálvez wrote:
> On Fri, 2014-06-20 at 17:02 +0200, Samuel Iglesias Gonsalvez wrote:
> > Hello,
> > 
> > This batch of patches adds tests for testing the layout's qualifier
> > called 'stream' which was introduced in ARB_gpu_shader5 extension.
> > 
> > Each patch adds tests in different directories: compiler, linker and
> > execution under tests/spec/arb_gpu_shader5/
> > 

I have a second version of this series with one fix (remove trailing
whitespace in patch 1) and added a new test as suggested by Chris Forbes
[0].

I will wait one day more before sending the second version just in case
someone wants to comment something about these patches.

Thanks,

Sam

[0] http://lists.freedesktop.org/archives/mesa-dev/2014-June/062117.html



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


Re: [Piglit] [PATCH 0/3] arb_gpu_shader5: tests to verify 'stream' layout qualifier

2014-06-24 Thread Samuel Iglesias Gonsálvez
On Fri, 2014-06-20 at 17:02 +0200, Samuel Iglesias Gonsalvez wrote:
> Hello,
> 
> This batch of patches adds tests for testing the layout's qualifier
> called 'stream' which was introduced in ARB_gpu_shader5 extension.
> 
> Each patch adds tests in different directories: compiler, linker and
> execution under tests/spec/arb_gpu_shader5/
> 
> There is one test (xfb-streams-no-invocations.c) which is based on the

s/xfb-streams-no-invocations/xfb-streams-without-invocations

> previous work by Jordan (xfb-stream). The difference is that this test
> only checks for transform feedback's multiple vertex stream support but
> without invocations.
> 
> Thanks,
> 
> Sam
> 
> Samuel Iglesias Gonsalvez (3):
>   arb_gpu_shader5: add some compiler tests for stream qualifier
>   arb_gpu_shader5: Add linker tests to verify 'stream' layout qualifier
>   arb_gpu_shader5: Add execution test to verify 'stream' layout
> qualifier
> 
>  tests/all.py   |   4 +
>  tests/spec/arb_gpu_shader5/CMakeLists.txt  |   3 +-
>  tests/spec/arb_gpu_shader5/compiler/CMakeLists.txt |   3 +-
>  .../compiler/stream-qualifier/CMakeLists.gl.txt|  12 +
>  .../compiler/stream-qualifier/CMakeLists.txt   |   1 +
>  .../correct-multiple-layout-qualifier-stream.geom  |  40 
>  .../incorrect-in-layout-qualifier-stream.geom  |  19 ++
>  ...ect-multiple-block-layout-qualifier-stream.geom |  32 +++
>  ...incorrect-negative-layout-qualifier-stream.geom |  24 ++
>  .../stream-qualifier/stream_value_too_large.c  | 193 
>  .../arb_gpu_shader5/execution/CMakeLists.gl.txt|   1 +
>  .../execution/xfb-streams-without-invocations.c| 248 
> +
>  .../spec/arb_gpu_shader5/linker/CMakeLists.gl.txt  |  13 ++
>  tests/spec/arb_gpu_shader5/linker/CMakeLists.txt   |   1 +
>  .../linker/emitstreamvertex_stream_too_large.c | 133 +++
>  .../linker/stream-different-zero-gs-fs.shader_test |  50 +
>  .../linker/stream-invalid-prim-output.shader_test  |  54 +
>  .../linker/stream-negative-value.shader_test   |  38 
>  .../arb_gpu_shader5/linker/tf-wrong-stream-value.c | 116 ++
>  19 files changed, 983 insertions(+), 2 deletions(-)
>  create mode 100644 
> tests/spec/arb_gpu_shader5/compiler/stream-qualifier/CMakeLists.gl.txt
>  create mode 100644 
> tests/spec/arb_gpu_shader5/compiler/stream-qualifier/CMakeLists.txt
>  create mode 100644 
> tests/spec/arb_gpu_shader5/compiler/stream-qualifier/correct-multiple-layout-qualifier-stream.geom
>  create mode 100644 
> tests/spec/arb_gpu_shader5/compiler/stream-qualifier/incorrect-in-layout-qualifier-stream.geom
>  create mode 100644 
> tests/spec/arb_gpu_shader5/compiler/stream-qualifier/incorrect-multiple-block-layout-qualifier-stream.geom
>  create mode 100644 
> tests/spec/arb_gpu_shader5/compiler/stream-qualifier/incorrect-negative-layout-qualifier-stream.geom
>  create mode 100644 
> tests/spec/arb_gpu_shader5/compiler/stream-qualifier/stream_value_too_large.c
>  create mode 100644 
> tests/spec/arb_gpu_shader5/execution/xfb-streams-without-invocations.c
>  create mode 100644 tests/spec/arb_gpu_shader5/linker/CMakeLists.gl.txt
>  create mode 100644 tests/spec/arb_gpu_shader5/linker/CMakeLists.txt
>  create mode 100644 
> tests/spec/arb_gpu_shader5/linker/emitstreamvertex_stream_too_large.c
>  create mode 100644 
> tests/spec/arb_gpu_shader5/linker/stream-different-zero-gs-fs.shader_test
>  create mode 100644 
> tests/spec/arb_gpu_shader5/linker/stream-invalid-prim-output.shader_test
>  create mode 100644 
> tests/spec/arb_gpu_shader5/linker/stream-negative-value.shader_test
>  create mode 100644 tests/spec/arb_gpu_shader5/linker/tf-wrong-stream-value.c
> 




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


Re: [Piglit] [PATCH] Fix expected behavior of glBlitFramebuffer() with conditional rendering

2014-04-26 Thread Samuel Iglesias Gonsálvez

On Fri, 2014-04-25 at 20:10 -0700, Ian Romanick wrote:

On 04/25/2014 04:53 PM, Anuj Phogat wrote:
> It is clarified on page 679 of OpenGL 4.4 core profile spec:
>"Added BlitFramebuffer to commands affected by conditional
> rendering in section 10.10 (Bug 9562)."
>
> This addition is also made to OpenGL 4.4 compatibility profile spec.
>
> Tests the bug fix made in mesa commits 1d350b9 and 8ed42dd:
> "i965: Add glBlitFramebuffer to commands affected by conditional
> rendering"

Samuel Iglesias also mentioned in bug #77702 that this test current
fails on NVIDIA.  We should add something like the following to the
commit message:

   Previous to this patch, this test fail on NVIDIA 4200M (driver
   version 331.49), as reported by Samuel Iglesias.

> Signed-off-by: Anuj Phogat 

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77702
Reviewed-by: Ian Romanick 

Maybe wait a day or two for Samuel to send a 'Tested-by'.


It works now on NVIDIA :-)

Tested-by: Samuel Iglesias Gonsalvez 

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