Re: [Piglit] [PATCH] glsl-1.50: test gl_PrimitiveID xfb

2020-01-27 Thread Dave Airlie
On Mon, 6 Jan 2020 at 09:05, Ilia Mirkin  wrote:
>
> This appears to trigger an issue on at least GP108 due to an odd shader
> export write restriction. And we should be testing gl_PrimitiveID
> anyways.
>
> Signed-off-by: Ilia Mirkin 

Reviewed-by: Dave Airlie 
> ---
>  .../execution/geometry/transform-feedback-builtins.c  | 8 +---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git 
> a/tests/spec/glsl-1.50/execution/geometry/transform-feedback-builtins.c 
> b/tests/spec/glsl-1.50/execution/geometry/transform-feedback-builtins.c
> index cfd71c944..4144c7cb1 100644
> --- a/tests/spec/glsl-1.50/execution/geometry/transform-feedback-builtins.c
> +++ b/tests/spec/glsl-1.50/execution/geometry/transform-feedback-builtins.c
> @@ -60,6 +60,7 @@ static const char *gs_template =
> "{\n"
> "  for (int i = 0; i < 3; i++) {\n"
> "gl_Layer = 2 * i + 1;\n"
> +   "gl_PrimitiveID = gl_PrimitiveIDIn + i;\n"
> "%s"
> "EmitVertex();\n"
> "  }\n"
> @@ -71,16 +72,17 @@ static const char *gs_template =
>   * above, the output should be a sequence of integers defined in this
>   * array.
>   */
> -static const int expected[2][3] = {{1, 3, 5}, /* gl_Layer */
> +static const int expected[3][3] = {{1, 3, 5}, /* gl_Layer */
> +  {0, 1, 2}, /* gl_PrimitiveID */
>{1, 2, 3}}; /* gl_ViewportIndex */
>
> -static const char *varyings[] = {"gl_Layer", "gl_ViewportIndex"};
> +static const char *varyings[] = {"gl_Layer", "gl_PrimitiveID", 
> "gl_ViewportIndex"};
>
>  void
>  piglit_init(int argc, char **argv)
>  {
> int i, j, num_xfb_buffers;
> -   GLuint prog, vao, xfb_buf[2];
> +   GLuint prog, vao, xfb_buf[3];
> const GLint *readback;
> char *gstext;
> bool pass = true;
> --
> 2.24.1
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] intel_shader_atomic_float_minmax: Explicitly request std430 layout

2019-06-26 Thread Dave Airlie
On Thu, 27 Jun 2019 at 03:00, Ian Romanick  wrote:
>
> From: Ian Romanick 
>
> These tests preinit the ssbo contents but expect the driver to be doing
> std430 packing by default, just specify std430 packing.

Reviewed-by: Dave Airlie 
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit

[Piglit] [PATCH] ssbo/shared: fix min/max tests to specify std430

2019-06-25 Thread Dave Airlie
From: Dave Airlie 

These tests preinit the ssbo contents but expect the driver to
be doing std430 packing by default, just specify std430 packing.
---
 .../execution/shared-atomicMax-int.shader_test  | 2 +-
 .../execution/shared-atomicMax-uint.shader_test | 2 +-
 .../execution/shared-atomicMin-int.shader_test  | 2 +-
 .../execution/shared-atomicMin-uint.shader_test | 2 +-
 .../execution/ssbo-atomicMax-int.shader_test| 2 +-
 .../execution/ssbo-atomicMax-uint.shader_test   | 2 +-
 .../execution/ssbo-atomicMin-int.shader_test| 2 +-
 .../execution/ssbo-atomicMin-uint.shader_test   | 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)

diff --git 
a/tests/spec/arb_compute_shader/execution/shared-atomicMax-int.shader_test 
b/tests/spec/arb_compute_shader/execution/shared-atomicMax-int.shader_test
index 642e417d0..cc2abc2c0 100644
--- a/tests/spec/arb_compute_shader/execution/shared-atomicMax-int.shader_test
+++ b/tests/spec/arb_compute_shader/execution/shared-atomicMax-int.shader_test
@@ -13,7 +13,7 @@ GL_ARB_shader_atomic_counters
 
 layout(local_size_x = 64) in;
 
-layout(binding = 0) buffer bufblock {
+layout(binding = 0, std430) buffer bufblock {
int source_array[64];
int source_value;
 };
diff --git 
a/tests/spec/arb_compute_shader/execution/shared-atomicMax-uint.shader_test 
b/tests/spec/arb_compute_shader/execution/shared-atomicMax-uint.shader_test
index 8264653e0..a228ecc73 100644
--- a/tests/spec/arb_compute_shader/execution/shared-atomicMax-uint.shader_test
+++ b/tests/spec/arb_compute_shader/execution/shared-atomicMax-uint.shader_test
@@ -13,7 +13,7 @@ GL_ARB_shader_atomic_counters
 
 layout(local_size_x = 64) in;
 
-layout(binding = 0) buffer bufblock {
+layout(binding = 0, std430) buffer bufblock {
uint source_array[64];
uint source_value;
 };
diff --git 
a/tests/spec/arb_compute_shader/execution/shared-atomicMin-int.shader_test 
b/tests/spec/arb_compute_shader/execution/shared-atomicMin-int.shader_test
index c06bd0ed3..ddaa1588f 100644
--- a/tests/spec/arb_compute_shader/execution/shared-atomicMin-int.shader_test
+++ b/tests/spec/arb_compute_shader/execution/shared-atomicMin-int.shader_test
@@ -13,7 +13,7 @@ GL_ARB_shader_atomic_counters
 
 layout(local_size_x = 64) in;
 
-layout(binding = 0) buffer bufblock {
+layout(binding = 0, std430) buffer bufblock {
int source_array[64];
int source_value;
 };
diff --git 
a/tests/spec/arb_compute_shader/execution/shared-atomicMin-uint.shader_test 
b/tests/spec/arb_compute_shader/execution/shared-atomicMin-uint.shader_test
index 93b799327..d1dd6cdea 100644
--- a/tests/spec/arb_compute_shader/execution/shared-atomicMin-uint.shader_test
+++ b/tests/spec/arb_compute_shader/execution/shared-atomicMin-uint.shader_test
@@ -13,7 +13,7 @@ GL_ARB_shader_atomic_counters
 
 layout(local_size_x = 64) in;
 
-layout(binding = 0) buffer bufblock {
+layout(binding = 0, std430) buffer bufblock {
uint source_array[64];
uint source_value;
 };
diff --git 
a/tests/spec/arb_shader_storage_buffer_object/execution/ssbo-atomicMax-int.shader_test
 
b/tests/spec/arb_shader_storage_buffer_object/execution/ssbo-atomicMax-int.shader_test
index b7d59a328..29f181799 100644
--- 
a/tests/spec/arb_shader_storage_buffer_object/execution/ssbo-atomicMax-int.shader_test
+++ 
b/tests/spec/arb_shader_storage_buffer_object/execution/ssbo-atomicMax-int.shader_test
@@ -11,7 +11,7 @@ GL_ARB_shader_atomic_counters
 #extension GL_ARB_shader_storage_buffer_object: require
 #extension GL_ARB_shader_atomic_counters: require
 
-layout(binding = 0) buffer bufblock {
+layout(binding = 0, std430) buffer bufblock {
int array[64];
int value;
 };
diff --git 
a/tests/spec/arb_shader_storage_buffer_object/execution/ssbo-atomicMax-uint.shader_test
 
b/tests/spec/arb_shader_storage_buffer_object/execution/ssbo-atomicMax-uint.shader_test
index c65600fad..e0da2bf88 100644
--- 
a/tests/spec/arb_shader_storage_buffer_object/execution/ssbo-atomicMax-uint.shader_test
+++ 
b/tests/spec/arb_shader_storage_buffer_object/execution/ssbo-atomicMax-uint.shader_test
@@ -11,7 +11,7 @@ GL_ARB_shader_atomic_counters
 #extension GL_ARB_shader_storage_buffer_object: require
 #extension GL_ARB_shader_atomic_counters: require
 
-layout(binding = 0) buffer bufblock {
+layout(binding = 0, std430) buffer bufblock {
uint array[64];
uint value;
 };
diff --git 
a/tests/spec/arb_shader_storage_buffer_object/execution/ssbo-atomicMin-int.shader_test
 
b/tests/spec/arb_shader_storage_buffer_object/execution/ssbo-atomicMin-int.shader_test
index ca83af48a..422782c2b 100644
--- 
a/tests/spec/arb_shader_storage_buffer_object/execution/ssbo-atomicMin-int.shader_test
+++ 
b/tests/spec/arb_shader_storage_buffer_object/execution/ssbo-atomicMin-int.shader_test
@@ -12,7 +12,7 @@ GL_ARB_shader_atomic_counters
 #extension

[Piglit] [PATCH] ssbo: fix min/max tests to specify std430

2019-06-25 Thread Dave Airlie
From: Dave Airlie 

These tests preinit the ssbo contents but expect the driver to
be doing std430 packing by default, just specify std430 packing.

This fixes the tests on softpipe
---
 .../execution/ssbo-atomicMax-int.shader_test| 2 +-
 .../execution/ssbo-atomicMax-uint.shader_test   | 2 +-
 .../execution/ssbo-atomicMin-int.shader_test| 2 +-
 .../execution/ssbo-atomicMin-uint.shader_test   | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/tests/spec/arb_shader_storage_buffer_object/execution/ssbo-atomicMax-int.shader_test
 
b/tests/spec/arb_shader_storage_buffer_object/execution/ssbo-atomicMax-int.shader_test
index b7d59a328..29f181799 100644
--- 
a/tests/spec/arb_shader_storage_buffer_object/execution/ssbo-atomicMax-int.shader_test
+++ 
b/tests/spec/arb_shader_storage_buffer_object/execution/ssbo-atomicMax-int.shader_test
@@ -11,7 +11,7 @@ GL_ARB_shader_atomic_counters
 #extension GL_ARB_shader_storage_buffer_object: require
 #extension GL_ARB_shader_atomic_counters: require
 
-layout(binding = 0) buffer bufblock {
+layout(binding = 0, std430) buffer bufblock {
int array[64];
int value;
 };
diff --git 
a/tests/spec/arb_shader_storage_buffer_object/execution/ssbo-atomicMax-uint.shader_test
 
b/tests/spec/arb_shader_storage_buffer_object/execution/ssbo-atomicMax-uint.shader_test
index c65600fad..e0da2bf88 100644
--- 
a/tests/spec/arb_shader_storage_buffer_object/execution/ssbo-atomicMax-uint.shader_test
+++ 
b/tests/spec/arb_shader_storage_buffer_object/execution/ssbo-atomicMax-uint.shader_test
@@ -11,7 +11,7 @@ GL_ARB_shader_atomic_counters
 #extension GL_ARB_shader_storage_buffer_object: require
 #extension GL_ARB_shader_atomic_counters: require
 
-layout(binding = 0) buffer bufblock {
+layout(binding = 0, std430) buffer bufblock {
uint array[64];
uint value;
 };
diff --git 
a/tests/spec/arb_shader_storage_buffer_object/execution/ssbo-atomicMin-int.shader_test
 
b/tests/spec/arb_shader_storage_buffer_object/execution/ssbo-atomicMin-int.shader_test
index ca83af48a..422782c2b 100644
--- 
a/tests/spec/arb_shader_storage_buffer_object/execution/ssbo-atomicMin-int.shader_test
+++ 
b/tests/spec/arb_shader_storage_buffer_object/execution/ssbo-atomicMin-int.shader_test
@@ -12,7 +12,7 @@ GL_ARB_shader_atomic_counters
 #extension GL_ARB_shader_atomic_counters: require
 
 #line 100
-layout(binding = 0) buffer bufblock {
+layout(binding = 0, std430) buffer bufblock {
int array[64];
int value;
 };
diff --git 
a/tests/spec/arb_shader_storage_buffer_object/execution/ssbo-atomicMin-uint.shader_test
 
b/tests/spec/arb_shader_storage_buffer_object/execution/ssbo-atomicMin-uint.shader_test
index fbae509d8..8af265c60 100644
--- 
a/tests/spec/arb_shader_storage_buffer_object/execution/ssbo-atomicMin-uint.shader_test
+++ 
b/tests/spec/arb_shader_storage_buffer_object/execution/ssbo-atomicMin-uint.shader_test
@@ -11,7 +11,7 @@ GL_ARB_shader_atomic_counters
 #extension GL_ARB_shader_storage_buffer_object: require
 #extension GL_ARB_shader_atomic_counters: require
 
-layout(binding = 0) buffer bufblock {
+layout(binding = 0, std430) buffer bufblock {
uint array[64];
uint value;
 };
-- 
2.21.0

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

Re: [Piglit] [PATCH] shader_runner: don't abort on atomic counter subtest failure

2019-05-23 Thread Dave Airlie
Reviewed-by: Dave Airlie 

On Fri, 24 May 2019 at 11:38, Marek Olšák  wrote:
>
> From: Marek Olšák 
>
> ---
>  tests/shaders/shader_runner.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
> index 8404d548f..6729d82b7 100644
> --- a/tests/shaders/shader_runner.c
> +++ b/tests/shaders/shader_runner.c
> @@ -3958,27 +3958,27 @@ piglit_display(void)
> } else if (parse_str(line, "probe depth ", )) {
> parse_floats(rest, c, 3, NULL);
> if (!piglit_probe_pixel_depth((int) c[0], (int) c[1],
>   c[2])) {
> result = PIGLIT_FAIL;
> }
> } else if (sscanf(line,
>   "probe atomic counter buffer %u %u %s %u",
>   , , s, ) == 4) {
> if (!probe_atomic_counter(ux, uy, s, uz, true)) {
> -   piglit_report_result(PIGLIT_FAIL);
> +   result = PIGLIT_FAIL;
> }
> } else if (sscanf(line,
>   "probe atomic counter %u %s %u",
>   , s, ) == 3) {
> if (!probe_atomic_counter(0, ux, s, uy, false)) {
> -   piglit_report_result(PIGLIT_FAIL);
> +   result = PIGLIT_FAIL;
> }
> } else if (sscanf(line, "probe ssbo uint %d %d %s 0x%x",
>   , , s, ) == 4) {
> if (!probe_ssbo_uint(x, y, s, z))
> result = PIGLIT_FAIL;
> } else if (sscanf(line, "probe ssbo uint %d %d %s %d",
>   , , s, ) == 4) {
> if (!probe_ssbo_uint(x, y, s, z))
> result = PIGLIT_FAIL;
> } else if (sscanf(line,
> --
> 2.17.1
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit

[Piglit] [PATCH] glsl-4.60: backdate semicolon test to run from glsl 1.10

2018-06-13 Thread Dave Airlie
From: Dave Airlie 

Since this was a bug fix and real world apps have the old behaviour
---
 .../glsl-4.60/compiler/extra-semilons-at-global-scope.frag   | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/spec/glsl-4.60/compiler/extra-semilons-at-global-scope.frag 
b/tests/spec/glsl-4.60/compiler/extra-semilons-at-global-scope.frag
index 9da6ade08..b4cb9adb4 100644
--- a/tests/spec/glsl-4.60/compiler/extra-semilons-at-global-scope.frag
+++ b/tests/spec/glsl-4.60/compiler/extra-semilons-at-global-scope.frag
@@ -1,9 +1,10 @@
 // [config]
 // expect_result: pass
-// glsl_version: 4.60
+// glsl_version: 1.10
 // [end config]
+// Although the fix is in GLSL 4.60 we should allows this across all GLSL 
versions.
 
-#version 460
+#version 110
 
 // From the GLSL 4.60 spec, section 1.2.1 (Summary of Changes from Revision 7
 // of GLSL Version 4.50):
-- 
2.17.0

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


[Piglit] [PATCH] arb_gpu_shader_fp64/ssbo: add another vertex ssbo check.

2018-03-08 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

This adds another checks for vertex ssbos
---
 tests/spec/arb_gpu_shader_fp64/vs-non-uniform-control-flow-ssbo.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/tests/spec/arb_gpu_shader_fp64/vs-non-uniform-control-flow-ssbo.c 
b/tests/spec/arb_gpu_shader_fp64/vs-non-uniform-control-flow-ssbo.c
index bb287f5..509d4e0 100644
--- a/tests/spec/arb_gpu_shader_fp64/vs-non-uniform-control-flow-ssbo.c
+++ b/tests/spec/arb_gpu_shader_fp64/vs-non-uniform-control-flow-ssbo.c
@@ -83,6 +83,8 @@ piglit_init(int argc, char **argv)
 {
GLuint buffer, vertexBuffer;
double ssbo_values[SSBO_SIZE] = {0};
+   GLint num_vertex_ssbo;
+
// Vertex data
static const GLfloat vertexData[4 * 3] = {
-1.0f,  -1.0f,  -1.0f,
@@ -94,6 +96,9 @@ piglit_init(int argc, char **argv)
piglit_require_extension("GL_ARB_shader_storage_buffer_object");
piglit_require_GLSL_version(400);
 
+   glGetIntegerv(GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS, _vertex_ssbo);
+   if (num_vertex_ssbo < 1)
+   piglit_report_result(PIGLIT_SKIP);
prog = piglit_build_simple_program(vs_source, fs_source);
glUseProgram(prog);
 
-- 
2.9.5

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


Re: [Piglit] [PATCH] arb_gpu_shader_fp64/ssbo: fix tests to skip is no vertex ssbo available.

2018-03-07 Thread Dave Airlie
On 7 March 2018 at 17:52, Alejandro <apinhe...@igalia.com> wrote:
> Typo on the commit message: "skip is no" => "skip if no"
>
> Some comments below.
>
> On 07/03/18 01:54, Dave Airlie wrote:
>> From: Dave Airlie <airl...@redhat.com>
>>
>> These tests all require varying numbers of ssbos.
>> ---
>>  .../shader_storage/layout-std140-fp64-mixed-shader.c | 5 
>> +
>>  .../arb_gpu_shader_fp64/shader_storage/layout-std140-fp64-shader.c   | 5 
>> +
>>  .../shader_storage/layout-std430-fp64-mixed-shader.c | 5 
>> +
>>  .../arb_gpu_shader_fp64/shader_storage/layout-std430-fp64-shader.c   | 5 
>> +
>>  4 files changed, 20 insertions(+)
>>
>> diff --git 
>> a/tests/spec/arb_gpu_shader_fp64/shader_storage/layout-std140-fp64-mixed-shader.c
>>  
>> b/tests/spec/arb_gpu_shader_fp64/shader_storage/layout-std140-fp64-mixed-shader.c
>> index 96add58..e649fea 100644
>> --- 
>> a/tests/spec/arb_gpu_shader_fp64/shader_storage/layout-std140-fp64-mixed-shader.c
>> +++ 
>> b/tests/spec/arb_gpu_shader_fp64/shader_storage/layout-std140-fp64-mixed-shader.c
>> @@ -213,11 +213,16 @@ piglit_init(int argc, char **argv)
>>   double *map_d;
>>   void *data;
>>   void *data_base;
>> + GLint num_vertex_ssbo;
>>
>>   piglit_require_extension("GL_ARB_shader_storage_buffer_object");
>>   piglit_require_extension("GL_ARB_gpu_shader_fp64");
>>   piglit_require_GLSL_version(150);
>>
>> + glGetIntegerv(GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS, _vertex_ssbo);
>> + if (num_vertex_ssbo < 4)
>> + piglit_report_result(PIGLIT_SKIP);
>
> Why the check is <4 instead of <1 as with other new checks included on
> this patch? As far as I see, the vertex shader on that test uses 1 ssbo.

Ah test had some values like SSBO_SIZE1, 2,3 I just assumed it was
using 4, I'll switch them both to 1.

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


[Piglit] [PATCH] arb_gpu_shader_fp64/ssbo: fix tests to skip is no vertex ssbo available.

2018-03-06 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

These tests all require varying numbers of ssbos.
---
 .../shader_storage/layout-std140-fp64-mixed-shader.c | 5 +
 .../arb_gpu_shader_fp64/shader_storage/layout-std140-fp64-shader.c   | 5 +
 .../shader_storage/layout-std430-fp64-mixed-shader.c | 5 +
 .../arb_gpu_shader_fp64/shader_storage/layout-std430-fp64-shader.c   | 5 +
 4 files changed, 20 insertions(+)

diff --git 
a/tests/spec/arb_gpu_shader_fp64/shader_storage/layout-std140-fp64-mixed-shader.c
 
b/tests/spec/arb_gpu_shader_fp64/shader_storage/layout-std140-fp64-mixed-shader.c
index 96add58..e649fea 100644
--- 
a/tests/spec/arb_gpu_shader_fp64/shader_storage/layout-std140-fp64-mixed-shader.c
+++ 
b/tests/spec/arb_gpu_shader_fp64/shader_storage/layout-std140-fp64-mixed-shader.c
@@ -213,11 +213,16 @@ piglit_init(int argc, char **argv)
double *map_d;
void *data;
void *data_base;
+   GLint num_vertex_ssbo;
 
piglit_require_extension("GL_ARB_shader_storage_buffer_object");
piglit_require_extension("GL_ARB_gpu_shader_fp64");
piglit_require_GLSL_version(150);
 
+   glGetIntegerv(GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS, _vertex_ssbo);
+   if (num_vertex_ssbo < 4)
+   piglit_report_result(PIGLIT_SKIP);
+
prog = piglit_build_simple_program_multiple_shaders(
GL_VERTEX_SHADER, vs_code,
GL_GEOMETRY_SHADER, gs_source,
diff --git 
a/tests/spec/arb_gpu_shader_fp64/shader_storage/layout-std140-fp64-shader.c 
b/tests/spec/arb_gpu_shader_fp64/shader_storage/layout-std140-fp64-shader.c
index e7e2343..0d1754d 100644
--- a/tests/spec/arb_gpu_shader_fp64/shader_storage/layout-std140-fp64-shader.c
+++ b/tests/spec/arb_gpu_shader_fp64/shader_storage/layout-std140-fp64-shader.c
@@ -189,11 +189,16 @@ piglit_init(int argc, char **argv)
GLuint buffer;
unsigned int i;
double *map;
+   GLint num_vertex_ssbo;
 
piglit_require_extension("GL_ARB_shader_storage_buffer_object");
piglit_require_extension("GL_ARB_gpu_shader_fp64");
piglit_require_GLSL_version(150);
 
+   glGetIntegerv(GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS, _vertex_ssbo);
+   if (num_vertex_ssbo < 1)
+   piglit_report_result(PIGLIT_SKIP);
+
prog = piglit_build_simple_program_multiple_shaders(
GL_VERTEX_SHADER, vs_code,
GL_GEOMETRY_SHADER, gs_source,
diff --git 
a/tests/spec/arb_gpu_shader_fp64/shader_storage/layout-std430-fp64-mixed-shader.c
 
b/tests/spec/arb_gpu_shader_fp64/shader_storage/layout-std430-fp64-mixed-shader.c
index 26a8e49..d6bdc13 100644
--- 
a/tests/spec/arb_gpu_shader_fp64/shader_storage/layout-std430-fp64-mixed-shader.c
+++ 
b/tests/spec/arb_gpu_shader_fp64/shader_storage/layout-std430-fp64-mixed-shader.c
@@ -245,11 +245,16 @@ piglit_init(int argc, char **argv)
double *map_d;
void *data;
void *data_base;
+   GLint num_vertex_ssbo;
 
piglit_require_extension("GL_ARB_shader_storage_buffer_object");
piglit_require_extension("GL_ARB_gpu_shader_fp64");
piglit_require_GLSL_version(150);
 
+   glGetIntegerv(GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS, _vertex_ssbo);
+   if (num_vertex_ssbo < 4)
+   piglit_report_result(PIGLIT_SKIP);
+
prog = piglit_build_simple_program_multiple_shaders(
GL_VERTEX_SHADER, vs_code,
GL_GEOMETRY_SHADER, gs_source,
diff --git 
a/tests/spec/arb_gpu_shader_fp64/shader_storage/layout-std430-fp64-shader.c 
b/tests/spec/arb_gpu_shader_fp64/shader_storage/layout-std430-fp64-shader.c
index 00adfc8..9d92567 100644
--- a/tests/spec/arb_gpu_shader_fp64/shader_storage/layout-std430-fp64-shader.c
+++ b/tests/spec/arb_gpu_shader_fp64/shader_storage/layout-std430-fp64-shader.c
@@ -223,11 +223,16 @@ piglit_init(int argc, char **argv)
GLuint buffer;
unsigned int i;
double *map;
+   GLint num_vertex_ssbo;
 
piglit_require_extension("GL_ARB_shader_storage_buffer_object");
piglit_require_extension("GL_ARB_gpu_shader_fp64");
piglit_require_GLSL_version(150);
 
+   glGetIntegerv(GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS, _vertex_ssbo);
+   if (num_vertex_ssbo < 1)
+   piglit_report_result(PIGLIT_SKIP);
+
prog = piglit_build_simple_program_multiple_shaders(
GL_VERTEX_SHADER, vs_code,
GL_GEOMETRY_SHADER, gs_source,
-- 
2.9.5

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


Re: [Piglit] [PATCH] shader_image: fix max images if fragment shader has limited outputs.

2018-02-28 Thread Dave Airlie
On 1 March 2018 at 04:08, Francisco Jerez <curroje...@riseup.net> wrote:
> Dave Airlie <airl...@gmail.com> writes:
>
>> From: Dave Airlie <airl...@redhat.com>
>>
>> This drops one from the max images as the fragment shader needs
>> one output for outputing the results
>>
>> Signed-off-by: Dave Airlie <airl...@redhat.com>
>> ---
>>  tests/spec/arb_shader_image_load_store/image.c | 5 -
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/tests/spec/arb_shader_image_load_store/image.c 
>> b/tests/spec/arb_shader_image_load_store/image.c
>> index e664d3cc4..1bfaebfdb 100644
>> --- a/tests/spec/arb_shader_image_load_store/image.c
>> +++ b/tests/spec/arb_shader_image_load_store/image.c
>> @@ -670,11 +670,14 @@ num_reserved_images(GLbitfield stages)
>>  unsigned
>>  image_stage_max_images(const struct image_stage_info *stage)
>>  {
>> -int n = 0;
>> +int n = 0, n2 = 0;
>>
>>  switch (stage->stage) {
>>  case GL_FRAGMENT_SHADER:
>>  glGetIntegerv(GL_MAX_FRAGMENT_IMAGE_UNIFORMS, );
>> +glGetIntegerv(GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES, );
>> + if (n == n2)
>> + n--;
>
> I don't think this is guaranteed to fix the problem where there is one.
> GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES imposes a limit on the number of
> active image units in the whole pipeline, and you can reach it whether
> GL_MAX_FRAGMENT_IMAGE_UNIFORMS is equal, lower or greater than
> GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES.  You probably need to fix the
> test case instead to require a lower number of image units.

In practice the number of drivers that set
GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES
to a lower value is evergreen gpus, and they don't support image units
anywhere else in the pipeline.

I'm not sure we'll see any other gpu where it's very different.

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


[Piglit] [PATCH] shader_image: fix max images if fragment shader has limited outputs.

2018-02-27 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

This drops one from the max images as the fragment shader needs
one output for outputing the results

Signed-off-by: Dave Airlie <airl...@redhat.com>
---
 tests/spec/arb_shader_image_load_store/image.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tests/spec/arb_shader_image_load_store/image.c 
b/tests/spec/arb_shader_image_load_store/image.c
index e664d3cc4..1bfaebfdb 100644
--- a/tests/spec/arb_shader_image_load_store/image.c
+++ b/tests/spec/arb_shader_image_load_store/image.c
@@ -670,11 +670,14 @@ num_reserved_images(GLbitfield stages)
 unsigned
 image_stage_max_images(const struct image_stage_info *stage)
 {
-int n = 0;
+int n = 0, n2 = 0;
 
 switch (stage->stage) {
 case GL_FRAGMENT_SHADER:
 glGetIntegerv(GL_MAX_FRAGMENT_IMAGE_UNIFORMS, );
+glGetIntegerv(GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES, );
+   if (n == n2)
+   n--;
 break;
 
 case GL_VERTEX_SHADER:
-- 
2.14.3

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


[Piglit] [PATCH] shader_image: decrease number of images in indexing test

2018-02-27 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

This decreases the indexing test to use 7 images, so it can run
on GPUs which have a limit of 8 images.

Signed-off-by: Dave Airlie <airl...@redhat.com>
---
 tests/spec/arb_shader_image_load_store/indexing.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tests/spec/arb_shader_image_load_store/indexing.c 
b/tests/spec/arb_shader_image_load_store/indexing.c
index acef2db17..5a7c2eb09 100644
--- a/tests/spec/arb_shader_image_load_store/indexing.c
+++ b/tests/spec/arb_shader_image_load_store/indexing.c
@@ -64,7 +64,7 @@ init_images(const struct image_info img, GLuint prog)
 uint32_t pixels[H][W];
 int i, j, unit;
 
-for (unit = 0; unit < 8; ++unit) {
+for (unit = 0; unit < 7; ++unit) {
 char *name = NULL;
 
 for (i = 0; i < W; ++i)
@@ -98,9 +98,9 @@ check(const struct grid_info grid, unsigned u)
 /* Active invocation. */
 unsigned x = 0;
 
-for (unit = 0; unit < 8; ++unit)
+for (unit = 0; unit < 7; ++unit)
 x = (x << 4 |
- ((i + j + (unit + u) % 8) % 16));
+ ((i + j + (unit + u) % 7) % 16));
 
 expect[j][i] = x;
 }
@@ -126,7 +126,7 @@ run_test(const struct image_stage_info *stage)
 grid, stage->stage ,
 concat(image_hunk(img, ""),
hunk("uniform int u;\n"
-"IMAGE_UNIFORM_T imgs[8];\n"
+"IMAGE_UNIFORM_T imgs[7];\n"
 "\n"
 "GRID_T op(ivec2 idx, GRID_T x) {\n"
 "int i;\n"
@@ -134,9 +134,9 @@ run_test(const struct image_stage_info *stage)
 "if (idx.x % 2 == idx.y % 3)\n"
 "return GRID_T(0xdeadcafeu);\n"
 "\n"
-"for (i = 0; i < 8; ++i) {\n"
+"for (i = 0; i < 7; ++i) {\n"
 "x.x = (x.x << 4 |"
-"   imageLoad(imgs[(i + u) % 
8],"
+"   imageLoad(imgs[(i + u) % 
7],"
 " 
IMAGE_ADDR(idx)).x);\n"
 "}\n"
 "\n"
-- 
2.14.3

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


Re: [Piglit] [PATCH 1/2] ssbo: block more tests on lack of vertex ssbo

2017-11-29 Thread Dave Airlie
> Hi.
>
> This patch introduced these compiler warnings.

Thanks, pushed the fix.

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


[Piglit] [PATCH] arb_shader_clock: fix use of atomic counters

2017-11-29 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

This test was trying to use two atomic counters at different
buffer bindings, but the shader runner just allocates one bo,
so just use the same binding, they will end up sequential.
---
 tests/spec/arb_shader_clock/execution/clock.shader_test | 2 +-
 tests/spec/arb_shader_clock/execution/clock2x32.shader_test | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/spec/arb_shader_clock/execution/clock.shader_test 
b/tests/spec/arb_shader_clock/execution/clock.shader_test
index 07530e6..c7c9116 100644
--- a/tests/spec/arb_shader_clock/execution/clock.shader_test
+++ b/tests/spec/arb_shader_clock/execution/clock.shader_test
@@ -12,7 +12,7 @@ GL_ARB_shader_clock
 layout(local_size_x = 1) in;
 
 layout(binding = 0) uniform atomic_uint good;
-layout(binding = 1) uniform atomic_uint bad;
+layout(binding = 0) uniform atomic_uint bad;
 
 layout(std430, binding = 0) buffer ssbo_data {
uint64_t ssbo_time[];
diff --git a/tests/spec/arb_shader_clock/execution/clock2x32.shader_test 
b/tests/spec/arb_shader_clock/execution/clock2x32.shader_test
index 1a2bfef..e20f797 100644
--- a/tests/spec/arb_shader_clock/execution/clock2x32.shader_test
+++ b/tests/spec/arb_shader_clock/execution/clock2x32.shader_test
@@ -10,7 +10,7 @@ GL_ARB_shader_clock
 layout(local_size_x = 1) in;
 
 layout(binding = 0) uniform atomic_uint good;
-layout(binding = 1) uniform atomic_uint bad;
+layout(binding = 0) uniform atomic_uint bad;
 
 layout(std430, binding = 0) buffer ssbo_data {
uvec2 ssbo_time[];
-- 
2.9.5

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


[Piglit] [PATCH 1/2] ssbo: block more tests on lack of vertex ssbo

2017-11-16 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

---
 tests/spec/arb_shader_storage_buffer_object/array-ssbo-binding.c | 5 +
 .../arb_shader_storage_buffer_object/layout-std140-write-shader.c| 4 
 .../arb_shader_storage_buffer_object/layout-std430-write-shader.c| 5 +
 3 files changed, 14 insertions(+)

diff --git a/tests/spec/arb_shader_storage_buffer_object/array-ssbo-binding.c 
b/tests/spec/arb_shader_storage_buffer_object/array-ssbo-binding.c
index d98795d..68242c1 100644
--- a/tests/spec/arb_shader_storage_buffer_object/array-ssbo-binding.c
+++ b/tests/spec/arb_shader_storage_buffer_object/array-ssbo-binding.c
@@ -83,10 +83,15 @@ piglit_init(int argc, char **argv)
float ssbo_values[SSBO_SIZE] = {0};
float *map;
int index;
+   GLint num_vertex_ssbo;
 
piglit_require_extension("GL_ARB_shader_storage_buffer_object");
piglit_require_extension("GL_ARB_program_interface_query");
 
+   glGetIntegerv(GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS, _vertex_ssbo);
+   if (num_vertex_ssbo < 1)
+   piglit_report_result(PIGLIT_SKIP);
+
prog = piglit_build_simple_program(vs_pass_thru_text, fs_source);
 
glUseProgram(prog);
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 914fc00..5ae4c1c 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
@@ -119,10 +119,14 @@ piglit_init(int argc, char **argv)
unsigned int i;
float ssbo_values[SSBO_SIZE] = {0};
float *map;
+   GLuint num_vertex_ssbo;
 
piglit_require_extension("GL_ARB_shader_storage_buffer_object");
 piglit_require_GLSL_version(130);
 
+   glGetIntegerv(GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS, _vertex_ssbo);
+   if (num_vertex_ssbo < 1)
+   piglit_report_result(PIGLIT_SKIP);
prog = piglit_build_simple_program(vs_pass_thru_text, fs_source);
 
glUseProgram(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 3d5dcdc..0aa7fa7 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
@@ -159,10 +159,15 @@ piglit_init(int argc, char **argv)
unsigned int i;
float ssbo_values[SSBO_SIZE] = {0};
float *map;
+   GLuint num_vertex_ssbo;
 
piglit_require_extension("GL_ARB_shader_storage_buffer_object");
 piglit_require_GLSL_version(130);
 
+   glGetIntegerv(GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS, _vertex_ssbo);
+   if (num_vertex_ssbo < 1)
+   piglit_report_result(PIGLIT_SKIP);
+
prog = piglit_build_simple_program(vs_pass_thru_text, fs_source);
 
glUseProgram(prog);
-- 
2.9.5

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


[Piglit] [PATCH 2/2] ssbo/linker: move some linker tests to using a fragment shader ssbo

2017-11-16 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

---
 .../linker/implicit_size_array_member.shader_test  | 7 +++
 .../linker/sized_arrays_of_arrays_member.shader_test   | 6 ++
 .../linker/unsized_arrays_of_arrays_member.shader_test | 7 +++
 3 files changed, 8 insertions(+), 12 deletions(-)

diff --git 
a/tests/spec/arb_shader_storage_buffer_object/linker/implicit_size_array_member.shader_test
 
b/tests/spec/arb_shader_storage_buffer_object/linker/implicit_size_array_member.shader_test
index 03b2b7c..7f103ee 100644
--- 
a/tests/spec/arb_shader_storage_buffer_object/linker/implicit_size_array_member.shader_test
+++ 
b/tests/spec/arb_shader_storage_buffer_object/linker/implicit_size_array_member.shader_test
@@ -12,7 +12,9 @@
 GLSL >= 1.50
 GL_ARB_shader_storage_buffer_object
 
-[vertex shader]
+[vertex shader passthrough]
+
+[fragment shader]
 #version 150
 #extension GL_ARB_shader_storage_buffer_object: require
 
@@ -21,13 +23,10 @@ buffer a {
vec4 a[];
 } b;
 
-in vec4 piglit_vertex;
 out vec4 c;
 
 void main(void) {
c = b.s[0] + b.s[1];
-
-   gl_Position = piglit_vertex;
 }
 
 [test]
diff --git 
a/tests/spec/arb_shader_storage_buffer_object/linker/sized_arrays_of_arrays_member.shader_test
 
b/tests/spec/arb_shader_storage_buffer_object/linker/sized_arrays_of_arrays_member.shader_test
index ae5e682..45c922b 100644
--- 
a/tests/spec/arb_shader_storage_buffer_object/linker/sized_arrays_of_arrays_member.shader_test
+++ 
b/tests/spec/arb_shader_storage_buffer_object/linker/sized_arrays_of_arrays_member.shader_test
@@ -13,7 +13,8 @@ GLSL >= 1.50
 GL_ARB_shader_storage_buffer_object
 GL_ARB_arrays_of_arrays
 
-[vertex shader]
+[vertex shader passthrough]
+[fragment shader]
 #version 150
 #extension GL_ARB_shader_storage_buffer_object: require
 #extension GL_ARB_arrays_of_arrays: require
@@ -23,13 +24,10 @@ buffer a {
vec4 aoa[2][2];
 } b;
 
-in vec4 piglit_vertex;
 out vec4 c;
 
 void main(void) {
c = b.s;
-
-   gl_Position = piglit_vertex;
 }
 
 [test]
diff --git 
a/tests/spec/arb_shader_storage_buffer_object/linker/unsized_arrays_of_arrays_member.shader_test
 
b/tests/spec/arb_shader_storage_buffer_object/linker/unsized_arrays_of_arrays_member.shader_test
index 614d30e..24eced2 100644
--- 
a/tests/spec/arb_shader_storage_buffer_object/linker/unsized_arrays_of_arrays_member.shader_test
+++ 
b/tests/spec/arb_shader_storage_buffer_object/linker/unsized_arrays_of_arrays_member.shader_test
@@ -13,7 +13,9 @@ GLSL >= 1.50
 GL_ARB_shader_storage_buffer_object
 GL_ARB_arrays_of_arrays
 
-[vertex shader]
+[vertex shader passthrough]
+
+[fragment shader]
 #version 150
 #extension GL_ARB_shader_storage_buffer_object: require
 #extension GL_ARB_arrays_of_arrays: require
@@ -23,13 +25,10 @@ buffer a {
vec4 aoa[][2];
 } b;
 
-in vec4 piglit_vertex;
 out vec4 c;
 
 void main(void) {
c = b.s;
-
-   gl_Position = piglit_vertex;
 }
 
 [test]
-- 
2.9.5

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


[Piglit] [PATCH 1/5] ssbo: handle lack of vertex shader ssbo support in test.

2017-11-16 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

---
 .../program-interface-query.c  | 54 +++---
 1 file changed, 37 insertions(+), 17 deletions(-)

diff --git 
a/tests/spec/arb_shader_storage_buffer_object/program-interface-query.c 
b/tests/spec/arb_shader_storage_buffer_object/program-interface-query.c
index 131cd40..c21a37c 100644
--- a/tests/spec/arb_shader_storage_buffer_object/program-interface-query.c
+++ b/tests/spec/arb_shader_storage_buffer_object/program-interface-query.c
@@ -59,6 +59,15 @@ static const char vs_pass_thru_text[] =
"   a_std140[0].s[0].b[0] = mat2(1.0, 2.0, 3.0, 4.0);\n"
 "}\n";
 
+static const char vs_no_ssbo_text[] =
+   "#version 330\n"
+   "\n"
+   "in vec4 piglit_vertex;\n"
+   "\n"
+   "void main() {\n"
+   "   gl_Position = piglit_vertex;\n"
+"}\n";
+
 static const char fs_source[] =
"#version 330\n"
"#extension GL_ARB_shader_storage_buffer_object : require\n"
@@ -108,29 +117,38 @@ piglit_init(int argc, char **argv)
   
"GL_REFERENCED_BY_FRAGMENT_SHADER" };
int query_std140[NUM_QUERIES] = {0};
int query_std430[NUM_QUERIES] = {0};
+   int num_vertex_ssbo;
const int expected_std140[NUM_QUERIES] =
{ 0, 112, GL_FLOAT_MAT2, 3, 0, 16, 32, 16, 1, 1, 0 };
-   const int expected_std430[NUM_QUERIES] =
+   int expected_std430[NUM_QUERIES] =
{ 2, 56, GL_FLOAT_MAT2, 3, 2, 16, 16, 8, 0, 0, 1 };
int i;
+   bool has_vertex_ssbo = true;
 
piglit_require_extension("GL_ARB_shader_storage_buffer_object");
piglit_require_extension("GL_ARB_program_interface_query");
 
-   prog = piglit_build_simple_program(vs_pass_thru_text, fs_source);
+   glGetIntegerv(GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS, _vertex_ssbo);
+   if (num_vertex_ssbo == 0) {
+   has_vertex_ssbo = false;
+   /* modify GL_BLOCK_INDEX return */
+   expected_std430[4] = 0;
+   }
+   prog = piglit_build_simple_program(has_vertex_ssbo ? vs_pass_thru_text 
: vs_no_ssbo_text, fs_source);
 
glUseProgram(prog);
 
-   /* First ssbo_std140 */
-   index = glGetProgramResourceIndex(prog,
- GL_BUFFER_VARIABLE,
- "ssbo_std140.s[0].b[0]");
-   glGetProgramResourceiv(prog, GL_BUFFER_VARIABLE, index,
-   NUM_QUERIES, prop, NUM_QUERIES, NULL,
-  query_std140);
-   if (!piglit_check_gl_error(GL_NO_ERROR))
-  pass = false;
-
+   if (has_vertex_ssbo) {
+   /* First ssbo_std140 */
+   index = glGetProgramResourceIndex(prog,
+ GL_BUFFER_VARIABLE,
+ "ssbo_std140.s[0].b[0]");
+   glGetProgramResourceiv(prog, GL_BUFFER_VARIABLE, index,
+  NUM_QUERIES, prop, NUM_QUERIES, NULL,
+  query_std140);
+   if (!piglit_check_gl_error(GL_NO_ERROR))
+   pass = false;
+   }
/* Now ssbo_std430 */
index = glGetProgramResourceIndex(prog,
  GL_BUFFER_VARIABLE,
@@ -143,11 +161,13 @@ piglit_init(int argc, char **argv)
   pass = false;
 
for (i = 0 ; i < NUM_QUERIES; i++) {
-   if (query_std140[i] != expected_std140[i]) {
-   printf("std140 %s expected = %d. Value = %d.\n",
-  prop_names[i], expected_std140[i],
-  query_std140[i]);
-   pass = false;
+   if (has_vertex_ssbo) {
+   if (query_std140[i] != expected_std140[i]) {
+   printf("std140 %s expected = %d. Value = %d.\n",
+  prop_names[i], expected_std140[i],
+  query_std140[i]);
+   pass = false;
+   }
}
if (query_std430[i] != expected_std430[i]) {
printf("std430 %s expected = %d. Value = %d.\n",
-- 
2.9.5

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


[Piglit] [PATCH 2/5] ssbo: make indirect test work on GL3.3

2017-11-16 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

This uses extensions so I can test this on radeon.

Signed-off-by: Dave Airlie <airl...@redhat.com>
---
 .../execution/indirect.shader_test | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git 
a/tests/spec/arb_shader_storage_buffer_object/execution/indirect.shader_test 
b/tests/spec/arb_shader_storage_buffer_object/execution/indirect.shader_test
index 50de38c..970bab6 100644
--- a/tests/spec/arb_shader_storage_buffer_object/execution/indirect.shader_test
+++ b/tests/spec/arb_shader_storage_buffer_object/execution/indirect.shader_test
@@ -2,11 +2,11 @@
 
 [require]
 GL >= 3.3
-GLSL >= 4.00
+GLSL >= 3.30
 GL_ARB_shader_storage_buffer_object
 
 [vertex shader]
-#version 400
+#version 330
 
 uniform int u_idx;
 in vec4 piglit_vertex;
@@ -18,7 +18,8 @@ void main() {
 }
 
 [fragment shader]
-#version 400
+#version 330
+#extension GL_ARB_gpu_shader5: require
 #extension GL_ARB_shader_storage_buffer_object: require
 
 layout(binding = 0) buffer Data {
-- 
2.9.5

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


[Piglit] [PATCH 3/5] ssbo: make rendering test work without vertex ssbos.

2017-11-16 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

r600 doesn't have vertex ssbos, so this uses a mixture
of ssbo and ubos for rendering in this case.
---
 .../arb_shader_storage_buffer_object/rendering.c   | 141 -
 1 file changed, 109 insertions(+), 32 deletions(-)

diff --git a/tests/spec/arb_shader_storage_buffer_object/rendering.c 
b/tests/spec/arb_shader_storage_buffer_object/rendering.c
index 9a87ffe..e68acbf 100644
--- a/tests/spec/arb_shader_storage_buffer_object/rendering.c
+++ b/tests/spec/arb_shader_storage_buffer_object/rendering.c
@@ -58,6 +58,25 @@ static const char vert_shader_text[] =
"   gl_Position.zw = vec2(0, 1);\n"
"}\n";
 
+static const char vert_shader_no_ssbo_text[] =
+   "#version 130\n"
+   "#extension GL_ARB_uniform_buffer_object : require\n"
+   "\n"
+   "layout(std140) uniform;\n"
+   "uniform ub_pos_size { vec2 pos; float size; };\n"
+   "uniform ub_rot {float rotation; };\n"
+   "in vec4 piglit_vertex;\n"
+   "\n"
+   "void main()\n"
+   "{\n"
+   "   mat2 m;\n"
+   "   m[0][0] = m[1][1] = cos(rotation); \n"
+   "   m[0][1] = sin(rotation); \n"
+   "   m[1][0] = -m[0][1]; \n"
+   "   gl_Position.xy = m * piglit_vertex.xy * vec2(size) + pos;\n"
+   "   gl_Position.zw = vec2(0, 1);\n"
+   "}\n";
+
 static const char frag_shader_text[] =
"#version 130\n"
"#extension GL_ARB_shader_storage_buffer_object : require\n"
@@ -98,9 +117,9 @@ static const float rotation[NUM_SQUARES] = {
 
 static GLuint prog;
 static GLuint buffers[NUM_SSBOS];
-static GLint alignment;
+static GLint alignment, ubo_alignment;
 static bool test_buffer_offset = false;
-
+static bool vertex_ssbo = false;
 
 static void
 setup_ubos(void)
@@ -110,12 +129,23 @@ setup_ubos(void)
"ssbo_color",
"ssbo_rot"
};
+   static const char *ubo_names[NUM_SSBOS] = {
+   "ub_pos_size",
+   "ssbo_color",
+   "ub_rot"
+   };
+
+   bool vs_ubo[NUM_SSBOS] = {true, false, true};
static GLubyte zeros[1000] = {0};
int i;
 
glGetIntegerv(GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT, );
printf("GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT = %d\n", alignment);
 
+   if (!vertex_ssbo) {
+   glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, 
_alignment);
+   printf("GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT = %d\n", 
ubo_alignment);
+   }
if (test_buffer_offset) {
printf("Testing buffer offset %d\n", alignment);
}
@@ -129,29 +159,55 @@ setup_ubos(void)
for (i = 0; i < NUM_SSBOS; i++) {
GLint index, size;
 
-   /* query SSBO index */
-   index = glGetProgramResourceIndex(prog,
- GL_SHADER_STORAGE_BLOCK,
- names[i]);
-
-   GLenum prop = GL_BUFFER_DATA_SIZE;
-   /* query SSBO size */
-   glGetProgramResourceiv(prog, GL_SHADER_STORAGE_BLOCK, index,
-  1, , 1, NULL, );
-
-   printf("SSBO %s: index = %d, size = %d\n",
-  names[i], index, size);
-
-   /* Allocate SSBO */
-   glBindBuffer(GL_SHADER_STORAGE_BUFFER, buffers[i]);
-   glBufferData(GL_SHADER_STORAGE_BUFFER, size + alignment,
- zeros, GL_DYNAMIC_DRAW);
-
-   /* Attach SSBO */
-   glBindBufferRange(GL_SHADER_STORAGE_BUFFER, i, buffers[i],
- alignment,  /* offset */
- size);
-   glShaderStorageBlockBinding(prog, index, i);
+   if (!vertex_ssbo && vs_ubo[i]) {
+   /* query UBO index */
+   index = glGetUniformBlockIndex(prog, ubo_names[i]);
+
+   /* query UBO size */
+   glGetActiveUniformBlockiv(prog, index,
+ GL_UNIFORM_BLOCK_DATA_SIZE, 
);
+   printf("UBO %s: index = %d, size = %d\n",
+  ubo_names[i], index, size);
+
+   /* Allocate UBO */
+   /* XXX for some reason, this test doesn't work at all 
with
+* nvidia if we pass NULL instead of zeros here.  The 
UBO data
+* is set/overwritten in the piglit_display() function 
so this
+* really shouldn't matter.
+ 

[Piglit] [PATCH 4/5] ssbo/max-ssbo-size: handle lack of vertex shader ssbo.

2017-11-16 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

evergreen has no vertex shader ssbo, just skip on it.
---
 tests/spec/arb_shader_storage_buffer_object/max-ssbo-size.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/tests/spec/arb_shader_storage_buffer_object/max-ssbo-size.c 
b/tests/spec/arb_shader_storage_buffer_object/max-ssbo-size.c
index 4af70aa..4c0d039 100644
--- a/tests/spec/arb_shader_storage_buffer_object/max-ssbo-size.c
+++ b/tests/spec/arb_shader_storage_buffer_object/max-ssbo-size.c
@@ -117,6 +117,7 @@ piglit_display(void)
size_t size;
bool pass = true;
bool link_should_fail;
+   GLint num_vertex_ssbo;
const float green[4] = { 0, 1, 0, 0 };
int test_index;
 
@@ -127,17 +128,23 @@ piglit_display(void)
printf("Max shader storage block size: %d\n", max_size);
vec4s = max_size / 4 / 4;
 
+   glGetIntegerv(GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS, _vertex_ssbo);
+
switch (mode) {
case VS:
target = GL_VERTEX_SHADER;
link_should_fail = false;
test_index = vec4s - 1;
+   if (num_vertex_ssbo == 0)
+   piglit_report_result(PIGLIT_SKIP);
break;
case VS_EXCEED:
target = GL_VERTEX_SHADER;
link_should_fail = true;
vec4s++;
test_index = vec4s - 2;
+   if (num_vertex_ssbo == 0)
+   piglit_report_result(PIGLIT_SKIP);
break;
case FS:
target = GL_FRAGMENT_SHADER;
-- 
2.9.5

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


[Piglit] [PATCH 5/5] ssbo/linking: add check for vertex ssbo support.

2017-11-16 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

skip if we don't support and vertex ssbos
---
 ...stance-matching-shader-storage-blocks-array-size-mismatch.shader_test | 1 +
 ...matching-shader-storage-blocks-binding-qualifier-mismatch.shader_test | 1 +
 ...ance-matching-shader-storage-blocks-member-count-mismatch.shader_test | 1 +
 ...tance-matching-shader-storage-blocks-member-name-mismatch.shader_test | 1 +
 ...ance-matching-shader-storage-blocks-member-order-mismatch.shader_test | 1 +
 ...-matching-shader-storage-blocks-member-qualifier-mismatch.shader_test | 1 +
 ...tance-matching-shader-storage-blocks-member-type-mismatch.shader_test | 1 +
 ...-matching-shader-storage-blocks-memory-qualifier-mismatch.shader_test | 1 +
 ...tching-shader-storage-blocks-packaging-qualifier-mismatch.shader_test | 1 +
 9 files changed, 9 insertions(+)

diff --git 
a/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-array-size-mismatch.shader_test
 
b/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-array-size-mismatch.shader_test
index 2a0da9e..7e57135 100644
--- 
a/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-array-size-mismatch.shader_test
+++ 
b/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-array-size-mismatch.shader_test
@@ -18,6 +18,7 @@
 [require]
 GLSL >= 1.50
 GL_ARB_shader_storage_buffer_object
+INT GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS >= 1
 
 [vertex shader]
 #version 150
diff --git 
a/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-binding-qualifier-mismatch.shader_test
 
b/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-binding-qualifier-mismatch.shader_test
index 48bba07..8498c06 100644
--- 
a/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-binding-qualifier-mismatch.shader_test
+++ 
b/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-binding-qualifier-mismatch.shader_test
@@ -19,6 +19,7 @@
 GLSL >= 1.50
 GL_ARB_shading_language_420pack
 GL_ARB_shader_storage_buffer_object
+INT GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS >= 1
 
 [vertex shader]
 #version 150
diff --git 
a/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-count-mismatch.shader_test
 
b/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-count-mismatch.shader_test
index 29ba5ec..2f71f5b 100644
--- 
a/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-count-mismatch.shader_test
+++ 
b/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-count-mismatch.shader_test
@@ -18,6 +18,7 @@
 [require]
 GLSL >= 1.50
 GL_ARB_shader_storage_buffer_object
+INT GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS >= 1
 
 [vertex shader]
 #version 150
diff --git 
a/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-name-mismatch.shader_test
 
b/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-name-mismatch.shader_test
index 972cda6..993f531 100644
--- 
a/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-name-mismatch.shader_test
+++ 
b/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-name-mismatch.shader_test
@@ -18,6 +18,7 @@
 [require]
 GLSL >= 1.50
 GL_ARB_shader_storage_buffer_object
+INT GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS >= 1
 
 [vertex shader]
 #version 150
diff --git 
a/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-order-mismatch.shader_test
 
b/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-order-mismatch.shader_test
index 3de14d8..0afffdb 100644
--- 
a/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-order-mismatch.shader_test
+++ 
b/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-order-mismatch.shader_test
@@ -18,6 +18,7 @@
 [require]
 GLSL >= 1.50
 GL_ARB_shader_storage_buffer_object
+INT GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS >= 1
 
 [vertex shader]
 #version 150
diff --git 
a/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-qualifier-mismatch.shader_test
 
b/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-qualifier-mismatch.shader_test
index b1c0377..f6b010c 100644
--- 
a/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-qualifier-mismatch.shader_test
+++ 
b/tests/spec/arb_shader_storage_bu

[Piglit] [PATCH] arrays_of_arrays/atomic_counter: check counters limit on linker test.

2017-10-10 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

Signed-off-by: Dave Airlie <airl...@redhat.com>
---
 .../arb_arrays_of_arrays/linker/vs-to-fs-atomic-counter.shader_test | 2 ++
 1 file changed, 2 insertions(+)

diff --git 
a/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-atomic-counter.shader_test 
b/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-atomic-counter.shader_test
index b618137..c6b5c5a 100644
--- a/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-atomic-counter.shader_test
+++ b/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-atomic-counter.shader_test
@@ -5,6 +5,8 @@
 GLSL >= 1.40
 GL_ARB_shader_atomic_counters
 GL_ARB_arrays_of_arrays
+INT GL_MAX_VERTEX_ATOMIC_COUNTERS >= 12
+INT GL_MAX_FRAGMENT_ATOMIC_COUNTERS >= 12
 
 [vertex shader]
 #version 140
-- 
2.9.5

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


[Piglit] [PATCH] arrays_of_arrays/atomic_counters: set requirements on atomic counter numbers.

2017-10-10 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

These both use 20 counters so check against the limits before running.

Signed-off-by: Dave Airlie <airl...@redhat.com>
---
 .../execution/atomic_counters/fs-simple-inc-dec-read.shader_test | 1 +
 .../execution/atomic_counters/vs-simple-inc-dec-read.shader_test | 1 +
 2 files changed, 2 insertions(+)

diff --git 
a/tests/spec/arb_arrays_of_arrays/execution/atomic_counters/fs-simple-inc-dec-read.shader_test
 
b/tests/spec/arb_arrays_of_arrays/execution/atomic_counters/fs-simple-inc-dec-read.shader_test
index 68ddc46..9949df8 100644
--- 
a/tests/spec/arb_arrays_of_arrays/execution/atomic_counters/fs-simple-inc-dec-read.shader_test
+++ 
b/tests/spec/arb_arrays_of_arrays/execution/atomic_counters/fs-simple-inc-dec-read.shader_test
@@ -5,6 +5,7 @@
 GLSL >= 1.40
 GL_ARB_shader_atomic_counters
 GL_ARB_arrays_of_arrays
+INT GL_MAX_FRAGMENT_ATOMIC_COUNTERS >= 20
 
 [vertex shader passthrough]
 
diff --git 
a/tests/spec/arb_arrays_of_arrays/execution/atomic_counters/vs-simple-inc-dec-read.shader_test
 
b/tests/spec/arb_arrays_of_arrays/execution/atomic_counters/vs-simple-inc-dec-read.shader_test
index c0f319c..c5c3015 100644
--- 
a/tests/spec/arb_arrays_of_arrays/execution/atomic_counters/vs-simple-inc-dec-read.shader_test
+++ 
b/tests/spec/arb_arrays_of_arrays/execution/atomic_counters/vs-simple-inc-dec-read.shader_test
@@ -6,6 +6,7 @@ GLSL >= 1.40
 GL_ARB_shader_atomic_counters
 GL_ARB_arrays_of_arrays
 INT GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS >= 1
+INT GL_MAX_VERTEX_ATOMIC_COUNTERS >= 20
 
 [vertex shader]
 #version 140
-- 
2.9.5

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


[Piglit] [PATCH] arb_shader_atomic_counter_ops: declare counters to fix undefined behaviour.

2017-10-10 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

It's undefined (including crashing) behaviour to use atomic counters
without having bound enough storage for them. This fixes this test
to bind the storage for the counters it uses.

Signed-off-by: Dave Airlie <airl...@redhat.com>
---
 .../arb_shader_atomic_counter_ops/execution/all_touch_test.shader_test   | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/tests/spec/arb_shader_atomic_counter_ops/execution/all_touch_test.shader_test 
b/tests/spec/arb_shader_atomic_counter_ops/execution/all_touch_test.shader_test
index 7fb3cbf..913fa6b 100644
--- 
a/tests/spec/arb_shader_atomic_counter_ops/execution/all_touch_test.shader_test
+++ 
b/tests/spec/arb_shader_atomic_counter_ops/execution/all_touch_test.shader_test
@@ -68,5 +68,6 @@ void main()
 }
 
 [test]
+atomic counters 8
 draw rect -1 -1 2 2
 probe all rgba 0.0 1.0 0.0 1.0
-- 
2.9.5

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


[Piglit] [PATCH] image_load_store: add a new test for a bug seen on AMD VEGA.

2017-08-24 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

This is ported from a vulkan cts test showing the same brokenness.
---
 .../execution/image_checkerboard.shader_test   | 67 ++
 1 file changed, 67 insertions(+)
 create mode 100644 
tests/spec/arb_shader_image_load_store/execution/image_checkerboard.shader_test

diff --git 
a/tests/spec/arb_shader_image_load_store/execution/image_checkerboard.shader_test
 
b/tests/spec/arb_shader_image_load_store/execution/image_checkerboard.shader_test
new file mode 100644
index 000..b8d67b0
--- /dev/null
+++ 
b/tests/spec/arb_shader_image_load_store/execution/image_checkerboard.shader_test
@@ -0,0 +1,67 @@
+# This is a port of one of the Vulkan CTS tests to piglit GL
+# to test a bug seen developing radv for vega.
+#
+# 
dEQP-VK.binding_model.shader_access.primary_cmd_buf.storage_image.fragment.single_descriptor.2d
 
+# it isn't a direct port but it shows the same bug.
+#
+# This just copies 4 squares from the image into the final image and probes 
them.
+# On vega some bits are corrupted.
+[require]
+GL >= 3.3
+GLSL >= 3.30
+GL_ARB_shader_image_load_store
+SIZE 256 256
+
+[vertex shader]
+#version 330
+flat out highp int frag_quadrant_id;
+void main (void)
+{
+   highp vec4 result_position;
+   highp int quadrant_id;
+   highp int quadPhase = gl_VertexID % 6;
+   highp int quadXcoord = int(quadPhase == 1 || quadPhase == 4 || 
quadPhase == 5);
+   highp int quadYcoord = int(quadPhase == 2 || quadPhase == 3 || 
quadPhase == 5);
+   highp int quadOriginX = (gl_VertexID / 6) % 2;
+   highp int quadOriginY = (gl_VertexID / 6) / 2;
+   quadrant_id = gl_VertexID / 6;
+   result_position = vec4(float(quadOriginX + quadXcoord - 1), 
float(quadOriginY + quadYcoord - 1), 0.0, 1.0);
+   gl_Position = result_position;
+   frag_quadrant_id = quadrant_id;
+}
+   
+
+[fragment shader]
+#version 330
+#extension GL_ARB_shader_image_load_store: enable
+
+layout(rgba8) readonly uniform highp image2D u_image;
+flat in highp int frag_quadrant_id;
+out mediump vec4 o_color;
+void main (void)
+{
+   highp int quadrant_id = frag_quadrant_id;
+   highp vec4 result_color;
+   if (quadrant_id == 0)
+   result_color = imageLoad(u_image, ivec2(6, 13));
+   else if (quadrant_id == 1)
+   result_color = imageLoad(u_image, ivec2(51, 40));
+   else if (quadrant_id == 2)
+   result_color = imageLoad(u_image, ivec2(42, 26));
+   else
+   result_color = imageLoad(u_image, ivec2(25, 35));
+   o_color.xyzw = result_color.xyzw;
+}
+   
+[test]
+# Use textures that are large enough to actually trigger the use
+# of compression.
+texture rgbw 0 (64, 64) GL_RGBA8
+image texture 0 GL_RGBA8
+
+draw arrays GL_TRIANGLES 0 24
+probe rect rgba (0, 0, 128, 128) (1.0, 0.0, 0.0, 1.0)
+probe rect rgba (128, 0, 128, 128) (1.0, 1.0, 1.0, 1.0)
+probe rect rgba (0, 128, 128, 128) (0.0, 1.0, 0.0, 1.0)
+probe rect rgba (128, 128, 128, 128) (0.0, 0.0, 1.0, 1.0)
+
-- 
2.9.4

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


Re: [Piglit] [PATCH] ARB_gpu_shader_int64: test that swizzles of constants work

2017-08-20 Thread Dave Airlie
Reviewed-by: Dave Airlie <airl...@redhat.com>

On 17 August 2017 at 12:20, Ilia Mirkin <imir...@alum.mit.edu> wrote:
> Currently mesa produces this:
>
> glsl/ir_constant_expression.cpp:735: virtual ir_constant*
> ir_swizzle::constant_expression_value(void*, hash_table*): Assertion
> `!"Should not get here."' failed.
>
> Signed-off-by: Ilia Mirkin <imir...@alum.mit.edu>
> ---
>  tests/spec/arb_gpu_shader_int64/compiler/const-swizzle.vert | 13 
> +
>  1 file changed, 13 insertions(+)
>  create mode 100644 
> tests/spec/arb_gpu_shader_int64/compiler/const-swizzle.vert
>
> diff --git a/tests/spec/arb_gpu_shader_int64/compiler/const-swizzle.vert 
> b/tests/spec/arb_gpu_shader_int64/compiler/const-swizzle.vert
> new file mode 100644
> index 0..46a7ee181
> --- /dev/null
> +++ b/tests/spec/arb_gpu_shader_int64/compiler/const-swizzle.vert
> @@ -0,0 +1,13 @@
> +#version 330
> +#extension GL_ARB_gpu_shader_int64: require
> +
> +/* [config]
> + * expect_result: pass
> + * glsl_version: 3.30
> + * require_extensions: GL_ARB_gpu_shader_int64
> + * [end config]
> +*/
> +
> +uint64_t f() {
> +  return u64vec2(1UL, 2UL).y;
> +}
> --
> 2.13.0
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 0/5] Add int64 conversion tests

2017-01-29 Thread Dave Airlie
On 27 January 2017 at 04:59, Nicolai Hähnle <nhaeh...@gmail.com> wrote:
> Hi all,
>
> increase the test coverage of GL_ARB_gpu_shader_int64 by testing various
> conversions. To avoid reinventing the wheel or duplicating code, I've
> extended the existing fp64 conversion test generation. The first couple
> of patches simply move code around and rename things. The last patch adds
> all the actual int64 tests.
>
> I verified using diff that the existing generated test files remain
> unmodified. The only change is that more test files are generated in
> spec/arb_gpu_shader_int64. Tested against radeonsi with the remaining
> patches that I'm about to send to mesa-dev. Please review!
>

LGTM, I haven't gone too deep in looking, but idea seems sane,

Acked-by: Dave Airlie <airl...@redhat.com>
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] Piglit tests that leave noise in dmesg on nvidia proprietary drivers

2016-10-20 Thread Dave Airlie
On 21 October 2016 at 12:26, Dan Kegel <d...@kegel.com> wrote:
> On Thu, Oct 20, 2016 at 6:49 PM, Dave Airlie <airl...@gmail.com> wrote:
>> If piglit crashes or explodes it's the driver's fault.
>
> Are you quite sure?   There could be bugs in piglit, no?

It would most likely crash on all drivers then. It's unlikely that piglit
tests are going to display such variances in behaviour.

But it doesn't really matter, the only people that can tell if this is a
bug in piglit or a bug in the driver are nvidia unfortuantely, unless
we can reproduce the bug on open source drivers.

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


Re: [Piglit] Piglit tests that leave noise in dmesg on nvidia proprietary drivers

2016-10-20 Thread Dave Airlie
On 21 October 2016 at 05:56, Dan Kegel  wrote:
> I guess the underlying question is "how much work would it
> be to get piglit to the point where errors it reports when
> run against nvidia's proprietary drivers are actual problems in those 
> drivers".
> I suspect it'd be a good summer project.

If piglit crashes or explodes it's the driver's fault.

But really you don't debug piglit tests without access to the source
code of the driver, and for that you need to be nvidia.

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


Re: [Piglit] [PATCH] generators: Add extensions requirements to gen_constant_array_size_tests

2016-07-06 Thread Dave Airlie
Reviewed-by: Dave Airlie <airl...@redhat.com>

On 7 July 2016 at 05:31, Dylan Baker <dy...@pnwbakers.com> wrote:
> This fixes int64 failures.
>
> Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
> ---
>  generated_tests/gen_constant_array_size_tests.py | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/generated_tests/gen_constant_array_size_tests.py 
> b/generated_tests/gen_constant_array_size_tests.py
> index 8462c02..9c1a9a8 100644
> --- a/generated_tests/gen_constant_array_size_tests.py
> +++ b/generated_tests/gen_constant_array_size_tests.py
> @@ -87,7 +87,11 @@ class ParserTest(object):
>  extension requirements that the test has.  Returns the empty
>  list by default.
>  """
> -return []
> +ret = []
> +if self.__signature.extension:
> +ret.append(self.__signature.extension)
> +
> +return ret
>
>  @abc.abstractmethod
>  def test_suffix(self):
> --
> 2.9.0
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] builtin_function: try and use casts for 64-bits instead of dtype setting.

2016-07-04 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

The dtype setting only works with numpy 1.9 and above, which doesn't
seem to be in most distros yet.

Reported-by: Jose Fonseca <jfons...@vmware.com>
Signed-off-by: Dave Airlie <airl...@redhat.com>
---
 generated_tests/builtin_function.py | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/generated_tests/builtin_function.py 
b/generated_tests/builtin_function.py
index a886dbd..689a805 100644
--- a/generated_tests/builtin_function.py
+++ b/generated_tests/builtin_function.py
@@ -957,28 +957,28 @@ def _make_componentwise_test_vectors(test_suite_dict):
   [np.linspace(-1.9, 1.9, 4), np.linspace(-1.9, 1.9, 4),
np.linspace(-2.0, 2.0, 4)])
 
-f('abs', 1, 150, np.abs, None, [np.linspace(-10, 15, 5, 
dtype=np.dtype(np.int64))],
+f('abs', 1, 150, np.abs, None, [np.linspace(-10, 15, 54).astype(np.int64)],
   extension="ARB_gpu_shader_int64")
-f('sign', 1, 150, np.sign, None, [np.linspace(-15, 15, 5, 
dtype=np.dtype(np.int64))],
+f('sign', 1, 150, np.sign, None, [np.linspace(-15, 15, 
5).astype(np.int64)],
   extension="ARB_gpu_shader_int64")
 f('min', 2, 150, min, [1],
-  [np.linspace(-20, 20, 4, dtype=np.dtype(np.int64)), np.linspace(-20, 20, 
4, dtype=np.dtype(np.int64))],
+  [np.linspace(-20, 20, 4).astype(np.int64), np.linspace(-20, 20, 
4).astype(np.int64)],
   extension="ARB_gpu_shader_int64")
 f('min', 2, 150, min, [1],
-  [np.linspace(20, 90, 4, dtype=np.dtype(np.uint64)), np.linspace(20, 90, 
4, dtype=np.dtype(np.uint64))],
+  [np.linspace(20, 90, 4).astype(np.uint64), np.linspace(20, 90, 
4).astype(np.uint64)],
   extension="ARB_gpu_shader_int64")
 f('max', 2, 150, max, [1],
-  [np.linspace(-20, 20, 4, dtype=np.dtype(np.int64)), np.linspace(-20, 20, 
4, dtype=np.dtype(np.int64))],
+  [np.linspace(-20, 20, 4).astype(np.int64), np.linspace(-20, 20, 
4).astype(np.int64)],
   extension="ARB_gpu_shader_int64")
 f('max', 2, 150, max, [1],
-  [np.linspace(20, 90, 4, dtype=np.dtype(np.uint64)), np.linspace(20, 90, 
4, dtype=np.dtype(np.uint64))],
+  [np.linspace(20, 90, 4).astype(np.uint64), np.linspace(20, 90, 
4).astype(np.uint64)],
   extension="ARB_gpu_shader_int64")
-f('clamp', 3, 150, _clamp, [1, 2], [np.linspace(-20, 20, 4, 
dtype=np.dtype(np.int64)),
-   np.linspace(-15, 15, 3, 
dtype=np.dtype(np.int64)),
-   np.linspace(-15, 15, 3, 
dtype=np.dtype(np.int64))],
+f('clamp', 3, 150, _clamp, [1, 2], [np.linspace(-20, 20, 
4).astype(np.int64),
+   np.linspace(-15, 15, 3).astype(np.int64),
+   np.linspace(-15, 15, 3).astype(np.int64)],
   extension="ARB_gpu_shader_int64")
 f('mix', 3, 150, lambda x, y, a: y if a else x, None,
-  [np.linspace(-20, 20, 2, dtype=np.dtype(np.int64)), np.linspace(-30, 30, 
2, dtype=np.dtype(np.int64)), bools],
+  [np.linspace(-20, 20, 2).astype(np.int64), np.linspace(-30, 30, 
2).astype(np.int64), bools],
   extension="ARB_gpu_shader_int64")
 _make_componentwise_test_vectors(test_suite)
 
-- 
2.5.5

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


[Piglit] [PATCH] arb_gpu_shader_int64: generate int64 conversion tests.

2016-06-19 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

This is "ported" from the fp64 conversion generator, it
probably has a lot of stuff left over it shouldn't, but it
does generate the tests I expected to test 64-bit integer
conversions both implicit and explicit.

Signed-off-by: Dave Airlie <airl...@redhat.com>
---
 generated_tests/CMakeLists.txt |  18 +
 generated_tests/gen_conversion_int64.py| 569 +
 .../templates/gen_conversion_int64/base.mako   |  12 +
 .../gen_conversion_int64/compiler.frag.mako|   3 +
 .../gen_conversion_int64/compiler.geom.mako|   3 +
 .../gen_conversion_int64/compiler.vert.mako|   3 +
 .../gen_conversion_int64/compiler_base.mako|  25 +
 .../execution.frag.shader_test.mako|   7 +
 .../execution.geom.shader_test.mako|  27 +
 .../execution.vert.shader_test.mako|  16 +
 .../gen_conversion_int64/execution_base.mako   |  31 ++
 .../gen_conversion_int64/shader.frag.mako  |  16 +
 .../gen_conversion_int64/shader.geom.mako  |  25 +
 .../gen_conversion_int64/shader.vert.mako  |  18 +
 .../gen_conversion_int64/shader_base.mako  |  11 +
 15 files changed, 784 insertions(+)
 create mode 100644 generated_tests/gen_conversion_int64.py
 create mode 100644 generated_tests/templates/gen_conversion_int64/base.mako
 create mode 100644 
generated_tests/templates/gen_conversion_int64/compiler.frag.mako
 create mode 100644 
generated_tests/templates/gen_conversion_int64/compiler.geom.mako
 create mode 100644 
generated_tests/templates/gen_conversion_int64/compiler.vert.mako
 create mode 100644 
generated_tests/templates/gen_conversion_int64/compiler_base.mako
 create mode 100644 
generated_tests/templates/gen_conversion_int64/execution.frag.shader_test.mako
 create mode 100644 
generated_tests/templates/gen_conversion_int64/execution.geom.shader_test.mako
 create mode 100644 
generated_tests/templates/gen_conversion_int64/execution.vert.shader_test.mako
 create mode 100644 
generated_tests/templates/gen_conversion_int64/execution_base.mako
 create mode 100644 
generated_tests/templates/gen_conversion_int64/shader.frag.mako
 create mode 100644 
generated_tests/templates/gen_conversion_int64/shader.geom.mako
 create mode 100644 
generated_tests/templates/gen_conversion_int64/shader.vert.mako
 create mode 100644 
generated_tests/templates/gen_conversion_int64/shader_base.mako

diff --git a/generated_tests/CMakeLists.txt b/generated_tests/CMakeLists.txt
index 0b9048f..f502534 100644
--- a/generated_tests/CMakeLists.txt
+++ b/generated_tests/CMakeLists.txt
@@ -153,6 +153,23 @@ piglit_make_generated_tests(
templates/gen_conversion_fp64/shader_base.mako
)
 piglit_make_generated_tests(
+   conversion_int64.list
+   gen_conversion_int64.py
+   templates/gen_conversion_int64/base.mako
+   templates/gen_conversion_int64/compiler.frag.mako
+   templates/gen_conversion_int64/compiler.geom.mako
+   templates/gen_conversion_int64/compiler.vert.mako
+   templates/gen_conversion_int64/compiler_base.mako
+   templates/gen_conversion_int64/execution.frag.shader_test.mako
+   templates/gen_conversion_int64/execution.geom.shader_test.mako
+   templates/gen_conversion_int64/execution.vert.shader_test.mako
+   templates/gen_conversion_int64/execution_base.mako
+   templates/gen_conversion_int64/shader.frag.mako
+   templates/gen_conversion_int64/shader.geom.mako
+   templates/gen_conversion_int64/shader.vert.mako
+   templates/gen_conversion_int64/shader_base.mako
+   )
+piglit_make_generated_tests(
shader_precision_tests.list
gen_shader_precision_tests.py
builtin_function.py
@@ -247,6 +264,7 @@ add_custom_target(gen-gl-tests
vp-tex.list
variable_index_write_tests.list
vs_in_fp64.list
+   conversion_int64.list
 )
 
 # Create a custom target for generating OpenCL tests
diff --git a/generated_tests/gen_conversion_int64.py 
b/generated_tests/gen_conversion_int64.py
new file mode 100644
index 000..bbe38e9
--- /dev/null
+++ b/generated_tests/gen_conversion_int64.py
@@ -0,0 +1,569 @@
+# coding=utf-8
+#
+# 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

Re: [Piglit] [PATCH 2/2] arb_gpu_shader_int64: add builtin test generator.

2016-06-09 Thread Dave Airlie
On 10 June 2016 at 13:40, Dave Airlie <airl...@gmail.com> wrote:
>> No, you can't use int and long here, python 3 doesn't have a long type
>> at all, and it's int will grow until it uses all of your memory if you
>> ask it to, while python2 has an int and long that are equivalent to int
>> and long in C for your architecture. You'll need to use the numpy types
>> exclusively. As-is this doesn't work with python 3.x it raises a
>> NameError, so that at least needs to be fixed.
>>
>> Also, some of the helper functions in here seem either useless, wrong,
>> or at least need to have their documentation updated. Many of of them
>> use floats, which will cause your numpy.integer types to get converted
>> to their numpy.float equivalent, which you probably don't want, unless
>> the code casts back, this code is pretty complicated.
>>
>> There's also a heck of a lot of this code that is duplicated or nearly
>> duplicated between builtin_function.py, builtin_function_fp64.py and
>> this, although I don't have a good solution and I don't really want to
>> to de-duplicate all of that code myself, so I guess you can just ignore
>> this comment, consider it me complaining to no one in particular.
>
> You made me feel guilty, so I added support to the main generator script,
> it seems to work fine.
>
> patch on the list.

btw I tried to reintegrate the fp64 generator and failed miserably, at some
point it started generating two versions of the same test.

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


Re: [Piglit] [PATCH 2/2] arb_gpu_shader_int64: add builtin test generator.

2016-06-09 Thread Dave Airlie
> No, you can't use int and long here, python 3 doesn't have a long type
> at all, and it's int will grow until it uses all of your memory if you
> ask it to, while python2 has an int and long that are equivalent to int
> and long in C for your architecture. You'll need to use the numpy types
> exclusively. As-is this doesn't work with python 3.x it raises a
> NameError, so that at least needs to be fixed.
>
> Also, some of the helper functions in here seem either useless, wrong,
> or at least need to have their documentation updated. Many of of them
> use floats, which will cause your numpy.integer types to get converted
> to their numpy.float equivalent, which you probably don't want, unless
> the code casts back, this code is pretty complicated.
>
> There's also a heck of a lot of this code that is duplicated or nearly
> duplicated between builtin_function.py, builtin_function_fp64.py and
> this, although I don't have a good solution and I don't really want to
> to de-duplicate all of that code myself, so I guess you can just ignore
> this comment, consider it me complaining to no one in particular.

You made me feel guilty, so I added support to the main generator script,
it seems to work fine.

patch on the list.
Dave,
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] arb_gpu_shader_int64: add test generation to standard testing template

2016-06-09 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

Rather than forking this code further, I've just added support to the
standard generator for the 64-bit tests.

This relies on the shader_runner int64 support.

Signed-off-by: Dave Airlie <airl...@redhat.com>
---
 generated_tests/builtin_function.py  | 159 ++-
 generated_tests/gen_builtin_uniform_tests.py |   2 +
 2 files changed, 158 insertions(+), 3 deletions(-)

diff --git a/generated_tests/builtin_function.py 
b/generated_tests/builtin_function.py
index 3a8fbdc..fdc0dde 100644
--- a/generated_tests/builtin_function.py
+++ b/generated_tests/builtin_function.py
@@ -181,7 +181,14 @@ glsl_mat4x3 = GlslBuiltinType('mat4x3', glsl_float, 4, 3, 
120)
 glsl_mat2x4 = GlslBuiltinType('mat2x4', glsl_float, 2, 4, 120)
 glsl_mat3x4 = GlslBuiltinType('mat3x4', glsl_float, 3, 4, 120)
 glsl_mat4x4 = glsl_mat4
-
+glsl_int64_t  = GlslBuiltinType('int64_t', None,   1, 1, 0)
+glsl_i64vec2  = GlslBuiltinType('i64vec2', glsl_int64_t,  1, 2, 0)
+glsl_i64vec3  = GlslBuiltinType('i64vec3', glsl_int64_t,  1, 3, 0)
+glsl_i64vec4  = GlslBuiltinType('i64vec4', glsl_int64_t,  1, 4, 0)
+glsl_uint64_t = GlslBuiltinType('uint64_t', None,   1, 1, 0)
+glsl_u64vec2  = GlslBuiltinType('u64vec2', glsl_uint64_t,  1, 2, 0)
+glsl_u64vec3  = GlslBuiltinType('u64vec3', glsl_uint64_t,  1, 3, 0)
+glsl_u64vec4  = GlslBuiltinType('u64vec4', glsl_uint64_t,  1, 4, 0)
 
 # Named tuple representing the signature of a single overload of a
 # built-in GLSL function or operator:
@@ -240,6 +247,10 @@ def glsl_type_of(value):
 return glsl_int
 elif isinstance(value, UINT32_TYPES):
 return glsl_uint
+elif isinstance(value, np.int64):
+return glsl_int64_t
+elif isinstance(value, np.uint64):
+return glsl_uint64_t
 else:
 assert isinstance(value, np.ndarray)
 if len(value.shape) == 1:
@@ -248,6 +259,10 @@ def glsl_type_of(value):
 assert 2 <= vector_length <= 4
 if value.dtype in FLOATING_TYPES:
 return (glsl_vec2, glsl_vec3, glsl_vec4)[vector_length - 2]
+if value.dtype == np.int64:
+return (glsl_i64vec2, glsl_i64vec3, 
glsl_i64vec4)[vector_length - 2]
+elif value.dtype == np.uint64:
+return (glsl_u64vec2, glsl_u64vec3, 
glsl_u64vec4)[vector_length - 2]
 elif value.dtype == bool:
 return (glsl_bvec2, glsl_bvec3, glsl_bvec4)[vector_length - 2]
 elif value.dtype in INT32_TYPES:
@@ -286,6 +301,10 @@ def glsl_constant(value):
 column_major = np.reshape(np.array(value), -1, 'F')
 if column_major.dtype == bool:
 values = ['true' if x else 'false' for x in column_major]
+elif column_major.dtype == np.int64:
+values = [repr(x) + 'l' for x in column_major]
+elif column_major.dtype == np.uint64:
+values = [repr(x) + 'ul' for x in column_major]
 elif column_major.dtype in UINT32_TYPES:
 values = [repr(x) + 'u' for x in column_major]
 else:
@@ -358,7 +377,7 @@ def _divide(x, y):
 if any(y_element == 0 for y_element in column_major_values(y)):
 # Division by zero is undefined.
 return None
-if glsl_type_of(x).base_type == glsl_int:
+if glsl_type_of(x).base_type == glsl_int or glsl_type_of(x).base_type == 
glsl_int64_t:
 # The GLSL spec does not make it clear what the rounding rules
 # are when performing integer division.  C99 requires
 # round-toward-zero, so in the absence of any other
@@ -368,7 +387,7 @@ def _divide(x, y):
 # make sure we get round-toward-zero behavior, divide the
 # absolute values of x and y, and then fix the sign.
 return (np.abs(x) // np.abs(y)) * (np.sign(x) * np.sign(y))
-elif glsl_type_of(x).base_type == glsl_uint:
+elif glsl_type_of(x).base_type == glsl_uint or glsl_type_of(x).base_type 
== glsl_uint64_t:
 return x // y
 else:
 return x / y
@@ -937,6 +956,30 @@ def _make_componentwise_test_vectors(test_suite_dict):
 f('smoothstep', 3, 110, _smoothstep, [0, 1],
   [np.linspace(-1.9, 1.9, 4), np.linspace(-1.9, 1.9, 4),
np.linspace(-2.0, 2.0, 4)])
+
+f('abs', 1, 150, np.abs, None, [np.linspace(-10, 15, 5, 
dtype=np.dtype(np.int64))],
+  extension="ARB_gpu_shader_int64")
+f('sign', 1, 150, np.sign, None, [np.linspace(-15, 15, 5, 
dtype=np.dtype(np.int64))],
+  extension="ARB_gpu_shader_int64")
+f('min', 2, 150, min, [1],
+  [np.linspace(-20, 20, 4, dtype=np.dtype(np.int64)), np.linspace(-20, 20, 
4, dtype=np.dtype(np.int64))],
+  extension="ARB_gpu_shader_int64")
+f('min', 2, 150, min, [1],
+  [np.linspace(20, 90, 4, dtype=np.dtype(np.uint64)), np.linspace(20, 90, 
4, dtype=np.dtype(np.uint64))],
+  extension="ARB_gpu_shader_int64")
+f('max', 2, 150, max, [1],
+  [np.linspace(-20, 20, 4, dtype=np

[Piglit] [PATCH 1/2] shader_runner: add arb_gpu_shader_int64 support.

2016-06-08 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

This adds support for 64-bit integer uniforms to
shader_runner infrastructure.

Signed-off-by: Dave Airlie <airl...@redhat.com>
---
 tests/shaders/shader_runner.c | 97 +++
 1 file changed, 97 insertions(+)

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index 94c7826..1187c64 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -185,6 +185,14 @@ static const struct string_to_enum all_types[] = {
ENUM_STRING(GL_UNSIGNED_INT_VEC2),
ENUM_STRING(GL_UNSIGNED_INT_VEC3),
ENUM_STRING(GL_UNSIGNED_INT_VEC4),
+   ENUM_STRING(GL_INT64_ARB),
+   ENUM_STRING(GL_INT64_VEC2_ARB),
+   ENUM_STRING(GL_INT64_VEC3_ARB),
+   ENUM_STRING(GL_INT64_VEC4_ARB),
+   ENUM_STRING(GL_UNSIGNED_INT64_ARB),
+   ENUM_STRING(GL_UNSIGNED_INT64_VEC2_ARB),
+   ENUM_STRING(GL_UNSIGNED_INT64_VEC3_ARB),
+   ENUM_STRING(GL_UNSIGNED_INT64_VEC4_ARB),
ENUM_STRING(GL_BOOL),
ENUM_STRING(GL_BOOL_VEC2),
ENUM_STRING(GL_BOOL_VEC3),
@@ -1411,6 +1419,23 @@ get_uints(const char *line, unsigned *uints, unsigned 
count)
uints[i] = strtoul(line, (char **) , 0);
 }
 
+static void
+get_int64s(const char *line, int64_t *ints, unsigned count)
+{
+   int i;
+
+   for (i = 0; i < count; i++)
+   ints[i] = strtoll(line, (char **) , 0);
+}
+
+static void
+get_uint64s(const char *line, uint64_t *ints, unsigned count)
+{
+   int i;
+
+   for (i = 0; i < count; i++)
+   ints[i] = strtoull(line, (char **) , 0);
+}
 
 /**
  * Check that the GL implementation supports unsigned uniforms
@@ -1437,6 +1462,18 @@ check_double_support(void)
 }
 
 /**
+ * Check that the GL implementation supports double uniforms
+ * (e.g. through glUniform1d).  If not, terminate the test with a
+ * SKIP.
+ */
+static void
+check_int64_support(void)
+{
+   if (!piglit_is_extension_supported("GL_ARB_gpu_shader_int64"))
+   piglit_report_result(PIGLIT_SKIP);
+}
+
+/**
  * Check that the GL implementation supports shader subroutines
  * If not, terminate the test with a SKIP.
  */
@@ -1463,6 +1500,8 @@ set_ubo_uniform(char *name, const char *type, const char 
*line, int ubo_array_in
double d[16];
int ints[16];
unsigned uints[16];
+   uint64_t uint64s[16];
+   int64_t int64s[16];
int name_len = strlen(name);
 
if (!num_uniform_blocks)
@@ -1527,6 +1566,12 @@ set_ubo_uniform(char *name, const char *type, const char 
*line, int ubo_array_in
if (string_match("float", type)) {
get_floats(line, f, 1);
memcpy(data, f, sizeof(float));
+   } else if (string_match("int64_t", type)) {
+   get_int64s(line, int64s, 1);
+   memcpy(data, int64s, sizeof(int64_t));
+   } else if (string_match("uint64_t", type)) {
+   get_uint64s(line, uint64s, 1);
+   memcpy(data, uint64s, sizeof(uint64_t));
} else if (string_match("int", type)) {
get_ints(line, ints, 1);
memcpy(data, ints, sizeof(int));
@@ -1548,6 +1593,14 @@ set_ubo_uniform(char *name, const char *type, const char 
*line, int ubo_array_in
int elements = type[4] - '0';
get_uints(line, uints, elements);
memcpy(data, uints, elements * sizeof(unsigned));
+   } else if (string_match("i64vec", type)) {
+   int elements = type[6] - '0';
+   get_int64s(line, int64s, elements);
+   memcpy(data, int64s, elements * sizeof(int64_t));
+   } else if (string_match("u64vec", type)) {
+   int elements = type[6] - '0';
+   get_uint64s(line, uint64s, elements);
+   memcpy(data, uint64s, elements * sizeof(uint64_t));
} else if (string_match("dvec", type)) {
int elements = type[4] - '0';
get_doubles(line, d, elements);
@@ -1638,6 +1691,8 @@ set_uniform(const char *line, int ubo_array_index)
double d[16];
int ints[16];
unsigned uints[16];
+   int64_t int64s[16];
+   uint64_t uint64s[16];
GLint loc;
const char *type;
 
@@ -1667,6 +1722,16 @@ set_uniform(const char *line, int ubo_array_index)
get_floats(line, f, 1);
glUniform1fv(loc, 1, f);
return;
+   } else if (string_match("int64_t", type)) {
+   check_int64_support();
+   get_int64s(line, int64s, 1);
+   glUniform1i64vARB(loc, 1, int64s);
+   return;
+   } else if (string_match("uint64_t", type)) {
+   check_int64_support();
+   get_uint64s(line, uint64s, 1);
+   glUniform1ui64vARB(loc, 1, ui

[Piglit] [PATCH 2/2] arb_gpu_shader_int64: add builtin test generator.

2016-06-08 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

Like the normal and fp64 generators, this generates a bunch
of the built-in tests for use with shader_runner
---
 generated_tests/CMakeLists.txt |5 +
 generated_tests/builtin_function_int64.py  | 1001 
 generated_tests/gen_builtin_uniform_tests_int64.py |  642 +
 3 files changed, 1648 insertions(+)
 create mode 100644 generated_tests/builtin_function_int64.py
 create mode 100644 generated_tests/gen_builtin_uniform_tests_int64.py

diff --git a/generated_tests/CMakeLists.txt b/generated_tests/CMakeLists.txt
index 0b9048f..8422329 100644
--- a/generated_tests/CMakeLists.txt
+++ b/generated_tests/CMakeLists.txt
@@ -196,6 +196,10 @@ piglit_make_generated_tests(
templates/gen_vs_in_fp64/execution_base.mako
templates/gen_vs_in_fp64/shader.vert.mako
templates/gen_vs_in_fp64/shader_base.mako)
+piglit_make_generated_tests(
+   builtin_uniform_tests_int64.list
+   gen_builtin_uniform_tests_int64.py
+   builtin_function_int64.py)
 
 # OpenCL Test generators
 piglit_make_generated_tests(
@@ -247,6 +251,7 @@ add_custom_target(gen-gl-tests
vp-tex.list
variable_index_write_tests.list
vs_in_fp64.list
+   builtin_uniform_tests_int64.list
 )
 
 # Create a custom target for generating OpenCL tests
diff --git a/generated_tests/builtin_function_int64.py 
b/generated_tests/builtin_function_int64.py
new file mode 100644
index 000..56af117
--- /dev/null
+++ b/generated_tests/builtin_function_int64.py
@@ -0,0 +1,1001 @@
+# coding=utf-8
+#
+# Copyright © 2011 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.
+
+# This source file defines a set of test vectors that can be used to
+# test GLSL's built-in functions and operators.  It is intended to be
+# used by Python code that generates Piglit tests.
+#
+# The key export is the dictionary test_suite.  It contains an entry
+# for each possible overload of every pure built-in function and
+# operator.  By iterating through this dictionary you can find a set
+# of test vectors for testing nearly every built-in GLSL function.
+#
+# The following functions are not included, since they are not pure,
+# so they can't be tested using simple vectors:
+# - dFdx()
+# - dFdy()
+# - fwidth()
+# - ftransform()
+# - Increment and decrement operators
+#
+# The following functions are not included, since they need to be
+# tested in specialized ways:
+# - modf(): not tested because it has an out parameter
+# - isnan() and isinf(): not tested because special effort is required
+#   to create values that cause these functions to return true.
+#
+# Also not tested are array subscripting, field/method selection,
+# swizzling, the function call operator, assignment, and the sequence
+# operator.
+
+from __future__ import print_function, division, absolute_import
+import collections
+import itertools
+import functools
+
+from six.moves import range
+import numpy as np
+
+
+# Floating point types used by Python and numpy
+INT32_TYPES = (int, np.int32)
+UINT32_TYPES = (int, np.uint32)
+INT64_TYPES = (long, np.int64)
+UINT64_TYPES = (long, np.uint64)
+
+class GlslBuiltinType(object):
+"""Class representing a GLSL built-in type."""
+def __init__(self, name, base_type, num_cols, num_rows,
+ version_introduced):
+self.__name = name
+if base_type is not None:
+self.__base_type = base_type
+else:
+self.__base_type = self
+self.__num_cols = num_cols
+self.__num_rows = num_rows
+self.__version_introduced = version_introduced
+
+@property
+def name(self):
+"""The name of the type, as a string."""
+return self.__name
+
+

[Piglit] [PATCH] dsa/xfb: make the buffer large enough.

2016-05-30 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

This bug in the test was triggered by a fix to mesa, the test creates
a backing buffer smaller than the xfb range it requests then is surprised
when it gets returned a truncated value for the size.

Signed-off-by: Dave Airlie <airl...@redhat.com>
---
 tests/spec/arb_direct_state_access/gettransformfeedback.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/spec/arb_direct_state_access/gettransformfeedback.c 
b/tests/spec/arb_direct_state_access/gettransformfeedback.c
index 8ea69bf..62d31a2 100644
--- a/tests/spec/arb_direct_state_access/gettransformfeedback.c
+++ b/tests/spec/arb_direct_state_access/gettransformfeedback.c
@@ -218,7 +218,7 @@ piglit_init(int argc, char **argv)
glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, xfb_buf[i]);
piglit_check_gl_error(GL_NO_ERROR);
glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER,
-size, NULL, GL_STREAM_READ);
+start + size, NULL, GL_STREAM_READ);
piglit_check_gl_error(GL_NO_ERROR);
glTransformFeedbackBufferRange(0, i, xfb_buf[i], start, size);
piglit_check_gl_error(GL_NO_ERROR);
-- 
2.5.5

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


[Piglit] [PATCH] arb_shader_storage_buffer_object: test unsized vs implicit arrays.

2016-05-24 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

This tests the difference between an unsized and an implicitly sized array

This removes a compiler test as this will be a linker error now.

The rules are you can have a [] array as long as the shader
later implicitly sizes it.

Signed-off-by: Dave Airlie <airl...@redhat.com>
---
 .../unsized-array-not-in-last-position.frag| 24 ---
 .../linker/implicit_size_array_member.shader_test  | 34 +
 .../non_integral_size_array_member.shader_test | 35 ++
 .../linker/unsized_array_member.shader_test| 34 +
 4 files changed, 103 insertions(+), 24 deletions(-)
 delete 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/linker/implicit_size_array_member.shader_test
 create mode 100644 
tests/spec/arb_shader_storage_buffer_object/linker/non_integral_size_array_member.shader_test
 create mode 100644 
tests/spec/arb_shader_storage_buffer_object/linker/unsized_array_member.shader_test

diff --git 
a/tests/spec/arb_shader_storage_buffer_object/compiler/unsized-array-not-in-last-position.frag
 
b/tests/spec/arb_shader_storage_buffer_object/compiler/unsized-array-not-in-last-position.frag
deleted file mode 100644
index 073d3f3..000
--- 
a/tests/spec/arb_shader_storage_buffer_object/compiler/unsized-array-not-in-last-position.frag
+++ /dev/null
@@ -1,24 +0,0 @@
-// [config]
-// expect_result: fail
-// glsl_version: 1.20
-// require_extensions: GL_ARB_shader_storage_buffer_object
-// [end config]
-
-#version 120
-#extension GL_ARB_shader_storage_buffer_object: require
-
-/* From the GL_ARB_shader_storage_buffer_object spec:
- *
- * "In a shader storage block, the last member may be declared without an
- * explicit size."
- */
-
-buffer a {
-   vec4 b;
-   int c[];
-   float d;
-};
-
-vec4 foo(void) {
-   return b;
-}
diff --git 
a/tests/spec/arb_shader_storage_buffer_object/linker/implicit_size_array_member.shader_test
 
b/tests/spec/arb_shader_storage_buffer_object/linker/implicit_size_array_member.shader_test
new file mode 100644
index 000..03b2b7c
--- /dev/null
+++ 
b/tests/spec/arb_shader_storage_buffer_object/linker/implicit_size_array_member.shader_test
@@ -0,0 +1,34 @@
+# From ARB_program_interface_query spec:
+#
+#"For the property of BUFFER_DATA_SIZE, then the implementation-dependent
+#minimum total buffer object size, in basic machine units, required to
+#hold all active variables associated with an active uniform block, shader
+#storage block, or atomic counter buffer is written to .  If the
+#final member of an active shader storage block is array with no declared
+#size, the minimum buffer size is computed assuming the array was declared
+#as an array with one element."
+
+[require]
+GLSL >= 1.50
+GL_ARB_shader_storage_buffer_object
+
+[vertex shader]
+#version 150
+#extension GL_ARB_shader_storage_buffer_object: require
+
+buffer a {
+   vec4 s[];
+   vec4 a[];
+} b;
+
+in vec4 piglit_vertex;
+out vec4 c;
+
+void main(void) {
+   c = b.s[0] + b.s[1];
+
+   gl_Position = piglit_vertex;
+}
+
+[test]
+verify program_interface_query GL_SHADER_STORAGE_BLOCK a GL_BUFFER_DATA_SIZE 48
diff --git 
a/tests/spec/arb_shader_storage_buffer_object/linker/non_integral_size_array_member.shader_test
 
b/tests/spec/arb_shader_storage_buffer_object/linker/non_integral_size_array_member.shader_test
new file mode 100644
index 000..ba9c605
--- /dev/null
+++ 
b/tests/spec/arb_shader_storage_buffer_object/linker/non_integral_size_array_member.shader_test
@@ -0,0 +1,35 @@
+# From ARB_program_interface_query spec:
+#
+#"For the property of BUFFER_DATA_SIZE, then the implementation-dependent
+#minimum total buffer object size, in basic machine units, required to
+#hold all active variables associated with an active uniform block, shader
+#storage block, or atomic counter buffer is written to .  If the
+#final member of an active shader storage block is array with no declared
+#size, the minimum buffer size is computed assuming the array was declared
+#as an array with one element."
+
+[require]
+GLSL >= 1.50
+GL_ARB_shader_storage_buffer_object
+
+[vertex shader]
+#version 150
+#extension GL_ARB_shader_storage_buffer_object: require
+
+buffer a {
+   vec4 s[];
+   vec4 a[];
+} b;
+
+uniform int f;
+in vec4 piglit_vertex;
+out vec4 c;
+
+void main(void) {
+   c = b.s[f];
+
+   gl_Position = piglit_vertex;
+}
+
+[test]
+link error
diff --git 
a/tests/spec/arb_shader_storage_buffer_object/linker/unsized_array_member.shader_test
 
b/tests/spec/arb_shader_storage_buffer_object/linker/unsized_array_member.shader_test
new file mode 100644
index 000..47d0483
--- /dev/null
+++ 
b/tests/spec/arb_shader_storage_buffer_object/linke

Re: [Piglit] [PATCH 0/4] Additional tests for ARB_vertex_attrib_64bit extension

2016-05-18 Thread Dave Airlie
On 18 May 2016 at 09:31, Andres Gomez <ago...@igalia.com> wrote:
> This series provides additional tests for the ARB_vertex_attrib_64bit
> extension:
>
> https://www.opengl.org/registry/specs/ARB/vertex_attrib_64bit.txt
>
> This work is complemented with the corresponding bug to add support
> for this extension into the i965 shader backend at:
>
> https://bugs.freedesktop.org/show_bug.cgi?id=94442
>
> Cheers,
> Andres (on behalf of the team that worked on this).

I've had a quick look, so

Acked-by: Dave Airlie <airl...@redhat.com>

>
> Alejandro Piñeiro (2):
>   arb_vertex_attrib_64bit: add getactiveattrib test
>   arb_vertex_attrib_64bit: add MAX_VERTEX_ATTRIB test
>
> Andres Gomez (1):
>   arb_vertex_attrib_64bit: Adds double vertex input tests generator
>
> Antia Puentes (1):
>   arb_vertex_attrib_64bit: add overlapping locations test
>
>  generated_tests/CMakeLists.txt |   9 +
>  generated_tests/gen_vs_in_fp64.py  | 380 
> +
>  generated_tests/templates/gen_vs_in_fp64/base.mako |  27 ++
>  .../columns_execution.vert.shader_test.mako|  41 +++
>  .../gen_vs_in_fp64/columns_shader.vert.mako|  17 +
>  .../gen_vs_in_fp64/execution.vert.shader_test.mako |  32 ++
>  .../templates/gen_vs_in_fp64/execution_base.mako   |  85 +
>  .../regular_execution.vert.shader_test.mako|  67 
>  .../gen_vs_in_fp64/regular_shader.vert.mako|  19 ++
>  .../templates/gen_vs_in_fp64/shader.vert.mako  |  16 +
>  .../templates/gen_vs_in_fp64/shader_base.mako  |  12 +
>  tests/all.py   |   5 +
>  .../execution/CMakeLists.gl.txt|   3 +
>  .../execution/getactiveattrib.c| 345 +++
>  .../execution/max-vertex-attrib.c  | 123 +++
>  .../execution/overlapping-locations.c  | 226 
>  .../execution/vs-dvec3-input.shader_test   |  37 --
>  17 files changed, 1407 insertions(+), 37 deletions(-)
>  create mode 100644 generated_tests/gen_vs_in_fp64.py
>  create mode 100644 generated_tests/templates/gen_vs_in_fp64/base.mako
>  create mode 100644 
> generated_tests/templates/gen_vs_in_fp64/columns_execution.vert.shader_test.mako
>  create mode 100644 
> generated_tests/templates/gen_vs_in_fp64/columns_shader.vert.mako
>  create mode 100644 
> generated_tests/templates/gen_vs_in_fp64/execution.vert.shader_test.mako
>  create mode 100644 
> generated_tests/templates/gen_vs_in_fp64/execution_base.mako
>  create mode 100644 
> generated_tests/templates/gen_vs_in_fp64/regular_execution.vert.shader_test.mako
>  create mode 100644 
> generated_tests/templates/gen_vs_in_fp64/regular_shader.vert.mako
>  create mode 100644 generated_tests/templates/gen_vs_in_fp64/shader.vert.mako
>  create mode 100644 generated_tests/templates/gen_vs_in_fp64/shader_base.mako
>  create mode 100644 
> tests/spec/arb_vertex_attrib_64bit/execution/getactiveattrib.c
>  create mode 100644 
> tests/spec/arb_vertex_attrib_64bit/execution/max-vertex-attrib.c
>  create mode 100644 
> tests/spec/arb_vertex_attrib_64bit/execution/overlapping-locations.c
>  delete mode 100644 
> tests/spec/arb_vertex_attrib_64bit/execution/vs-dvec3-input.shader_test
>
> --
> 2.8.1
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 1/2] arb_separate_shader_objects: test linking of anon structs.

2016-05-16 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

I'm not 100% sure this an SSO test, but I just designed it from some UE4
failures we were seeing.

Signed-off-by: Dave Airlie <airl...@redhat.com>
---
 .../execution/anon-structs.shader_test | 32 ++
 1 file changed, 32 insertions(+)
 create mode 100644 
tests/spec/arb_separate_shader_objects/execution/anon-structs.shader_test

diff --git 
a/tests/spec/arb_separate_shader_objects/execution/anon-structs.shader_test 
b/tests/spec/arb_separate_shader_objects/execution/anon-structs.shader_test
new file mode 100644
index 000..3589cc3
--- /dev/null
+++ b/tests/spec/arb_separate_shader_objects/execution/anon-structs.shader_test
@@ -0,0 +1,32 @@
+# pass an anon struct from one stage to another
+[require]
+GLSL >= 3.30
+GL_ARB_separate_shader_objects
+
+[vertex shader]
+#version 330
+#extension GL_ARB_separate_shader_objects: require
+
+layout(location=1) out struct { vec4 Data; } mycolor;
+in vec4 piglit_vertex;
+
+void main()
+{
+   gl_Position = piglit_vertex;
+   mycolor.Data = vec4(0.0, 1.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 330
+#extension GL_ARB_separate_shader_objects: require
+
+layout(location = 1) in struct { vec4 Data; } mycolor;
+
+void main()
+{
+   gl_FragColor = vec4(mycolor.Data);
+}
+
+[test]
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 1.0
-- 
2.5.5

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


[Piglit] [PATCH 2/2] arb_separate_shader_objects: test for same struct redeclaration

2016-05-16 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

As for previous test, suggestions for a better location,

This tests redeclaring a struct like UE4 does works with mesa.

Signed-off-by: Dave Airlie <airl...@redhat.com>
---
 .../execution/redecl-struct.shader_test| 35 ++
 1 file changed, 35 insertions(+)
 create mode 100644 
tests/spec/arb_separate_shader_objects/execution/redecl-struct.shader_test

diff --git 
a/tests/spec/arb_separate_shader_objects/execution/redecl-struct.shader_test 
b/tests/spec/arb_separate_shader_objects/execution/redecl-struct.shader_test
new file mode 100644
index 000..e613f6f
--- /dev/null
+++ b/tests/spec/arb_separate_shader_objects/execution/redecl-struct.shader_test
@@ -0,0 +1,35 @@
+# pass an anon struct from one stage to another
+[require]
+GLSL >= 3.30
+GL_ARB_separate_shader_objects
+
+[vertex shader]
+#version 330
+#extension GL_ARB_separate_shader_objects: require
+
+layout(location=1) out struct TC0 { vec4 Data; } mycolor;
+layout(location=2) out struct TC0 { vec4 Data; } mycolor2;
+in vec4 piglit_vertex;
+
+void main()
+{
+   gl_Position = piglit_vertex;
+   mycolor.Data = vec4(0.5, 0.5, 0.0, 1.0);
+   mycolor2.Data = vec4(-0.5, 0.5, 0.0, 0.0);
+}
+
+[fragment shader]
+#version 330
+#extension GL_ARB_separate_shader_objects: require
+
+layout(location = 1) in struct TC0 { vec4 Data; } mycolor;
+layout(location = 2) in struct TC0 { vec4 Data; } mycolor2;
+
+void main()
+{
+   gl_FragColor = vec4(mycolor.Data + mycolor2.Data);
+}
+
+[test]
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 1.0
-- 
2.5.5

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


Re: [Piglit] [PATCH] gen_flat_interpolation_qualifier.py: Adds non-flat interpolation tests generator

2016-04-18 Thread Dave Airlie
Acked-by: Dave Airlie <airl...@redhat.com>

On 18 April 2016 at 23:06, Andres Gomez <ago...@igalia.com> wrote:
> Hi,
>
> this patch is still unreviewed.
>
> We'd welcome some help to get this into piglit with guarantees that the
> tests added are OK :)
>
> Br.
>
> On Mon, 2016-04-04 at 20:05 +0300, Andres Gomez wrote:
>> This patch provides additional tests for the patch under review at:
>> https://lists.freedesktop.org/archives/mesa-dev/2016-April/111842.htm
>> l
>>
>> Also, this generator provides additional tests for the
>> ARB_gpu_shader_fp64 extension:
>> https://www.opengl.org/registry/specs/ARB/gpu_shader_fp64.txt
>>
>> Which has previous patches for new tests under review at:
>> https://lists.freedesktop.org/archives/piglit/2016-March/019167.html
>>
>> This work is complemented with the corresponding bug to add support
>> for this extension into the i965 shader backend at:
>> https://bugs.freedesktop.org/show_bug.cgi?id=92760
>>
>> Br.
>>
>> On Mon, 2016-04-04 at 20:00 +0300, Andres Gomez wrote:
>> >
>> > Generator for error checking on "flat" keyword.
>> >
>> > This generator adds, additionally, checks for variables inside
>> > structs
>> > and interface blocks, which weren't explicitly mentioned in the
>> > GLSL
>> > specs and, partially, in the GLSL ES specs.
>> >
>> > For a discussion about this check
>> > https://lists.freedesktop.org/archives/mesa-dev/2016-March/109117.h
>> > tm
>> > l
>> > and Khronos bug #15671.
>> >
>> > Also, removed 8 redundant tests replaced by the generator.
>> >
>> > Signed-off-by: Andres Gomez <ago...@igalia.com>
>> > ---
>> >  generated_tests/CMakeLists.txt |   7 +
>> >  .../gen_flat_interpolation_qualifier.py| 170
>> > +
>> >  .../gen_flat_interpolation_qualifier/compiler.mako |  98
>> > 
>> >  .../template.frag.mako |  60 
>> >  .../nonflat-int-array.frag |  31 
>> >  .../interpolation-qualifiers/nonflat-int.frag  |  26 
>> >  .../interpolation-qualifiers/nonflat-ivec4.frag|  26 
>> >  .../interpolation-qualifiers/nonflat-uint.frag |  26 
>> >  .../interpolation-qualifiers/nonflat-uvec4.frag|  26 
>> >  .../nonflat-int-array.frag |  22 ---
>> >  .../interpolation-qualifiers/nonflat-int.frag  |  22 ---
>> >  .../interpolation-qualifiers/nonflat-ivec4.frag|  22 ---
>> >  .../interpolation-qualifiers/nonflat-uint.frag |  22 ---
>> >  .../interpolation-qualifiers/nonflat-uvec4.frag|  22 ---
>> >  .../varying-struct-nonflat-int.frag|  29 
>> >  .../varying-struct-nonflat-uint.frag   |  29 
>> >  16 files changed, 335 insertions(+), 303 deletions(-)
>> >  create mode 100644
>> > generated_tests/gen_flat_interpolation_qualifier.py
>> >  create mode 100644
>> > generated_tests/templates/gen_flat_interpolation_qualifier/compiler
>> > .m
>> > ako
>> >  create mode 100644
>> > generated_tests/templates/gen_flat_interpolation_qualifier/template
>> > .f
>> > rag.mako
>> >  delete mode 100644 tests/spec/glsl-1.30/compiler/interpolation-
>> > qualifiers/nonflat-int-array.frag
>> >  delete mode 100644 tests/spec/glsl-1.30/compiler/interpolation-
>> > qualifiers/nonflat-int.frag
>> >  delete mode 100644 tests/spec/glsl-1.30/compiler/interpolation-
>> > qualifiers/nonflat-ivec4.frag
>> >  delete mode 100644 tests/spec/glsl-1.30/compiler/interpolation-
>> > qualifiers/nonflat-uint.frag
>> >  delete mode 100644 tests/spec/glsl-1.30/compiler/interpolation-
>> > qualifiers/nonflat-uvec4.frag
>> >  delete mode 100644 tests/spec/glsl-es-3.00/compiler/interpolation-
>> > qualifiers/nonflat-int-array.frag
>> >  delete mode 100644 tests/spec/glsl-es-3.00/compiler/interpolation-
>> > qualifiers/nonflat-int.frag
>> >  delete mode 100644 tests/spec/glsl-es-3.00/compiler/interpolation-
>> > qualifiers/nonflat-ivec4.frag
>> >  delete mode 100644 tests/spec/glsl-es-3.00/compiler/interpolation-
>> > qualifiers/nonflat-uint.frag
>> >  delete mode 100644 tests/spec/glsl-es-3.00/compiler/interpolation-
>> > qualifiers/nonflat-uvec4.frag
>> >  delete mode 100644 tests/spec/glsl-es-3.00/compiler

Re: [Piglit] [PATCH 0/8] Additional tests for ARB_gpu_shader_fp64 extension

2016-04-18 Thread Dave Airlie
On 18 April 2016 at 23:01, Andres Gomez  wrote:
> Hi Dave,
>
> can I, then, assume a "ack-b" from you for the all the patches but the
> 3/8 and 5/8?

Yup, you should be able to run the SSBO one against softpipe now in master,

I'm not sure why the GetUniform test would fail, probably should push
it and we can
investigate.

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


Re: [Piglit] [PATCH 0/8] Additional tests for ARB_gpu_shader_fp64 extension

2016-04-05 Thread Dave Airlie
On 5 April 2016 at 18:09, Andres Gomez  wrote:
> Hi,
>
> this series is, for the most of it, still unreviewed.
>
> We'd welcome some help to get this into piglit with guarantees that the
> tests added are OK :)

Do the pass against softpipe/llvmpipe?

I'd ack any that do, let me know of any that don't I suppose so we can
work out why.

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


Re: [Piglit] [PATCH 00/21] Tests for ARB_internalformat_query2 extension

2016-03-03 Thread Dave Airlie
On 23 January 2016 at 02:05, Alejandro Piñeiro <apinhe...@igalia.com> wrote:
> This series provides the tests for the ARB_internalformat_query2
> extension:
>
> https://www.opengl.org/registry/specs/ARB/internalformat_query2.txt
>
> The corresponding bug is being tracked at:
>
> https://bugs.freedesktop.org/show_bug.cgi?id=92687
>
> The difference with the RFC series that I sent at the beginning of the
> week is that adds proper dependency checking and some minor
> cleanups. I already marked as superseeded that series on patchwork.

I can't say I've spent immense amount of times looking at these tests,
but it seems fairly sane,

so I'm happy to give

Acked-by: Dave Airlie <airl...@redhat.com> and for them to be merged.

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


[Piglit] [PATCH] ssbo: fix rendering test to check for vertex ssbo support.

2016-02-14 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

This tests uses vertex ssbo's which fglrx on evergreen doesn't do,
so refuse to run in this case.

Signed-off-by: Dave Airlie <airl...@redhat.com>
---
 tests/spec/arb_shader_storage_buffer_object/rendering.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/tests/spec/arb_shader_storage_buffer_object/rendering.c 
b/tests/spec/arb_shader_storage_buffer_object/rendering.c
index 52d5882..cfb7fb7 100644
--- a/tests/spec/arb_shader_storage_buffer_object/rendering.c
+++ b/tests/spec/arb_shader_storage_buffer_object/rendering.c
@@ -161,6 +161,7 @@ setup_ubos(void)
 void
 piglit_init(int argc, char **argv)
 {
+   GLint num_vs_blocks;
piglit_require_extension("GL_ARB_shader_storage_buffer_object");
piglit_require_extension("GL_ARB_program_interface_query");
 
@@ -168,6 +169,11 @@ piglit_init(int argc, char **argv)
test_buffer_offset = true;
}
 
+   glGetIntegerv(GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS, _vs_blocks);
+   if (num_vs_blocks == 0) {
+   printf("Test requires SSBO vertex shader support.\n");
+   piglit_report_result(PIGLIT_SKIP);
+   }
prog = piglit_build_simple_program(vert_shader_text, frag_shader_text);
assert(prog);
glUseProgram(prog);
-- 
2.1.0

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


[Piglit] [PATCH] arb_shader_storage_buffer_object: add missing GLSL versions.

2016-01-26 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

No GLSL version implies GLSL 1.10, but that isn't supported by
fglrx in core profiles.

This lets the tests run and fail in more interesting ways on fglrx.

Signed-off-by: Dave Airlie <airl...@redhat.com>
---
 tests/spec/arb_shader_storage_buffer_object/max-ssbo-size.c | 2 ++
 tests/spec/arb_shader_storage_buffer_object/maxblocks.c | 1 +
 tests/spec/arb_shader_storage_buffer_object/rendering.c | 1 +
 tests/spec/arb_shader_storage_buffer_object/ssbo-binding.c  | 1 +
 4 files changed, 5 insertions(+)

diff --git a/tests/spec/arb_shader_storage_buffer_object/max-ssbo-size.c 
b/tests/spec/arb_shader_storage_buffer_object/max-ssbo-size.c
index 4595349..154e1af 100644
--- a/tests/spec/arb_shader_storage_buffer_object/max-ssbo-size.c
+++ b/tests/spec/arb_shader_storage_buffer_object/max-ssbo-size.c
@@ -76,6 +76,7 @@ piglit_display(void)
"}\n";
 
const char *fs_template =
+   "#version 130\n"
"#extension GL_ARB_shader_storage_buffer_object : enable\n"
"\n"
"varying vec4 vary;"
@@ -94,6 +95,7 @@ piglit_display(void)
"}\n";
 
const char *fs_ssbo_template =
+   "#version 130\n"
"#extension GL_ARB_shader_storage_buffer_object : enable\n"
"#extension GL_ARB_uniform_buffer_object : enable\n"
"\n"
diff --git a/tests/spec/arb_shader_storage_buffer_object/maxblocks.c 
b/tests/spec/arb_shader_storage_buffer_object/maxblocks.c
index cd9bc47..b03f653 100644
--- a/tests/spec/arb_shader_storage_buffer_object/maxblocks.c
+++ b/tests/spec/arb_shader_storage_buffer_object/maxblocks.c
@@ -73,6 +73,7 @@ get_shader(GLenum target, const char *block_prefix, int 
blocks)
"   v = vec4(0)%s;\n"
"}\n";
const char *fs_source =
+   "#version 130\n"
"#extension GL_ARB_shader_storage_buffer_object : enable\n"
"#extension GL_ARB_uniform_buffer_object : enable\n"
"\n"
diff --git a/tests/spec/arb_shader_storage_buffer_object/rendering.c 
b/tests/spec/arb_shader_storage_buffer_object/rendering.c
index 8d4ecdf..52d5882 100644
--- a/tests/spec/arb_shader_storage_buffer_object/rendering.c
+++ b/tests/spec/arb_shader_storage_buffer_object/rendering.c
@@ -58,6 +58,7 @@ static const char vert_shader_text[] =
"}\n";
 
 static const char frag_shader_text[] =
+   "#version 130\n"
"#extension GL_ARB_shader_storage_buffer_object : require\n"
"\n"
"buffer ssbo_color { vec4 color; float color_scale; };\n"
diff --git a/tests/spec/arb_shader_storage_buffer_object/ssbo-binding.c 
b/tests/spec/arb_shader_storage_buffer_object/ssbo-binding.c
index 6e20de0..062f71e 100644
--- a/tests/spec/arb_shader_storage_buffer_object/ssbo-binding.c
+++ b/tests/spec/arb_shader_storage_buffer_object/ssbo-binding.c
@@ -53,6 +53,7 @@ PIGLIT_GL_TEST_CONFIG_END
 static GLuint prog;
 
 static const char frag_shader_text[] =
+   "#version 130\n"
"#extension GL_ARB_shader_storage_buffer_object : require\n"
"\n"
"buffer ssbo_a { vec4 a; };\n"
-- 
2.1.0

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


Re: [Piglit] [PATCH] xts: Add a rendercheck case for a bug I made in glamor.

2016-01-21 Thread Dave Airlie
On 22 January 2016 at 12:37, Eric Anholt <e...@anholt.net> wrote:
> Drawing to a8 is special now, and I missed it in the CA path.
> ---

Reviewed-by: Dave Airlie <airl...@redhat.com>
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 3/7] all.py: Add arb_viewport_array-render-viewport-2

2015-12-24 Thread Dave Airlie
Acked-by: Dave Airlie <airl...@redhat.com>

On 24 December 2015 at 10:34,  <baker.dyla...@gmail.com> wrote:
> From: Dylan Baker <baker.dyla...@gmail.com>
>
> This was never added in the initial commit.
>
> cc: Brian Paul <bri...@vmware.com>
> cc: Jon Ashburn <j...@lunarg.com>
> Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
> ---
>  tests/all.py | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/tests/all.py b/tests/all.py
> index 723778a..dce7456 100644
> --- a/tests/all.py
> +++ b/tests/all.py
> @@ -2716,6 +2716,7 @@ with profile.group_manager(
>  g(['arb_viewport_array-queries'], 'queries')
>  g(['arb_viewport_array-minmax'], 'minmax')
>  g(['arb_viewport_array-render-viewport'], 'render-viewport')
> +g(['arb_viewport_array-render-viewport-2'], 'render-viewport-2')
>  g(['arb_viewport_array-render-depthrange'], 'render-depthrange')
>  g(['arb_viewport_array-render-scissor'], 'render-scissor')
>  g(['arb_viewport_array-clear'], 'clear')
> --
> 2.6.4
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] ARB_viewport_index: add a rendering test using geom shader invocations.

2015-12-10 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

This is based of a CTS test
GL41-CTS.viewport_array.draw_mulitple_viewports_with_single_invocation

It currently passes on Haswell, but appears to fail on radeonsi/r600
---
 tests/spec/arb_viewport_array/CMakeLists.gl.txt   |   1 +
 tests/spec/arb_viewport_array/render_viewport_2.c | 163 ++
 2 files changed, 164 insertions(+)
 create mode 100644 tests/spec/arb_viewport_array/render_viewport_2.c

diff --git a/tests/spec/arb_viewport_array/CMakeLists.gl.txt 
b/tests/spec/arb_viewport_array/CMakeLists.gl.txt
index 3b8124f..8571577 100644
--- a/tests/spec/arb_viewport_array/CMakeLists.gl.txt
+++ b/tests/spec/arb_viewport_array/CMakeLists.gl.txt
@@ -17,6 +17,7 @@ piglit_add_executable(arb_viewport_array-bounds bounds.c)
 piglit_add_executable(arb_viewport_array-queries queries.c)
 piglit_add_executable(arb_viewport_array-minmax minmax.c)
 piglit_add_executable(arb_viewport_array-render-viewport render_viewport.c)
+piglit_add_executable(arb_viewport_array-render-viewport-2 render_viewport_2.c)
 piglit_add_executable(arb_viewport_array-render-depthrange render_depthrange.c)
 piglit_add_executable(arb_viewport_array-render-scissor render_scissor.c)
 
diff --git a/tests/spec/arb_viewport_array/render_viewport_2.c 
b/tests/spec/arb_viewport_array/render_viewport_2.c
new file mode 100644
index 000..310a3ba
--- /dev/null
+++ b/tests/spec/arb_viewport_array/render_viewport_2.c
@@ -0,0 +1,163 @@
+/*
+ * Copyright © 2015 Red Hat.
+ *
+ * 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.
+ *
+ */
+
+/**
+ * Tests rendering into a single framebuffer surface with multiple viewports
+ * via a geometry shader.
+ * This test is inspired by a CTS test.
+ * For one point, the geom shader emits a triangle strip with a colorx
+ * pre invocation. The viewports then should get one shade of red lighter.
+ */
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_compat_version = 32;
+   config.supports_gl_core_version = 32;
+
+   config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+const char *vsSource = {
+   "#version 150\n"
+   "void main() {\n"
+   "}\n"
+};
+
+const char *gsSource = {
+   "#version 150\n"
+   "#extension GL_ARB_gpu_shader5 : enable\n"
+   "#extension GL_ARB_viewport_array : enable\n"
+   "layout(points, invocations = 16) in;\n"
+   "layout(triangle_strip, max_vertices = 4) out;\n"
+   " flat out int gs_fs_color;\n"
+   "\n"
+   "void main()\n"
+   "{\n"
+   "   gs_fs_color = gl_InvocationID;\n"
+   "   gl_ViewportIndex = gl_InvocationID;\n"
+   "   gl_Position = vec4(-1, -1, 0, 1);\n"
+   "   EmitVertex();\n"
+   "   gs_fs_color = gl_InvocationID;\n"
+   "   gl_ViewportIndex = gl_InvocationID;\n"
+   "   gl_Position = vec4(-1, 1, 0, 1);\n"
+   "   EmitVertex();\n"
+   "   gs_fs_color = gl_InvocationID;\n"
+   "   gl_ViewportIndex = gl_InvocationID;\n"
+   "   gl_Position = vec4(1, -1, 0, 1);\n"
+   "   EmitVertex();\n"
+   "   gs_fs_color = gl_InvocationID;\n"
+   "   gl_ViewportIndex = gl_InvocationID;\n"
+   "   gl_Position = vec4(1, 1, 0, 1);\n"
+   "   EmitVertex();\n"
+   "}\n"
+};
+
+const char *fsSource = {
+   "#version 150\n"
+   "flat in int gs_fs_color;\n"
+   "uniform vec3 color;\n"
+   "void main() {\n"
+   "   gl_FragColor = 

[Piglit] [PATCH] arb_shader_subroutine/arb_shader_fp64: test returning doubles from subroutines

2015-12-10 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

This found a bug in the mesa/st code, and is inspired by
GL41-CTS.shader_subroutine.two_subroutines_single_subroutine_uniform
from CTS.

Signed-off-by: Dave Airlie <airl...@redhat.com>
---
 .../two-subroutines-double-array.shader_test   | 58 ++
 1 file changed, 58 insertions(+)
 create mode 100644 
tests/spec/arb_shader_subroutine/execution/two-subroutines-double-array.shader_test

diff --git 
a/tests/spec/arb_shader_subroutine/execution/two-subroutines-double-array.shader_test
 
b/tests/spec/arb_shader_subroutine/execution/two-subroutines-double-array.shader_test
new file mode 100644
index 000..a05e4d6
--- /dev/null
+++ 
b/tests/spec/arb_shader_subroutine/execution/two-subroutines-double-array.shader_test
@@ -0,0 +1,58 @@
+# shader subroutine fp64 cross over test.
+# return an array of doubles from a function.
+# This exposed a bug in the glsl->tgsi state
+# tracker for doubles.
+#
+[require]
+GLSL >= 1.50
+GL_ARB_shader_subroutine
+GL_ARB_gpu_shader_fp64
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 150
+#extension GL_ARB_shader_subroutine: enable
+#extension GL_ARB_gpu_shader_fp64: enable
+out vec4 color;
+
+subroutine double[2] dadd2(double vin[2]);
+subroutine uniform dadd2 my_dadd2;
+
+subroutine(dadd2)
+double[2] add3(double vin[2])
+{
+   double vout[2];
+   vout[0] = vin[0] + 0.3LF;
+   vout[1] = vin[1] + 0.3LF;
+   return vout;
+}
+
+subroutine(dadd2)
+double[2] add4(double vin[2])
+{
+   double vout[2];
+   vout[0] = vin[0] + 0.4LF;
+   vout[1] = vin[1] + 0.4LF;
+   return vout;
+}
+
+void main()
+{
+   double temp[2], temp2[2];
+
+   temp[0] = 0.1LF;
+   temp[1] = 0.2LF;
+   temp2 = my_dadd2(temp);
+   color = vec4(float(temp2[0]), float(temp2[1]), 0.0, 1.0);
+}
+
+[test]
+clear color 0.0 0.0 1.0 0.0
+clear
+subuniform GL_FRAGMENT_SHADER my_dadd2 add3
+draw rect -1 -1 2 2
+probe all rgba 0.4 0.5 0.0 1.0
+subuniform GL_FRAGMENT_SHADER my_dadd2 add4
+draw rect -1 -1 2 2
+probe all rgba 0.5 0.6 0.0 1.0
-- 
2.5.0

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


[Piglit] [PATCH] glsl-1.50: enhance vs input test to include matrix inputs.

2015-12-10 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

This exercises a bug in mesa when vertex inputs are matrices
and we return the wrong location to GetAttribLocation.

Signed-off-by: Dave Airlie <airl...@redhat.com>
---
 tests/spec/glsl-1.50/execution/vs-input-arrays.c | 43 +---
 1 file changed, 39 insertions(+), 4 deletions(-)

diff --git a/tests/spec/glsl-1.50/execution/vs-input-arrays.c 
b/tests/spec/glsl-1.50/execution/vs-input-arrays.c
index beeb418..79f0b0f 100644
--- a/tests/spec/glsl-1.50/execution/vs-input-arrays.c
+++ b/tests/spec/glsl-1.50/execution/vs-input-arrays.c
@@ -59,6 +59,7 @@ static const char vs_text[] =
"in float a[2];\n"
"in int   b[2];\n"
"in vec3  c[2];\n"
+   "in mat2  d[2];\n"
"\n"
"out float i_failed;\n"
"\n"
@@ -82,6 +83,15 @@ static const char vs_text[] =
"   if( c[1].x != 4.0 + float(gl_VertexID) ) failed = true;\n"
"   if( c[1].y != 5.0 + float(gl_VertexID) ) failed = true;\n"
"   if( c[1].z != 6.0 + float(gl_VertexID) ) failed = true;\n"
+   "\n"
+   "   if( d[0][0].x != 1.0 + float(gl_VertexID) ) failed = true;\n"
+   "   if( d[0][0].y != 2.0 + float(gl_VertexID) ) failed = true;\n"
+   "   if( d[0][1].x != 3.0 + float(gl_VertexID) ) failed = true;\n"
+   "   if( d[0][1].y != 4.0 + float(gl_VertexID) ) failed = true;\n"
+   "   if( d[1][0].x != 5.0 + float(gl_VertexID) ) failed = true;\n"
+   "   if( d[1][0].y != 6.0 + float(gl_VertexID) ) failed = true;\n"
+   "   if( d[1][1].x != 7.0 + float(gl_VertexID) ) failed = true;\n"
+   "   if( d[1][1].y != 8.0 + float(gl_VertexID) ) failed = true;\n"
"   \n"
"   if (failed)\n"
"   i_failed = 1;\n"
@@ -116,33 +126,42 @@ struct vertex_inputs {
 GLfloat a[2];
 GLint b[2];
 GLfloat c[2][3];
+GLfloat d[4][2];
 } vertex_data[] = {
{ { -1.0, -1.0, 0.0 },
  { 10.0, 20.0 },
  { 30, 40 },
  { { 1.0, 2.0, 3.0 },
-   { 4.0, 5.0, 6.0 } }
+   { 4.0, 5.0, 6.0 } },
+ { { 1.0, 2.0 }, { 3.0, 4.0 },
+   { 5.0, 6.0 }, { 7.0, 8.0 } }
},
 
{ { -1.0, 1.0, 0.0 },
  { 11.0, 21.0 },
  { 31, 41 },
  { { 2.0, 3.0, 4.0 },
-   { 5.0, 6.0, 7.0 } }
+   { 5.0, 6.0, 7.0 } },
+ { { 2.0, 3.0 }, { 4.0, 5.0 },
+   { 6.0, 7.0 }, { 8.0, 9.0 } }
},
 
{ { 1.0, 1.0, 0.0 },
  { 12.0, 22.0 },
  { 32, 42 },
  { { 3.0, 4.0, 5.0 },
-   { 6.0, 7.0, 8.0 } }
+   { 6.0, 7.0, 8.0 } },
+ { { 3.0, 4.0 }, { 5.0, 6.0 },
+   { 7.0, 8.0 }, { 9.0, 10.0 } }
},
 
{ { 1.0, -1.0, 0.0 },
  { 13.0, 23.0 },
  { 33, 43 },
  { { 4.0, 5.0, 6.0 },
-   { 7.0, 8.0, 9.0 } }
+   { 7.0, 8.0, 9.0 } },
+ { { 4.0, 5.0 }, { 6.0, 7.0 },
+   { 8.0, 9.0 }, { 10.0, 11.0 } }
}
 };
 
@@ -156,6 +175,7 @@ piglit_init(int argc, char **argv)
GLint a_index;
GLint b_index;
GLint c_index;
+   GLint d_index[2];
 
prog = piglit_build_simple_program(vs_text, fs_text);
 
@@ -174,6 +194,8 @@ piglit_init(int argc, char **argv)
a_index = glGetAttribLocation( prog, "a" );
b_index = glGetAttribLocation( prog, "b" );
c_index = glGetAttribLocation( prog, "c" );
+   d_index[0] = glGetAttribLocation( prog, "d[0]" );
+   d_index[1] = glGetAttribLocation( prog, "d[1]" );
 
/* create buffers */
glGenBuffers( 1,  );
@@ -201,6 +223,15 @@ piglit_init(int argc, char **argv)
glVertexAttribPointer( c_index + 1, 3, GL_FLOAT, GL_FALSE, stride,
   (void*) offsetof( vertex_inputs, c[1] ));
 
+   glVertexAttribPointer( d_index[0], 2, GL_FLOAT, GL_FALSE, stride,
+  (void*) offsetof( vertex_inputs, d[0] ));
+   glVertexAttribPointer( d_index[0] + 1, 2, GL_FLOAT, GL_FALSE, stride,
+  (void*) offsetof( vertex_inputs, d[1] ));
+   glVertexAttribPointer( d_index[1], 2, GL_FLOAT, GL_FALSE, stride,
+  (void*) offsetof( vertex_inputs, d[2] ));
+   glVertexAttribPointer( d_index[1] + 1, 2, GL_FLOAT, GL_FALSE, stride,
+  (void*) offsetof( vertex_inputs, d[3] ));
+
/* enable vertex attrib arrays */
glEnableVertexAttribArray( vertex_index );
glEnableVertexAttribArray( a_index );
@@ -209,6 +240,10 @@ piglit_init(int argc, char **argv)
glEnableVertexAttribArray( b_index + 1 );
glEna

[Piglit] [PATCH] arb_tessellation_shader/arb_gpu_shader_fp64: test dmat4x3

2015-12-07 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

This test passes a dmat4x3 from vs->tcs->tes->fs.

Signed-off-by: Dave Airlie <airl...@redhat.com>
---
 .../execution/dmat-vs-gs-tcs-tes.shader_test   | 80 ++
 1 file changed, 80 insertions(+)
 create mode 100644 
tests/spec/arb_tessellation_shader/execution/dmat-vs-gs-tcs-tes.shader_test

diff --git 
a/tests/spec/arb_tessellation_shader/execution/dmat-vs-gs-tcs-tes.shader_test 
b/tests/spec/arb_tessellation_shader/execution/dmat-vs-gs-tcs-tes.shader_test
new file mode 100644
index 000..a18e979
--- /dev/null
+++ 
b/tests/spec/arb_tessellation_shader/execution/dmat-vs-gs-tcs-tes.shader_test
@@ -0,0 +1,80 @@
+# pass a dmat4x3 through vs->tcs->tes->fs.
+[require]
+GLSL >= 1.50
+GL_ARB_tessellation_shader
+GL_ARB_gpu_shader_fp64
+
+[vertex shader]
+#extension GL_ARB_gpu_shader_fp64: require
+in vec4 vertex;
+
+out dmat4x3 vs_var0;
+
+void main()
+{
+   gl_Position = vertex;
+   vs_var0 = dmat4x3(1.0LF, 2.0LF, 3.0LF, 4.0LF, 5.0LF, 6.0LF, 7.0LF, 
8.0LF, 9.0LF, 10.0LF, 11.0LF, 12.0LF);
+}
+
+
+[tessellation control shader]
+#extension GL_ARB_tessellation_shader: require
+#extension GL_ARB_gpu_shader_fp64: require
+layout(vertices = 3) out;
+
+in dmat4x3 vs_var0[];
+out dmat4x3 tcs_var0[];
+
+void main() {
+   gl_out[gl_InvocationID].gl_Position = 
gl_in[gl_InvocationID].gl_Position;
+   gl_TessLevelOuter = float[4](1.0, 1.0, 1.0, 0.0);
+   gl_TessLevelInner = float[2](0.0, 0.0);
+   tcs_var0[gl_InvocationID] = vs_var0[gl_InvocationID];
+}
+
+
+[tessellation evaluation shader]
+#extension GL_ARB_tessellation_shader: require
+#extension GL_ARB_gpu_shader_fp64: require
+layout(triangles) in;
+
+in dmat4x3 tcs_var0[];
+flat out dmat4x3 tes_var0;
+
+void main() {
+dvec2 temp;
+   gl_Position = gl_in[0].gl_Position * gl_TessCoord[0]
+   + gl_in[1].gl_Position * gl_TessCoord[1]
+   + gl_in[2].gl_Position * gl_TessCoord[2];
+
+   tes_var0 = tcs_var0[0];
+}
+
+
+[fragment shader]
+#extension GL_ARB_gpu_shader_fp64: require
+flat in dmat4x3 tes_var0;
+
+void main()
+{
+   if (tes_var0 == dmat4x3(1.0LF, 2.0LF, 3.0LF, 4.0LF, 5.0LF, 6.0LF, 
7.0LF, 8.0LF, 9.0LF, 10.0LF, 11.0LF, 12.0LF))
+   gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+   else
+   gl_FragColor = 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
+ 1.0 -1.0
+ 1.0  1.0
+
+[test]
+clear color 0.1 0.1 0.1 0.1
+clear
+patch parameter vertices 3
+draw arrays GL_PATCHES 0 6
+probe all rgba 0.0 1.0 0.0 1.0
-- 
2.5.0

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


[Piglit] [PATCH] arb_tessellation_shader/arb_gpu_shader_fp64: pass a dvec3

2015-12-07 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

This passes a dvec3 through vs->tcs->tes->fs.

This hits a bug in the glsl->tgsi code.
---
 .../execution/dvec3-vs-tcs-tes.shader_test | 79 ++
 1 file changed, 79 insertions(+)
 create mode 100644 
tests/spec/arb_tessellation_shader/execution/dvec3-vs-tcs-tes.shader_test

diff --git 
a/tests/spec/arb_tessellation_shader/execution/dvec3-vs-tcs-tes.shader_test 
b/tests/spec/arb_tessellation_shader/execution/dvec3-vs-tcs-tes.shader_test
new file mode 100644
index 000..98110c9
--- /dev/null
+++ b/tests/spec/arb_tessellation_shader/execution/dvec3-vs-tcs-tes.shader_test
@@ -0,0 +1,79 @@
+# simple dvec3 through vs->tcs->tes->fs.
+[require]
+GLSL >= 1.50
+GL_ARB_tessellation_shader
+GL_ARB_gpu_shader_fp64
+
+[vertex shader]
+#extension GL_ARB_gpu_shader_fp64: require
+in vec4 vertex;
+
+out dvec3 vs_var0;
+
+void main()
+{
+   gl_Position = vertex;
+   vs_var0 = dvec3(1.0LF, 2.0LF, 3.0LF);
+}
+
+
+[tessellation control shader]
+#extension GL_ARB_tessellation_shader: require
+#extension GL_ARB_gpu_shader_fp64: require
+layout(vertices = 3) out;
+
+in dvec3 vs_var0[];
+out dvec3 tcs_var0[];
+
+void main() {
+   gl_out[gl_InvocationID].gl_Position = 
gl_in[gl_InvocationID].gl_Position;
+   gl_TessLevelOuter = float[4](1.0, 1.0, 1.0, 0.0);
+   gl_TessLevelInner = float[2](0.0, 0.0);
+   tcs_var0[gl_InvocationID] = vs_var0[gl_InvocationID] + dvec3(2.0LF, 
3.0LF, 4.0LF);
+}
+
+
+[tessellation evaluation shader]
+#extension GL_ARB_tessellation_shader: require
+#extension GL_ARB_gpu_shader_fp64: require
+layout(triangles) in;
+
+in dvec3 tcs_var0[];
+flat out dvec3 tes_var0;
+
+void main() {
+   gl_Position = gl_in[0].gl_Position * gl_TessCoord[0]
+   + gl_in[1].gl_Position * gl_TessCoord[1]
+   + gl_in[2].gl_Position * gl_TessCoord[2];
+
+   tes_var0 = tcs_var0[0] + dvec3(3.0LF, 4.0LF, 5.0LF);
+}
+
+
+[fragment shader]
+#extension GL_ARB_gpu_shader_fp64: require
+flat in dvec3 tes_var0;
+
+void main()
+{
+   if (tes_var0 == dvec3(6.0LF, 9.0LF, 12.0LF))
+   gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+   else
+   gl_FragColor = 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
+ 1.0 -1.0
+ 1.0  1.0
+
+[test]
+clear color 0.1 0.1 0.1 0.1
+clear
+patch parameter vertices 3
+draw arrays GL_PATCHES 0 6
+probe all rgba 0.0 1.0 0.0 1.0
-- 
2.5.0

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


Re: [Piglit] [PATCH 1/2] arb_gpu_shader_fp64: fix wrong use of GLSL version

2015-11-18 Thread Dave Airlie
On 19 November 2015 at 02:05, Emil Velikov  wrote:
> On 17 November 2015 at 15:25, Samuel Pitoiset  
> wrote:
>> piglit_require_GLSL_version() requires an integer as parameter, not a float.
>> This fixes an implicit conversion spotted by Clang.
>>
>> Signed-off-by: Samuel Pitoiset 
>> ---
>>  .../arb_gpu_shader_fp64/execution/double-gettransformfeedbackvarying.c  | 2 
>> +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git 
>> a/tests/spec/arb_gpu_shader_fp64/execution/double-gettransformfeedbackvarying.c
>>  
>> b/tests/spec/arb_gpu_shader_fp64/execution/double-gettransformfeedbackvarying.c
>> index ff4b0e0..36b0a2d 100644
>> --- 
>> a/tests/spec/arb_gpu_shader_fp64/execution/double-gettransformfeedbackvarying.c
>> +++ 
>> b/tests/spec/arb_gpu_shader_fp64/execution/double-gettransformfeedbackvarying.c
>> @@ -115,7 +115,7 @@ piglit_init(int argc, char **argv)
>> int i;
>>
>> /* Set up test */
>> -   piglit_require_GLSL_version(1.50);
>> +   piglit_require_GLSL_version(150);
> I felt bored for a few minutes and had a quick look at the whole of
> piglit. This is the only case where we implicitly or explicitly try to
> feed an incorrect value (float in this case) into
> piglit_require_GLSL_version().

Do I win a prize? :-P
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 1/2] arb_gpu_shader_fp64: fix wrong use of GLSL version

2015-11-17 Thread Dave Airlie
On 18 November 2015 at 01:25, Samuel Pitoiset <samuel.pitoi...@gmail.com> wrote:
> piglit_require_GLSL_version() requires an integer as parameter, not a float.
> This fixes an implicit conversion spotted by Clang.
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoi...@gmail.com>

Reviewed-by: Dave Airlie <airl...@redhat.com>
> ---
>  .../arb_gpu_shader_fp64/execution/double-gettransformfeedbackvarying.c  | 2 
> +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git 
> a/tests/spec/arb_gpu_shader_fp64/execution/double-gettransformfeedbackvarying.c
>  
> b/tests/spec/arb_gpu_shader_fp64/execution/double-gettransformfeedbackvarying.c
> index ff4b0e0..36b0a2d 100644
> --- 
> a/tests/spec/arb_gpu_shader_fp64/execution/double-gettransformfeedbackvarying.c
> +++ 
> b/tests/spec/arb_gpu_shader_fp64/execution/double-gettransformfeedbackvarying.c
> @@ -115,7 +115,7 @@ piglit_init(int argc, char **argv)
> int i;
>
> /* Set up test */
> -   piglit_require_GLSL_version(1.50);
> +   piglit_require_GLSL_version(150);
> piglit_require_transform_feedback();
> piglit_require_extension("GL_ARB_gpu_shader_fp64");
>
> --
> 2.6.2
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH v2] winsys-framework Default to showing window

2015-11-17 Thread Dave Airlie
On 18 November 2015 at 05:49, Arthur Huillet <arthur.huil...@free.fr> wrote:
> Thanks :)
>
> Reviewed by: Arthur Huillet <ahuil...@nvidia.com>

Reviewed-by: Dave Airlie <airl...@redhat.com>
>
> On Tue, 17 Nov 2015 11:33:31 -0800
> Alex Goins <ago...@nvidia.com> wrote:
>
>> From: agoins <ago...@nvidia.com>
>>
>> winsys-framework incorrectly assumed that it will always have ownership of 
>> the
>> pixels in its own buffers. If using the default framebuffer (i.e., when 
>> Piglit
>> is not running in FBO mode,) ownership will not be acquired unless the 
>> window is
>> mapped.
>>
>> While this is not typically a problem because buffers are separate, NVIDIA's
>> Unified Back Buffer feature makes all windows share a back buffer while still
>> conforming to the OpenGL spec. If Piglit does not establish pixel ownership, 
>> its
>> output will be clobbered by other windows.
>>
>> While this problem could be easily fixed by specifying PIGLIT_FORCE_WINDOW=1 
>> or
>> -fbo, the current default takes advantage of undefined behavior in the OpenGL
>> spec. A better solution would be to replace PIGLIT_FORCE_WINDOW with
>> PIGLIT_NO_WINDOW, a flag that allows tests to be run without mapping a 
>> window or
>> using an FBO. The default behavior, the, would be to map a window. Really,
>> though, if users want to test with offscreen rendering, they should use FBOs
>> with flag -fbo.
>>
>> More information on pixel ownership here:
>> https://www.opengl.org/documentation/specs/version1.1/glspec1.1/node94.html
>> ---
>>  .../piglit-framework-gl/piglit_winsys_framework.c| 20 
>> ++--
>>  1 file changed, 10 insertions(+), 10 deletions(-)
>>
>> diff --git a/tests/util/piglit-framework-gl/piglit_winsys_framework.c 
>> b/tests/util/piglit-framework-gl/piglit_winsys_framework.c
>> index c80e972..ff3428a 100644
>> --- a/tests/util/piglit-framework-gl/piglit_winsys_framework.c
>> +++ b/tests/util/piglit-framework-gl/piglit_winsys_framework.c
>> @@ -53,18 +53,18 @@ run_test(struct piglit_gl_framework *gl_fw,
>>   int argc, char *argv[])
>>  {
>>   struct piglit_winsys_framework *winsys_fw = 
>> piglit_winsys_framework(gl_fw);
>> - bool force_window = false;
>> - const char *env_force_window = getenv("PIGLIT_FORCE_WINDOW");
>> + bool no_window = false;
>> + const char *env_no_window = getenv("PIGLIT_NO_WINDOW");
>>
>>
>> - if (env_force_window != NULL) {
>> - if (strcmp(env_force_window, "0") == 0) {
>> - force_window = false;
>> - } else if (strcmp(env_force_window, "1") == 0) {
>> - force_window = true;
>> + if (env_no_window != NULL) {
>> + if (strcmp(env_no_window, "0") == 0) {
>> + no_window = false;
>> + } else if (strcmp(env_no_window, "1") == 0) {
>> + no_window = true;
>>   } else {
>> - fprintf(stderr, "PIGLIT_FORCE_WINDOW has invalid"
>> - " value: %s\n", env_force_window);
>> + fprintf(stderr, "PIGLIT_NO_WINDOW has invalid"
>> + " value: %s\n", env_no_window);
>>   abort();
>>   }
>>   }
>> @@ -73,7 +73,7 @@ run_test(struct piglit_gl_framework *gl_fw,
>>   gl_fw->test_config->init(argc, argv);
>>
>>   if (!gl_fw->test_config->requires_displayed_window &&
>> - piglit_automatic && !force_window) {
>> + piglit_automatic && no_window) {
>>   enum piglit_result result = PIGLIT_PASS;
>>   if (gl_fw->test_config->display)
>>   result = gl_fw->test_config->display();
>> --
>> 1.9.1
>>
>>
>> ---
>> This email message is for the sole use of the intended recipient(s) and may 
>> contain
>> confidential information.  Any unauthorized review, use, disclosure or 
>> distribution
>> is prohibited.  If you are not the intended recipient, please contact the 
>> sender by
>> reply email and destroy all copies of the original message.
>> ---
>>
>
>
> --
> Greetings,
> A. Huillet
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] framework: resmove es3conform support

2015-11-10 Thread Dave Airlie
On 11 November 2015 at 08:52, Eric Anholt  wrote:
> baker.dyla...@gmail.com writes:
>
>> From: Dylan Baker 
>>
>> This is the old Khronos suite, which has been superseded by CTS. Since
>> piglit can wrap cts it seems rather silly to have both CTS and
>> es3conform support.
>>
>> cc: Eric Anholt 
>> Signed-off-by: Dylan Baker 
>> ---
>>
>> Eric, I thought I'd ping you to see if you still needed this. If it's
>> still useful just let me know and I'll drop this, but I just wanted to
>> make sure we weren't carrying it around when CTS was sufficient.
>
> It would be nice if the cts stuff had a link for what repo CTS comes
> from.  Khronos SVN (presumably that's where it is?) is rejecting me so I
> haven't managed to dig around and find it.  I guess you can delete this,
> but transition instructions would be nice.

I think it's all in Khronos gitlab now.

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


Re: [Piglit] [PATCH] winsys-framework Default to showing window

2015-11-08 Thread Dave Airlie
On 21 August 2015 at 22:08, Marek Olšák  wrote:
> Hi Alex,
>
> The tests which don't specifically test the behavior of the default
> framebuffer should use -fbo. I think this is done by marking a test as
> "concurrent" in all.py. A lot of tests don't do that, because nobody
> had the time to update all.py and check if it doesn't break them and
> if it's okay to do that with regard to the purpose of the tests. (i.e.
> do they specifically test the default framebuffer or something else?)


Just FYI classic swrast suffers from this issue, and since I added front buffer
support to softpipe/llvmpipe they now also.

We try to call XGetImage when no window has been mapped, and the X server
correctly throws BadMatch. I'm not sure how to detect this is going to
fail in this
case, as I don't think inside libGL I can detect the unmapped front buffer.

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


Re: [Piglit] [PATCH] getteximage-depth: new test to create/readback depth textures

2015-11-05 Thread Dave Airlie
>
> piglit_require_extension("GL_ARB_depth_texture")

It's checked in the logic up above for the test sets.

In theory I was hoping to expand this test to cover non-depth/stencil cases,
but since they are mostly covered already I didn't expend the time right now.

But I'd like to get to it at some point.

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


[Piglit] [PATCH] getteximage-depth: new test to create/readback depth textures

2015-11-02 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

for every supported target for all the depth/stencil formats
this creates a texture, and then uses glGetTexImage
to read it back.
---
 tests/texturing/CMakeLists.gl.txt   |   1 +
 tests/texturing/getteximage-depth.c | 628 
 2 files changed, 629 insertions(+)
 create mode 100644 tests/texturing/getteximage-depth.c

diff --git a/tests/texturing/CMakeLists.gl.txt 
b/tests/texturing/CMakeLists.gl.txt
index 68afa16..704ea6d 100644
--- a/tests/texturing/CMakeLists.gl.txt
+++ b/tests/texturing/CMakeLists.gl.txt
@@ -34,6 +34,7 @@ piglit_add_executable (getteximage-formats 
getteximage-formats.c)
 piglit_add_executable (getteximage-simple getteximage-simple.c)
 piglit_add_executable (getteximage-luminance getteximage-luminance.c)
 piglit_add_executable (getteximage-targets getteximage-targets.c)
+piglit_add_executable (getteximage-depth getteximage-depth.c)
 piglit_add_executable (incomplete-texture incomplete-texture.c)
 piglit_add_executable (generatemipmap-cubemap generatemipmap-cubemap.c)
 piglit_add_executable (fragment-and-vertex-texturing 
fragment-and-vertex-texturing.c)
diff --git a/tests/texturing/getteximage-depth.c 
b/tests/texturing/getteximage-depth.c
new file mode 100644
index 000..71311bc
--- /dev/null
+++ b/tests/texturing/getteximage-depth.c
@@ -0,0 +1,628 @@
+/*
+ * Copyright (c) 2015 Red Hat
+ *
+ * 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
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, 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
+ * NON-INFRINGEMENT.  IN NO EVENT SHALL VMWARE AND/OR THEIR SUPPLIERS
+ * 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 getteximage-depth
+ *
+ * Test glGetTexImage for depth/stencil format/target combinations in a 
roundtrip.
+ * i.e. don't draw the textures, just create and readback.
+ * this was due to a bug in mesa's handling of 1D array depth textures.
+ */
+
+#include "piglit-util-gl.h"
+#include "../fbo/fbo-formats.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_compat_version = 10;
+
+   config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+enum piglit_result
+piglit_display(void)
+{
+   /* UNREACHABLE */
+   return PIGLIT_FAIL;
+}
+
+#define IMAGE_WIDTH 32
+#define IMAGE_HEIGHT 32
+
+static GLenum target_list[] = { GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_3D, 
GL_TEXTURE_RECTANGLE, GL_TEXTURE_CUBE_MAP,  GL_TEXTURE_1D_ARRAY, 
GL_TEXTURE_2D_ARRAY, GL_TEXTURE_CUBE_MAP_ARRAY };
+
+static int test_target_bitmap;
+
+static int get_test_height(GLenum target)
+{
+   switch (target) {
+   case GL_TEXTURE_1D:
+   case GL_TEXTURE_1D_ARRAY:
+   return 1;
+   default:
+   return IMAGE_HEIGHT;
+   }
+}
+
+static int get_test_depth(GLenum target)
+{
+   switch (target) {
+   case GL_TEXTURE_3D:
+   return 16;
+   case GL_TEXTURE_1D_ARRAY:
+   case GL_TEXTURE_2D_ARRAY:
+   return 7;
+   case GL_TEXTURE_CUBE_MAP_ARRAY:
+   return 12;
+   case GL_TEXTURE_CUBE_MAP:
+   return 6;
+   default:
+   return 1;
+   }
+}
+
+static float get_depth_value(int w, int x)
+{
+   if (w == 1)
+   return 1.0;
+   else
+   return (float)(x) / (w - 1);
+}
+
+static int get_stencil_value(int w, int x)
+{
+   if (w == 1)
+   return 255;
+   else
+   return (x * 255) / (w - 1);
+}
+
+static GLuint
+get_depth_texture(const struct format_desc *format, GLenum target, int w, int 
h, int d, GLboolean mip)
+{
+   void *data;
+   float *f = NULL;
+   unsigned int  *i = NULL;
+   int size, x, y, level, layer;
+   GLuint tex;
+   GLuint extra = 0;
+   GLenum datatype, dataformat;
+   int mul = 1;
+
+   glGenTextures(1, );
+   glBindTexture(target, tex);
+   glTexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+   glTexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+   

Re: [Piglit] [PATCH 0/7] Add tests for ARB_vertex_attrib_binding

2015-10-16 Thread Dave Airlie
Hey Fredrik,

were you going to finish these with Eric's comments?

Dave.

On 12 July 2013 at 14:16, Fredrik Höglund  wrote:
> All the tests pass on Mesa with my WIP implementation of the extension.
> I don't know if they pass on other implementations though, so it would
> be good if someone could test that.
>
> Fredrik Höglund (7):
>   arb_vertex_attrib_binding: Test error conditions
>   arb_vertex_attrib_binding: Test new states
>   arb_vertex_attrib_binding: Test setting and changing formats
>   arb_vertex_attrib_binding: Test switching buffers
>   arb_vertex_attrib_binding: Test changing offsets
>   arb_vertex_attrib_binding: Test instance-divisor
>   arb_vertex_attrib_binding: Test zero-stride bindings
>
>  tests/all.tests |   10 ++
>  tests/spec/CMakeLists.txt   |1 +
>  tests/spec/arb_vertex_attrib_binding/CMakeLists.gl.txt  |   20 +++
>  tests/spec/arb_vertex_attrib_binding/CMakeLists.txt |1 +
>  tests/spec/arb_vertex_attrib_binding/buffers.c  |  178 
> +++
>  tests/spec/arb_vertex_attrib_binding/errors.c   |  249 
> ++
>  tests/spec/arb_vertex_attrib_binding/format.c   |  147 
> +++
>  tests/spec/arb_vertex_attrib_binding/get.c  |  432 
> +
>  tests/spec/arb_vertex_attrib_binding/instance-divisor.c |  186 
> +++
>  tests/spec/arb_vertex_attrib_binding/offsets.c  |  175 
> ++
>  tests/spec/arb_vertex_attrib_binding/zero-stride.c  |  134 ++
>  11 files changed, 1533 insertions(+)
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] arb_gpu_shader_fp64: expand get uniform even further.

2015-10-11 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

Ilia pointed out the fix patch didn't go far enough, so add
some tests to cover more cases, specifically:

a) reading from a dvec4 into a float
b) reading from a vec4 into doubles.

Signed-off-by: Dave Airlie <airl...@redhat.com>
---
 .../arb_gpu_shader_fp64/execution/getuniformdv.c   | 31 +++---
 1 file changed, 27 insertions(+), 4 deletions(-)

diff --git a/tests/spec/arb_gpu_shader_fp64/execution/getuniformdv.c 
b/tests/spec/arb_gpu_shader_fp64/execution/getuniformdv.c
index 8cda7f4..5f7d85e 100644
--- a/tests/spec/arb_gpu_shader_fp64/execution/getuniformdv.c
+++ b/tests/spec/arb_gpu_shader_fp64/execution/getuniformdv.c
@@ -50,6 +50,7 @@ static const char vs_text[] =
"uniform s1 s;\n"
"uniform double d2; \n"
"uniform float f1; \n"
+   "uniform vec4 fv1; \n"
"uniform uint ui1; \n"
"uniform int i1; \n"
"uniform bool b1; \n"
@@ -59,6 +60,7 @@ static const char vs_text[] =
"{\n"
"  gl_Position = vec4(0.0, 0.0, 0.0, 1.0);\n"
"  dvec4 t = dvec4(s.a, s.b, s.c, s.d) * d1 + d2 + double(f1) + double(ui1) 
+ double(i1) + double(b1);\n"
+   "  t += fv1.x + fv1.y + fv1.z + fv1.w;\n"
"  t += v[0] + v[1] + v[2]; \n"
"  color = vec4(t); \n"
"}\n";
@@ -81,8 +83,8 @@ piglit_init(int argc, char **argv)
 {
GLuint vs, fs, prog;
GLint numUniforms, i;
-   GLint expectedNum = 11;
-   GLint loc_d1, loc_d2, loc_sa, loc_sd, loc_v1, loc_f1, loc_ui1, loc_i1, 
loc_b1;
+   GLint expectedNum = 12;
+   GLint loc_d1, loc_d2, loc_sa, loc_sd, loc_v1, loc_f1, loc_fv1, loc_ui1, 
loc_i1, loc_b1;
GLdouble v[4];
GLfloat f[4];
GLuint ui[4];
@@ -136,8 +138,11 @@ piglit_init(int argc, char **argv)
  expectedType = GL_DOUBLE;
  expectedSize = 1;
   } else if (name[0] == 'f') {
- expectedType = GL_FLOAT;
- expectedSize = 1;
+   if (name[1] == 'v')
+ expectedType = GL_FLOAT_VEC4;
+   else
+ expectedType = GL_FLOAT;
+   expectedSize = 1;
   } else if (name[0] == 'i') {
  expectedType = GL_INT;
  expectedSize = 1;
@@ -170,6 +175,7 @@ piglit_init(int argc, char **argv)
loc_sd = glGetUniformLocation(prog, "s.d");
loc_v1 = glGetUniformLocation(prog, "v[1]");
loc_f1 = glGetUniformLocation(prog, "f1");
+   loc_fv1 = glGetUniformLocation(prog, "fv1");
loc_ui1 = glGetUniformLocation(prog, "ui1");
loc_i1 = glGetUniformLocation(prog, "i1");
loc_b1 = glGetUniformLocation(prog, "b1");
@@ -179,6 +185,7 @@ piglit_init(int argc, char **argv)
glUniform1d(loc_sd, 20.0);
glUniform4dv(loc_v1, 1, vVals);
glUniform1f(loc_f1, 40.0);
+   glUniform4f(loc_fv1, 40.0, 30.0, 20.0, 10.0);
glUniform1ui(loc_ui1, 100);
glUniform1i(loc_i1, -100);
 
@@ -249,6 +256,15 @@ piglit_init(int argc, char **argv)
   piglit_report_result(PIGLIT_FAIL);
}
 
+   glGetUniformfv(prog, loc_v1, f);
+   if (f[0] != 30.0 ||
+   f[1] != 31.0 ||
+   f[2] != 32.0 ||
+   f[3] != 33.0) {
+  printf("%s: wrong value for v[1] (found %g,%g,%g,%g, expected 
%g,%g,%g,%g)\n",
+ TestName, f[0], f[1], f[2], f[3], 30.0, 31.0, 32.0, 33.0);
+  piglit_report_result(PIGLIT_FAIL);
+   }
/* use double getters on non-doubles */
glGetUniformdv(prog, loc_f1, v);
if (v[0] != 40.0) {
@@ -256,6 +272,13 @@ piglit_init(int argc, char **argv)
  TestName, v[0], 40.0);
   piglit_report_result(PIGLIT_FAIL);
}
+   glGetUniformdv(prog, loc_fv1, v);
+   if (v[0] != 40.0 || v[1] != 30.0 || v[2] != 20.0 || v[3] != 10.0) {
+  printf("%s: wrong value for fv1 (found %f,%f,%f,%f, expected 
%f,%f,%f,%f)\n",
+ TestName, v[0], v[1], v[2], v[3], 40.0, 30.0, 20.0, 10.0);
+  piglit_report_result(PIGLIT_FAIL);
+   }
+
glGetUniformdv(prog, loc_ui1, v);
if (v[0] != 100.0) {
   printf("%s: wrong value for ui1 (found %f, expected %f)\n",
-- 
2.4.3

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


Re: [Piglit] [PATCH] arb_gpu_shader_fp64: expand get uniform even further.

2015-10-11 Thread Dave Airlie
On 12 October 2015 at 13:05, Ilia Mirkin <imir...@alum.mit.edu> wrote:
> On Sun, Oct 11, 2015 at 11:02 PM, Dave Airlie <airl...@gmail.com> wrote:
>> From: Dave Airlie <airl...@redhat.com>
>>
>> Ilia pointed out the fix patch didn't go far enough, so add
>> some tests to cover more cases, specifically:
>>
>> a) reading from a dvec4 into a float
>> b) reading from a vec4 into doubles.
>>
>> Signed-off-by: Dave Airlie <airl...@redhat.com>
>> ---
>>  .../arb_gpu_shader_fp64/execution/getuniformdv.c   | 31 
>> +++---
>>  1 file changed, 27 insertions(+), 4 deletions(-)
>>
>> diff --git a/tests/spec/arb_gpu_shader_fp64/execution/getuniformdv.c 
>> b/tests/spec/arb_gpu_shader_fp64/execution/getuniformdv.c
>> index 8cda7f4..5f7d85e 100644
>> --- a/tests/spec/arb_gpu_shader_fp64/execution/getuniformdv.c
>> +++ b/tests/spec/arb_gpu_shader_fp64/execution/getuniformdv.c
>> @@ -50,6 +50,7 @@ static const char vs_text[] =
>> "uniform s1 s;\n"
>> "uniform double d2; \n"
>> "uniform float f1; \n"
>> +   "uniform vec4 fv1; \n"
>> "uniform uint ui1; \n"
>> "uniform int i1; \n"
>> "uniform bool b1; \n"
>> @@ -59,6 +60,7 @@ static const char vs_text[] =
>> "{\n"
>> "  gl_Position = vec4(0.0, 0.0, 0.0, 1.0);\n"
>> "  dvec4 t = dvec4(s.a, s.b, s.c, s.d) * d1 + d2 + double(f1) + 
>> double(ui1) + double(i1) + double(b1);\n"
>> +   "  t += fv1.x + fv1.y + fv1.z + fv1.w;\n"
>> "  t += v[0] + v[1] + v[2]; \n"
>> "  color = vec4(t); \n"
>> "}\n";
>> @@ -81,8 +83,8 @@ piglit_init(int argc, char **argv)
>>  {
>> GLuint vs, fs, prog;
>> GLint numUniforms, i;
>> -   GLint expectedNum = 11;
>> -   GLint loc_d1, loc_d2, loc_sa, loc_sd, loc_v1, loc_f1, loc_ui1, loc_i1, 
>> loc_b1;
>> +   GLint expectedNum = 12;
>> +   GLint loc_d1, loc_d2, loc_sa, loc_sd, loc_v1, loc_f1, loc_fv1, loc_ui1, 
>> loc_i1, loc_b1;
>> GLdouble v[4];
>> GLfloat f[4];
>> GLuint ui[4];
>> @@ -136,8 +138,11 @@ piglit_init(int argc, char **argv)
>>   expectedType = GL_DOUBLE;
>>   expectedSize = 1;
>>} else if (name[0] == 'f') {
>> - expectedType = GL_FLOAT;
>> - expectedSize = 1;
>> +   if (name[1] == 'v')
>> + expectedType = GL_FLOAT_VEC4;
>> +   else
>> + expectedType = GL_FLOAT;
>> +   expectedSize = 1;
>>} else if (name[0] == 'i') {
>>   expectedType = GL_INT;
>>   expectedSize = 1;
>> @@ -170,6 +175,7 @@ piglit_init(int argc, char **argv)
>> loc_sd = glGetUniformLocation(prog, "s.d");
>> loc_v1 = glGetUniformLocation(prog, "v[1]");
>> loc_f1 = glGetUniformLocation(prog, "f1");
>> +   loc_fv1 = glGetUniformLocation(prog, "fv1");
>> loc_ui1 = glGetUniformLocation(prog, "ui1");
>> loc_i1 = glGetUniformLocation(prog, "i1");
>> loc_b1 = glGetUniformLocation(prog, "b1");
>> @@ -179,6 +185,7 @@ piglit_init(int argc, char **argv)
>> glUniform1d(loc_sd, 20.0);
>> glUniform4dv(loc_v1, 1, vVals);
>> glUniform1f(loc_f1, 40.0);
>> +   glUniform4f(loc_fv1, 40.0, 30.0, 20.0, 10.0);
>> glUniform1ui(loc_ui1, 100);
>> glUniform1i(loc_i1, -100);
>>
>> @@ -249,6 +256,15 @@ piglit_init(int argc, char **argv)
>>piglit_report_result(PIGLIT_FAIL);
>> }
>>
>> +   glGetUniformfv(prog, loc_v1, f);
>
> loc_fv1 right?

No we want to read the dvec4 at loc_v1 into floats here.

So loc_v1 is correct.
Dave.
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] arb_gpu_shader_fp64: test passing an array from vs->gs->fs works.

2015-10-11 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

This adds two variants on the same basic test, passing
an array of values from vs->gs->fs. The second variant
just initialised the array from 64-bit attributes.

Signed-off-by: Dave Airlie <airl...@redhat.com>
---
 .../execution/gs-fs-vs-double-array.shader_test| 73 
 .../gs-fs-vs-attrib-double-array.shader_test   | 77 ++
 2 files changed, 150 insertions(+)
 create mode 100644 
tests/spec/arb_gpu_shader_fp64/execution/gs-fs-vs-double-array.shader_test
 create mode 100644 
tests/spec/arb_vertex_attrib_64bit/execution/gs-fs-vs-attrib-double-array.shader_test

diff --git 
a/tests/spec/arb_gpu_shader_fp64/execution/gs-fs-vs-double-array.shader_test 
b/tests/spec/arb_gpu_shader_fp64/execution/gs-fs-vs-double-array.shader_test
new file mode 100644
index 000..99eeb79
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/execution/gs-fs-vs-double-array.shader_test
@@ -0,0 +1,73 @@
+# test passing a double array from vs->gs->fs works.
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader_fp64
+
+[vertex shader]
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : require
+in vec4 vertex;
+
+out VS {
+   vec4 vs_vertex;
+   double vs_var0[2];
+};
+
+void main()
+{
+vs_vertex = vertex;
+   vs_var0[0] = 1.0LF;
+   vs_var0[1] = 2.0LF;
+}
+
+[geometry shader]
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : require
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+in VS {
+   vec4 vs_vertex;
+   double vs_var0[2];
+} inp[3];
+
+out GS {
+   flat double gs_var0[2];
+};
+
+void main()
+{
+   for (int i = 0; i < 3; i++) {
+   gl_Position = inp[i].vs_vertex;
+   gs_var0[0] = inp[i].vs_var0[0] + 3.0LF;
+   gs_var0[1] = inp[i].vs_var0[1] + 4.0LF;
+   EmitVertex();
+}
+}
+
+[fragment shader]
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : require
+
+in GS {
+   flat double gs_var0[2];
+};
+
+void main()
+{
+  if (gs_var0[0] == 4.0LF && gs_var0[1] == 6.0LF)
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+  else
+ gl_FragColor = 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]
+draw arrays GL_TRIANGLE_FAN 0 4
+probe rgba 0 0 0.0 1.0 0.0 1.0
diff --git 
a/tests/spec/arb_vertex_attrib_64bit/execution/gs-fs-vs-attrib-double-array.shader_test
 
b/tests/spec/arb_vertex_attrib_64bit/execution/gs-fs-vs-attrib-double-array.shader_test
new file mode 100644
index 000..e20fe9e
--- /dev/null
+++ 
b/tests/spec/arb_vertex_attrib_64bit/execution/gs-fs-vs-attrib-double-array.shader_test
@@ -0,0 +1,77 @@
+# test passing a double array from vs->gs->fs works.
+# this variant inputs values from vertex varyings w
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader_fp64
+GL_ARB_vertex_attrib_64bit
+
+[vertex shader]
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : require
+#extension GL_ARB_vertex_attrib_64bit : require
+in dvec2 values;
+in vec4 vertex;
+
+out VS {
+   vec4 vs_vertex;
+   double vs_var0[2];
+};
+
+void main()
+{
+vs_vertex = vertex;
+   vs_var0[0] = values.x;
+   vs_var0[1] = values.y;
+}
+
+[geometry shader]
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : require
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+in VS {
+   vec4 vs_vertex;
+   double vs_var0[2];
+} inp[3];
+
+out GS {
+   flat double gs_var0[2];
+};
+
+void main()
+{
+   for (int i = 0; i < 3; i++) {
+   gl_Position = inp[i].vs_vertex;
+   gs_var0[0] = inp[i].vs_var0[0] + 3.0LF;
+   gs_var0[1] = inp[i].vs_var0[1] + 4.0LF;
+   EmitVertex();
+}
+}
+
+[fragment shader]
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : require
+
+in GS {
+   flat double gs_var0[2];
+};
+
+void main()
+{
+  if (gs_var0[0] == 5.0LF && gs_var0[1] == 7.0LF)
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+  else
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[vertex data]
+vertex/float/2 values/double/2
+-1.0 -1.0 2.0 3.0
+ 1.0 -1.0 2.0 3.0
+ 1.0  1.0 2.0 3.0
+-1.0  1.0 2.0 3.0
+
+[test]
+draw arrays GL_TRIANGLE_FAN 0 4
+probe rgba 0 0 0.0 1.0 0.0 1.0
-- 
2.4.3

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


[Piglit] [PATCH] tess/fp64: add some basic cross over tests

2015-09-30 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

CTS tests this a lot better than piglit, but this is a good place
to start, I've got a bunch of fixes queued for mesa to address
some of these problems.

This adds 3 tests:
simple double vs->tcs->tes->fs
simple dvec2 vs->tcs->tes->fs
simple double[2] vs->tcs->tes->fs

Signed-off-by: Dave Airlie <airl...@redhat.com>
---
 .../execution/double-array-vs-tcs-tes.shader_test  | 98 ++
 .../execution/double-vs-tcs-tes.shader_test| 80 ++
 .../execution/dvec2-vs-tcs-tes.shader_test | 80 ++
 3 files changed, 258 insertions(+)
 create mode 100644 
tests/spec/arb_tessellation_shader/execution/double-array-vs-tcs-tes.shader_test
 create mode 100644 
tests/spec/arb_tessellation_shader/execution/double-vs-tcs-tes.shader_test
 create mode 100644 
tests/spec/arb_tessellation_shader/execution/dvec2-vs-tcs-tes.shader_test

diff --git 
a/tests/spec/arb_tessellation_shader/execution/double-array-vs-tcs-tes.shader_test
 
b/tests/spec/arb_tessellation_shader/execution/double-array-vs-tcs-tes.shader_test
new file mode 100644
index 000..da8397e
--- /dev/null
+++ 
b/tests/spec/arb_tessellation_shader/execution/double-array-vs-tcs-tes.shader_test
@@ -0,0 +1,98 @@
+# simple double array through vs->tcs->tes->fs.
+[require]
+GLSL >= 1.50
+GL_ARB_tessellation_shader
+GL_ARB_gpu_shader_fp64
+
+[vertex shader]
+#extension GL_ARB_gpu_shader_fp64: require
+
+in vec4 vertex;
+
+out VS {
+  double vs_var0[2];
+};
+
+void main()
+{
+   gl_Position = vertex;
+   vs_var0[0] = 1.0LF;
+   vs_var0[1] = 2.0LF;
+}
+
+
+[tessellation control shader]
+#extension GL_ARB_tessellation_shader: require
+#extension GL_ARB_gpu_shader_fp64: require
+layout(vertices = 3) out;
+
+in VS {
+   double vs_var0[2];
+} inp[];
+
+out TCS {
+   double tcs_var0[2];
+} outp[];
+
+void main() {
+   gl_out[gl_InvocationID].gl_Position = 
gl_in[gl_InvocationID].gl_Position;
+   gl_TessLevelOuter = float[4](1.0, 1.0, 1.0, 0.0);
+   gl_TessLevelInner = float[2](0.0, 0.0);
+   outp[gl_InvocationID].tcs_var0[0] = inp[gl_InvocationID].vs_var0[0] + 
2.0LF;
+   outp[gl_InvocationID].tcs_var0[1] = inp[gl_InvocationID].vs_var0[1] + 
3.0LF;
+}
+
+
+[tessellation evaluation shader]
+#extension GL_ARB_tessellation_shader: require
+#extension GL_ARB_gpu_shader_fp64: require
+layout(triangles) in;
+
+in TCS {
+   double tcs_var0[2];
+} inp[];
+
+out TES {
+   flat double tes_var0[2];
+};
+
+void main() {
+dvec2 temp;
+   gl_Position = gl_in[0].gl_Position * gl_TessCoord[0]
+   + gl_in[1].gl_Position * gl_TessCoord[1]
+   + gl_in[2].gl_Position * gl_TessCoord[2];
+
+   tes_var0[0] = inp[0].tcs_var0[0] + 3.0LF;
+   tes_var0[1] = inp[0].tcs_var0[1] + 4.0LF;
+}
+
+
+[fragment shader]
+#extension GL_ARB_gpu_shader_fp64: require
+in TES {
+   flat double tes_var0[2];
+};
+
+void main()
+{
+   if (tes_var0[0] == 6.0LF && tes_var0[1] == 9.0LF)
+   gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+   else
+   gl_FragColor = 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
+ 1.0 -1.0
+ 1.0  1.0
+
+[test]
+clear color 0.1 0.1 0.1 0.1
+clear
+patch parameter vertices 3
+draw arrays GL_PATCHES 0 6
+probe all rgba 0.0 1.0 0.0 1.0
diff --git 
a/tests/spec/arb_tessellation_shader/execution/double-vs-tcs-tes.shader_test 
b/tests/spec/arb_tessellation_shader/execution/double-vs-tcs-tes.shader_test
new file mode 100644
index 000..68d73dc
--- /dev/null
+++ b/tests/spec/arb_tessellation_shader/execution/double-vs-tcs-tes.shader_test
@@ -0,0 +1,80 @@
+# simple double through vs->tcs->tes->fs.
+[require]
+GLSL >= 1.50
+GL_ARB_tessellation_shader
+GL_ARB_gpu_shader_fp64
+
+[vertex shader]
+#extension GL_ARB_gpu_shader_fp64: require
+in vec4 vertex;
+
+out double vs_var0;
+
+void main()
+{
+   gl_Position = vertex;
+   vs_var0 = 1.0LF;
+}
+
+
+[tessellation control shader]
+#extension GL_ARB_tessellation_shader: require
+#extension GL_ARB_gpu_shader_fp64: require
+layout(vertices = 3) out;
+
+in double vs_var0[];
+out double tcs_var0[];
+
+void main() {
+   gl_out[gl_InvocationID].gl_Position = 
gl_in[gl_InvocationID].gl_Position;
+   gl_TessLevelOuter = float[4](1.0, 1.0, 1.0, 0.0);
+   gl_TessLevelInner = float[2](0.0, 0.0);
+   tcs_var0[gl_InvocationID] = vs_var0[gl_InvocationID] + 2.0LF;
+}
+
+
+[tessellation evaluation shader]
+#extension GL_ARB_tessellation_shader: require
+#extension GL_ARB_gpu_shader_fp64: require
+layout(triangles) in;
+
+in double tcs_var0[];
+flat out double tes_var0;
+
+void main() {
+dvec2 temp;
+   gl_Position = gl_in[0].gl_Position * gl_TessCoord[0]
+   + gl_in[1].gl_Position * gl_TessCoord[1]
+   + gl_in[2].gl_Position * gl_TessCoord[2];
+
+ 

[Piglit] [PATCH] arb_gpu_shader_fp64: expand getuniform double coverage

2015-09-30 Thread Dave Airlie
After looking at CTS I realised we have to accept all types
for get uniform for double conversion, and we should do double
conversion on the non-double types.

I assume this is due to it being the only interface to check
if the location has a value or something.

This adds getting non-double values with GetUniformdv, and
getting double values with float/int/uint interfaces.

notes: currently mesa fails this.

Signed-off-by: Dave Airlie <airl...@redhat.com>
---
 .../arb_gpu_shader_fp64/execution/getuniformdv.c   | 92 --
 1 file changed, 86 insertions(+), 6 deletions(-)

diff --git a/tests/spec/arb_gpu_shader_fp64/execution/getuniformdv.c 
b/tests/spec/arb_gpu_shader_fp64/execution/getuniformdv.c
index f4410b2..8cda7f4 100644
--- a/tests/spec/arb_gpu_shader_fp64/execution/getuniformdv.c
+++ b/tests/spec/arb_gpu_shader_fp64/execution/getuniformdv.c
@@ -49,12 +49,16 @@ static const char vs_text[] =
"uniform dvec4 v[3]; \n"
"uniform s1 s;\n"
"uniform double d2; \n"
+   "uniform float f1; \n"
+   "uniform uint ui1; \n"
+   "uniform int i1; \n"
+   "uniform bool b1; \n"
"out vec4 color; \n"
"\n"
"void main()\n"
"{\n"
"  gl_Position = vec4(0.0, 0.0, 0.0, 1.0);\n"
-   "  dvec4 t = dvec4(s.a, s.b, s.c, s.d) * d1 + d2;\n"
+   "  dvec4 t = dvec4(s.a, s.b, s.c, s.d) * d1 + d2 + double(f1) + double(ui1) 
+ double(i1) + double(b1);\n"
"  t += v[0] + v[1] + v[2]; \n"
"  color = vec4(t); \n"
"}\n";
@@ -77,9 +81,13 @@ piglit_init(int argc, char **argv)
 {
GLuint vs, fs, prog;
GLint numUniforms, i;
-   GLint expectedNum = 7;
-   GLint loc_d1, loc_d2, loc_sa, loc_sd, loc_v1;
+   GLint expectedNum = 11;
+   GLint loc_d1, loc_d2, loc_sa, loc_sd, loc_v1, loc_f1, loc_ui1, loc_i1, 
loc_b1;
GLdouble v[4];
+   GLfloat f[4];
+   GLuint ui[4];
+   GLint i_val[4];
+
static const GLdouble vVals[4] = {30.0, 31.0, 32.0, 33.0};

piglit_require_extension("GL_ARB_gpu_shader_fp64");
@@ -124,10 +132,21 @@ piglit_init(int argc, char **argv)
   if (strcmp(name, "v") == 0 || strcmp(name, "v[0]") == 0) {
  expectedType = GL_DOUBLE_VEC4;
  expectedSize = 3;
-  }
-  else {
+  } else if (name[0] == 'd' || (name[0] == 's')) {
  expectedType = GL_DOUBLE;
  expectedSize = 1;
+  } else if (name[0] == 'f') {
+ expectedType = GL_FLOAT;
+ expectedSize = 1;
+  } else if (name[0] == 'i') {
+ expectedType = GL_INT;
+ expectedSize = 1;
+  } else if (name[0] == 'u') {
+ expectedType = GL_UNSIGNED_INT;
+ expectedSize = 1;
+  } else if (name[0] == 'b') {
+expectedType = GL_BOOL;
+ expectedSize = 1;
   }
 
   if (type != expectedType) {
@@ -150,13 +169,26 @@ piglit_init(int argc, char **argv)
loc_sa = glGetUniformLocation(prog, "s.a");
loc_sd = glGetUniformLocation(prog, "s.d");
loc_v1 = glGetUniformLocation(prog, "v[1]");
-
+   loc_f1 = glGetUniformLocation(prog, "f1");
+   loc_ui1 = glGetUniformLocation(prog, "ui1");
+   loc_i1 = glGetUniformLocation(prog, "i1");
+   loc_b1 = glGetUniformLocation(prog, "b1");
glUniform1d(loc_d1, 5.0);
glUniform1d(loc_d2, 10.0);
glUniform1d(loc_sa, 15.0);
glUniform1d(loc_sd, 20.0);
glUniform4dv(loc_v1, 1, vVals);
+   glUniform1f(loc_f1, 40.0);
+   glUniform1ui(loc_ui1, 100);
+   glUniform1i(loc_i1, -100);
+
+   glUniform1d(loc_b1, 1);
+   if (!piglit_check_gl_error(GL_INVALID_OPERATION))
+  piglit_report_result(PIGLIT_FAIL);
 
+   glUniform1i(loc_b1, 1);
+
+   /* double getters on doubles */
glGetUniformdv(prog, loc_d1, v);
if (v[0] != 5.0) {
   printf("%s: wrong value for d1 (found %f, expected %f)\n",
@@ -195,5 +227,53 @@ piglit_init(int argc, char **argv)
   piglit_report_result(PIGLIT_FAIL);
}
 
+   /* use non-double getters on doubles */
+   glGetUniformfv(prog, loc_d1, f);
+   if (f[0] != 5.0) {
+  printf("%s: wrong value for d1 (found %f, expected %f)\n",
+ TestName, v[0], 5.0);
+  piglit_report_result(PIGLIT_FAIL);
+   }
+
+   glGetUniformuiv(prog, loc_d1, ui);
+   if (ui[0] != 5) {
+  printf("%s: wrong value for d1 (found %f, expected %f)\n",
+ TestName, v[0], 5.0);
+  piglit_report_result(PIGLIT_FAIL);
+   }
+
+   glGetUniformiv(prog, loc_d1, i_val);
+   if (i_val[0] != 5) {
+  printf("%s: wrong value for d1 (found %f, expected %f)\n",
+ TestName, v[0], 5.0);
+  piglit_report_result(PIGLIT_FAIL);
+   }
+
+   /* use double getters on non-doubles */
+   glGetUniformdv(prog, loc_f1, v);
+   if (v[0] != 40.0) {
+  printf("%s: wrong value for f1 (found %f, expected %f)\n&

[Piglit] [PATCH] arb_shader_subroutine: add a vertex shader test

2015-09-30 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

This tests vertex shaders work with shader subroutine.

Signed-off-by: Dave Airlie <airl...@redhat.com>
---
 .../execution/vs-simple-subroutine.shader-test | 52 ++
 1 file changed, 52 insertions(+)
 create mode 100644 
tests/spec/arb_shader_subroutine/execution/vs-simple-subroutine.shader-test

diff --git 
a/tests/spec/arb_shader_subroutine/execution/vs-simple-subroutine.shader-test 
b/tests/spec/arb_shader_subroutine/execution/vs-simple-subroutine.shader-test
new file mode 100644
index 000..1dfe6d3
--- /dev/null
+++ 
b/tests/spec/arb_shader_subroutine/execution/vs-simple-subroutine.shader-test
@@ -0,0 +1,52 @@
+# simple test using one shader subroutine.
+[require]
+GLSL >= 1.50
+GL_ARB_shader_subroutine
+
+[vertex shader]
+#version 150
+#extension GL_ARB_shader_subroutine: enable
+
+in vec4 piglit_vertex;
+out vec4 fcolor;
+subroutine vec4 getcolor();
+subroutine uniform getcolor GetColor;
+
+subroutine(getcolor)
+vec4 color_red()
+{
+   return vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+subroutine(getcolor)
+vec4 color_green()
+{
+   return vec4(0.0, 1.0, 0.0, 1.0);
+}
+
+void main()
+{
+   gl_Position = piglit_vertex;
+   fcolor = GetColor();
+}
+
+[fragment shader]
+#version 150
+
+in vec4 fcolor;
+out vec4 color;
+
+void main()
+{
+   color = fcolor;
+}
+
+[test]
+clear color 0.0 0.0 1.0 0.0
+clear
+subuniform GL_VERTEX_SHADER GetColor color_red
+draw rect -1 -1 2 2
+probe all rgba 1.0 0.0 0.0 1.0
+subuniform GL_VERTEX_SHADER GetColor color_green
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 1.0
-- 
2.4.3

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


Re: [Piglit] [Announce] Summary updates have arrived

2015-09-23 Thread Dave Airlie
I'm not sure if it's related, but I'm not seeing the command lines in
the html summary anymore.

Dave.

On 23 September 2015 at 08:05, Dylan Baker  wrote:
> Just a heads up. My series reworking summaries had landed.
>
> Most of this work is meant to be user-transparent, but I'm sure there
> are one or two corner cases I didn't catch, please direct any bugs with
> the summary my way, and I'll try to be prompt in fixing them.
>
> What has changed is the console output.
> This now returns a more obviously formatted output, with tidy columns
> using the name of the result as the header, and calculating
> changes/regressions/fixes/etc on a column by column basis (ie,
> regressions in column 2 are regressions between column 1 and column 2).
> This should be more useful.
>
> Dylan
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] glsl-1.10: test for rotating a variable components in a loop

2015-09-01 Thread Dave Airlie
From: Dave Airlie <airl...@redhat.com>

This test fails on r600 with sb enabled, it does something
similiar to what a lot of the CTS test cases do.

Signed-off-by: Dave Airlie <airl...@redhat.com>
---
 .../fs-while-loop-rotate-value.shader_test | 32 ++
 1 file changed, 32 insertions(+)
 create mode 100644 
tests/spec/glsl-1.10/execution/fs-while-loop-rotate-value.shader_test

diff --git 
a/tests/spec/glsl-1.10/execution/fs-while-loop-rotate-value.shader_test 
b/tests/spec/glsl-1.10/execution/fs-while-loop-rotate-value.shader_test
new file mode 100644
index 000..cb08b0f
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/fs-while-loop-rotate-value.shader_test
@@ -0,0 +1,32 @@
+# test to check a bug in r600 sb backend
+# it miscompiles this due to the 1.0 
+# at the end wierdly.
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+void main()
+{
+  gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+uniform int count;
+uniform vec4 init_val;
+
+void main()
+{
+   vec4 out_val = init_val;
+   int i = 0;
+   while (i++ < count) {
+   out_val = out_val.yzwx;
+   }
+   gl_FragColor = vec4(out_val.xyz, 1.0);
+}
+
+[test]
+uniform int count 3
+uniform vec4 init_val 0.25 0.5 0.75 1.0
+
+draw rect -1 -1 2 2
+probe all rgba 1.0 0.25 0.5 1.0
-- 
2.4.3

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


Re: [Piglit] [PATCH] ext_texture_integer: add new tex formats test

2015-08-31 Thread Dave Airlie
On 1 September 2015 at 09:21, Brian Paul  wrote:
> Test glTexImage2D() and glGetTexImage() with a variety of internalFormats
> and user formats/types.
>
> Note: currently fails with Mesa, passes with NVIDIA.

As requested this passes on mesa with my format patches applied.

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


Re: [Piglit] [PATCH] arb_transform_feedback3: test for an incorrect assert in mesa/st

2015-07-30 Thread Dave Airlie
On 30 July 2015 at 19:50, Marek Olšák mar...@gmail.com wrote:
 On Thu, Jul 30, 2015 at 2:52 AM, Dave Airlie airl...@gmail.com wrote:
 From: Dave Airlie airl...@redhat.com

 This test hits an assert in the state tracker from the API.

 Signed-off-by: Dave Airlie airl...@redhat.com
 ---
  .../spec/arb_transform_feedback3/CMakeLists.gl.txt |  2 +-
  tests/spec/arb_transform_feedback3/begin_end.c | 78 
 ++
  2 files changed, 79 insertions(+), 1 deletion(-)
  create mode 100644 tests/spec/arb_transform_feedback3/begin_end.c

 diff --git a/tests/spec/arb_transform_feedback3/CMakeLists.gl.txt 
 b/tests/spec/arb_transform_feedback3/CMakeLists.gl.txt
 index 56bf74b..5d93563 100644
 --- a/tests/spec/arb_transform_feedback3/CMakeLists.gl.txt
 +++ b/tests/spec/arb_transform_feedback3/CMakeLists.gl.txt
 @@ -15,5 +15,5 @@ piglit_add_executable 
 (arb_transform_feedback3-draw_using_invalid_stream_index d
  piglit_add_executable 
 (arb_transform_feedback3-set_varyings_with_invalid_args 
 set_varyings_with_invalid_args.c)
  piglit_add_executable (arb_transform_feedback3-set_invalid_varyings 
 set_invalid_varyings.c)
  piglit_add_executable (arb_transform_feedback3-ext_interleaved_two_bufs 
 ext_interleaved_two_bufs.c)
 -
 +piglit_add_executable (arb_transform_feedback3-begin_end begin_end.c)
  # vim: ft=cmake:
 diff --git a/tests/spec/arb_transform_feedback3/begin_end.c 
 b/tests/spec/arb_transform_feedback3/begin_end.c
 new file mode 100644
 index 000..8cedf87
 --- /dev/null
 +++ b/tests/spec/arb_transform_feedback3/begin_end.c
 @@ -0,0 +1,78 @@
 +/*
 + * Copyright © 2013 Intel Corporation
 + *
 + * Permission is hereby granted, free of charge, to any person obtaining a
 + * copy of this software and associated documentation files (the 
 Software),
 + * to deal in the Software without restriction, including without limitation
 + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 + * and/or sell copies of the Software, and to permit persons to whom the
 + * Software is furnished to do so, subject to the following conditions:
 + *
 + * The above copyright notice and this permission notice (including the next
 + * paragraph) shall be included in all copies or substantial portions of the
 + * Software.
 + *
 + * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS 
 OR
 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 
 OTHER
 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
 DEALINGS
 + * IN THE SOFTWARE.
 + */
 +
 +#include piglit-util-gl.h
 +#include xfb3_common.h
 +
 +/**
 + * @file begin_end.c
 + *
 + * This tests for a bug in the gallium state tracker which asserted with
 + * state_tracker/st_cb_xformfb.c:194: 
 st_transform_feedback_get_draw_target: Assertion `0' failed.
 + * This was being hit by ogl conform as well.
 + */
 +
 +PIGLIT_GL_TEST_CONFIG_BEGIN
 +
 +   config.supports_gl_compat_version = 32;
 +   config.supports_gl_core_version = 32;
 +
 +PIGLIT_GL_TEST_CONFIG_END
 +
 +void
 +piglit_init(int argc, char **argv)
 +{
 +   bool pass = true;
 +   GLuint prog;
 +   GLint max_attrib_n;
 +   GLuint buffer;
 +   const char * outputVaryings[] = {gl_Position};
 +   piglit_require_extension(GL_ARB_transform_feedback3);
 +
 +   glGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS,
 +   max_attrib_n);
 +   if (!max_attrib_n) {
 +   printf(Maximum number of separete attributes is zero\n);
 +   piglit_report_result(PIGLIT_FAIL);
 +   }

 What's the point of this if the test doesn't use separate attribs?
 Also, there are minimum requirements on the number of buffers.

Oh it was just cut-n-paste from another test to show the paths the GL
conformance test hits.

I'll kill all the spare code.

Dave.

 Other than that:

 Reviewed-by: Marek Olšák marek.ol...@amd.com

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


[Piglit] [PATCH] arb_gpu_shader_fp64: test glGetUniformdv interface

2015-07-26 Thread Dave Airlie
From: Dave Airlie airl...@redhat.com

I must have forgot this way back when, this just ports the
getuniform02.c test to glsl 1.50 and tests the fp64 interface.

Signed-off-by: Dave Airlie airl...@redhat.com
---
 tests/all.py   |   1 +
 .../execution/CMakeLists.gl.txt|   1 +
 .../arb_gpu_shader_fp64/execution/getuniformdv.c   | 201 +
 3 files changed, 203 insertions(+)
 create mode 100644 tests/spec/arb_gpu_shader_fp64/execution/getuniformdv.c

diff --git a/tests/all.py b/tests/all.py
index 65067f5..ab2be74 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -2087,6 +2087,7 @@ with profile.group_manager(
  g(['arb_gpu_shader_fp64-double-gettransformfeedbackvarying'])
  g(['arb_gpu_shader_fp64-tf-interleaved'])
  g(['arb_gpu_shader_fp64-tf-interleaved-aligned'])
+ g(['arb_gpu_shader_fp64-getuniformdv'])
 
 with profile.group_manager(
 PiglitGLTest,
diff --git a/tests/spec/arb_gpu_shader_fp64/execution/CMakeLists.gl.txt 
b/tests/spec/arb_gpu_shader_fp64/execution/CMakeLists.gl.txt
index b291f37..6738363 100644
--- a/tests/spec/arb_gpu_shader_fp64/execution/CMakeLists.gl.txt
+++ b/tests/spec/arb_gpu_shader_fp64/execution/CMakeLists.gl.txt
@@ -14,3 +14,4 @@ piglit_add_executable (arb_gpu_shader_fp64-tf-separate 
tf-separate.c)
 piglit_add_executable (arb_gpu_shader_fp64-tf-interleaved tf-interleaved.c)
 piglit_add_executable (arb_gpu_shader_fp64-tf-interleaved-aligned 
tf-interleaved-aligned.c)
 piglit_add_executable (arb_gpu_shader_fp64-double-gettransformfeedbackvarying 
double-gettransformfeedbackvarying.c)
+piglit_add_executable (arb_gpu_shader_fp64-getuniformdv getuniformdv.c)
diff --git a/tests/spec/arb_gpu_shader_fp64/execution/getuniformdv.c 
b/tests/spec/arb_gpu_shader_fp64/execution/getuniformdv.c
new file mode 100644
index 000..30e1e58
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/execution/getuniformdv.c
@@ -0,0 +1,201 @@
+/*
+ * Copyright 2011 VMware, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the Software),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/**
+ * Asst. gl[Get]Uniformdv tests.
+ * based on getunifom02.c from Brian Paul.
+ *
+ */
+
+#include piglit-util-gl.h
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_core_version = 32;
+
+   config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+static char *TestName = getuniformdv;
+
+static const char vs_text[] =
+   #version 150\n
+   #extension GL_ARB_gpu_shader_fp64 : require\n
+   struct s1 { \n
+  double a, b, c, d; \n
+   }; \n
+   uniform double d1; \n
+   uniform dvec4 v[3]; \n
+   uniform s1 s;\n
+   uniform double d2; \n
+   out vec4 color; \n
+   \n
+   void main()\n
+   {\n
+ gl_Position = vec4(0.0, 0.0, 0.0, 1.0);\n
+ dvec4 t = dvec4(s.a, s.b, s.c, s.d) * d1 + d2;\n
+ t += v[0] + v[1] + v[2]; \n
+ color = vec4(t); \n
+   }\n;
+
+static const char fs_text[] =
+   #version 150\n
+   in vec4 color;\n
+   void main() { gl_FragColor = color; };
+
+enum piglit_result
+piglit_display(void)
+{
+   /* never called */
+   return PIGLIT_FAIL;
+}
+
+
+void
+piglit_init(int argc, char **argv)
+{
+   GLuint vs, fs, prog;
+   GLint numUniforms, i;
+   GLint expectedNum = 7;
+   GLint loc_d1, loc_d2, loc_sa, loc_sd, loc_v1;
+   GLdouble v[4];
+   static const GLdouble vVals[4] = {30.0, 31.0, 32.0, 33.0};
+   
+   piglit_require_vertex_shader();
+   piglit_require_fragment_shader();
+
+   vs = piglit_compile_shader_text(GL_VERTEX_SHADER, vs_text);
+   fs = piglit_compile_shader_text(GL_FRAGMENT_SHADER, fs_text);
+   prog = piglit_link_simple_program(vs, fs);
+
+   glUseProgram(prog);
+
+   glGetProgramiv(prog, GL_ACTIVE_UNIFORMS, numUniforms);
+   if (numUniforms != expectedNum) {
+  printf(%s: incorrect number of uniforms (found %d, expected %d)\n,
+ TestName, numUniforms, expectedNum);
+  piglit_report_result(PIGLIT_FAIL

Re: [Piglit] [PATCH] Test interpolateAtSample with dynamically nonuniform values

2015-07-23 Thread Dave Airlie
On 24 July 2015 at 02:00, Neil Roberts n...@linux.intel.com wrote:
 Adds a test which is similar to interpolateAtSample-different except
 that it draws a triangle which covers more than one fragment and makes
 sure to use a different sample ID for each fragment so that it won't
 be dynamically uniform. The GLSL spec doesn't mention that the sample
 ID has to be dynamically uniform which presumably means that it is
 allowed. I think this is worth testing because it is not
 straightforward to implement at least on Intel hardware.

just to confirm what I said on irc.
this passes on my current radeonsi code.

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


Re: [Piglit] [PATCH] Test that interpolateAtSample returns different results

2015-07-21 Thread Dave Airlie
On 22 July 2015 at 02:13, Neil Roberts n...@linux.intel.com wrote:
 Adds a new test for interpolateAtSample which captures the results
 from the function with each different sample value and ensures that
 they are all different. This can be done either with a constant or
 non-constant value depending on whether a command line argument is
 given.

 The other tests for interpolateAtSample always use 0 as the sample ID
 so it's not very thorough. Using non-const sampler IDs isn't
 implemented in the i965 driver of Mesa but the other tests pass anyway
 on a release build because it is hardcoded to use sample 0.

Reviewed-by: Dave Airlie airl...@redhat.com

 ---
  tests/all.py   |   2 +
  tests/spec/arb_gpu_shader5/CMakeLists.gl.txt   |   1 +
  .../interpolateAtSample-different.c| 259 
 +
  3 files changed, 262 insertions(+)
  create mode 100644 tests/spec/arb_gpu_shader5/interpolateAtSample-different.c

 diff --git a/tests/all.py b/tests/all.py
 index c92289a..4ba7610 100644
 --- a/tests/all.py
 +++ b/tests/all.py
 @@ -2063,6 +2063,8 @@ with profile.group_manager(
  g(['arb_gpu_shader5-interpolateAtCentroid-noperspective'])
  g(['arb_gpu_shader5-interpolateAtSample'])
  g(['arb_gpu_shader5-interpolateAtSample-nonconst'])
 +g(['arb_gpu_shader5-interpolateAtSample-different'])
 +g(['arb_gpu_shader5-interpolateAtSample-different', 'uniform'])
  g(['arb_gpu_shader5-interpolateAtOffset'])
  g(['arb_gpu_shader5-interpolateAtOffset-nonconst'])

 diff --git a/tests/spec/arb_gpu_shader5/CMakeLists.gl.txt 
 b/tests/spec/arb_gpu_shader5/CMakeLists.gl.txt
 index b25c0d4..f6b845b 100644
 --- a/tests/spec/arb_gpu_shader5/CMakeLists.gl.txt
 +++ b/tests/spec/arb_gpu_shader5/CMakeLists.gl.txt
 @@ -17,5 +17,6 @@ piglit_add_executable 
 (arb_gpu_shader5-interpolateAtCentroid-centroid interpolat
  piglit_add_executable (arb_gpu_shader5-interpolateAtCentroid-noperspective 
 interpolateAtCentroid-noperspective.c)
  piglit_add_executable (arb_gpu_shader5-interpolateAtSample 
 interpolateAtSample.c)
  piglit_add_executable (arb_gpu_shader5-interpolateAtSample-nonconst 
 interpolateAtSample-nonconst.c)
 +piglit_add_executable (arb_gpu_shader5-interpolateAtSample-different 
 interpolateAtSample-different.c)
  piglit_add_executable (arb_gpu_shader5-interpolateAtOffset 
 interpolateAtOffset.c)
  piglit_add_executable (arb_gpu_shader5-interpolateAtOffset-nonconst 
 interpolateAtOffset-nonconst.c)
 diff --git a/tests/spec/arb_gpu_shader5/interpolateAtSample-different.c 
 b/tests/spec/arb_gpu_shader5/interpolateAtSample-different.c
 new file mode 100644
 index 000..7552d21
 --- /dev/null
 +++ b/tests/spec/arb_gpu_shader5/interpolateAtSample-different.c
 @@ -0,0 +1,259 @@
 +/*
 + * Copyright (c) 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.
 + */
 +
 +/**
 + * @file interpolateAtSample-different.c
 + *
 + * Test ARB_gpu_shader5 interpolateAtSample builtin.
 + *
 + * A 1x1 multisample floating-point framebuffer is created with four
 + * samples. A fragment is then rendered into the FBO four times, once
 + * with interpolation at each different sample location. The
 + * interpolation values are written into the framebuffer and read
 + * back. They are then checked to ensure they are all different and
 + * that they all lie within the fragment.
 + *
 + * interpolateAtSample can be called with const or non-const argument.
 + * If ‘uniform’ is specified on the command line it will use a
 + * non-const argument (via a uniform).
 + */
 +
 +#include piglit-util-gl.h
 +
 +PIGLIT_GL_TEST_CONFIG_BEGIN
 +
 +   config.supports_gl_core_version = 32;
 +
 +   config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGB;
 +
 +PIGLIT_GL_TEST_CONFIG_END
 +
 +#define N_SAMPLES 4
 +
 +static const char
 +vertex_shader

[Piglit] [PATCH] texwrap: skip if integers or offset used with non-2D

2015-07-08 Thread Dave Airlie
From: Dave Airlie airl...@redhat.com

The test doesn't support these cases yet, since the shaders
are hardcoded to use 2D samplers.

Signed-off-by: Dave Airlie airl...@redhat.com
---
 tests/texturing/texwrap.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/tests/texturing/texwrap.c b/tests/texturing/texwrap.c
index 76b6382..3736231 100644
--- a/tests/texturing/texwrap.c
+++ b/tests/texturing/texwrap.c
@@ -1839,6 +1839,10 @@ outer_continue:;
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA, GL_REPLACE);
 
if (texture_offset) {
+   if (texture_target != GL_TEXTURE_2D) {
+   printf(Offset tests only work with 2D textures.\n);
+   piglit_report_result(PIGLIT_SKIP);
+   }
piglit_require_GLSL_version(130);
fp = piglit_compile_shader_text(GL_FRAGMENT_SHADER, fp_offset);
assert(fp);
@@ -1851,6 +1855,11 @@ outer_continue:;
switch (test-format[0].type) {
case INT_TYPE:
case UINT_TYPE:
+
+   if (texture_target != GL_TEXTURE_2D) {
+   printf(Integer tests only work with 2D textures.\n);
+   piglit_report_result(PIGLIT_SKIP);
+   }
piglit_require_GLSL_version(130);
fp = piglit_compile_shader_text(GL_FRAGMENT_SHADER, fp_int);
assert(fp);
-- 
2.4.3

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


Re: [Piglit] [PATCH] arb_blend_func_extended: output-location api test

2015-07-08 Thread Dave Airlie
On 3 July 2015 at 17:39, Tapani Pälli tapani.pa...@intel.com wrote:
 Linking should fail, test passes on NVIDIA's proprietary driver version
 346.59 but crashes currently on i965 driver.

 Signed-off-by: Tapani Pälli tapani.pa...@intel.com

Reviewed-by: Dave Airlie airl...@redhat.com
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 1/2] xts: Add a profile for just the rendering tests.

2015-07-08 Thread Dave Airlie
On 9 July 2015 at 07:38, Eric Anholt e...@anholt.net wrote:
 Many X developers work on rendering code, and don't really care about
 the rest of xts.  This is our equivalent of GL's quick.py.

For the series,

Reviewed-by: Dave Airlie airl...@redhat.com
 ---
  tests/xts-render.py | 32 
  1 file changed, 32 insertions(+)
  create mode 100644 tests/xts-render.py

 diff --git a/tests/xts-render.py b/tests/xts-render.py
 new file mode 100644
 index 000..c9adece
 --- /dev/null
 +++ b/tests/xts-render.py
 @@ -0,0 +1,32 @@
 +# Copyright © 2015 Broadcom
 +#
 +# 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.
 +
 +from framework import core
 +from framework.profile import load_test_profile
 +
 +def xts_render_filter(path, test):
 +# All of Xlib9 is for rendering.
 +return 'xlib9' in path
 +
 +profile = load_test_profile(xts)
 +profile.filter_tests(xts_render_filter)
 +
 +__all__ = ['profile']
 --
 2.1.4

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


[Piglit] [PATCH] arb_gpu_shader_fp64: add some tests for indirect double accesses

2015-06-29 Thread Dave Airlie
From: Dave Airlie airl...@redhat.com

while developing for llvmpipe, I realised we weren't testing
indirect access to double arrays, so I wrote some tests.

double array temp src
double array temp dst
double array constant src.

Signed-off-by: Dave Airlie airl...@redhat.com
---
 .../fs-indirect-temp-double-const-src.shader_test  | 50 ++
 .../fs-indirect-temp-double-dst.shader_test| 43 +++
 .../fs-indirect-temp-double-src.shader_test| 50 ++
 3 files changed, 143 insertions(+)
 create mode 100644 
tests/spec/arb_gpu_shader_fp64/execution/fs-indirect-temp-double-const-src.shader_test
 create mode 100644 
tests/spec/arb_gpu_shader_fp64/execution/fs-indirect-temp-double-dst.shader_test
 create mode 100644 
tests/spec/arb_gpu_shader_fp64/execution/fs-indirect-temp-double-src.shader_test

diff --git 
a/tests/spec/arb_gpu_shader_fp64/execution/fs-indirect-temp-double-const-src.shader_test
 
b/tests/spec/arb_gpu_shader_fp64/execution/fs-indirect-temp-double-const-src.shader_test
new file mode 100644
index 000..7cf4d70
--- /dev/null
+++ 
b/tests/spec/arb_gpu_shader_fp64/execution/fs-indirect-temp-double-const-src.shader_test
@@ -0,0 +1,50 @@
+# test indirect access to an array of constant doubles
+[require]
+GLSL = 1.50
+GL_ARB_gpu_shader_fp64
+
+[vertex shader]
+in vec4 vertex;
+void main()
+{
+gl_Position = vertex;
+}
+
+[fragment shader]
+#extension GL_ARB_gpu_shader_fp64 : require
+uniform double arg0;
+uniform double tval[5];
+uniform double tolerance;
+uniform double expected;
+uniform int pick;
+void main()
+{
+  double result;
+  result = (tval[pick] + arg0);
+  gl_FragColor = distance(result, 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 1.0 0.0
+clear
+uniform double tval[0] 0.0
+uniform double tval[1] 0.25
+uniform double tval[2] 0.5
+uniform double tval[3] 0.75
+uniform double arg0 0.25
+uniform double expected 0.75
+uniform double tolerance 0.0
+uniform int pick 2
+draw arrays GL_TRIANGLE_FAN 0 4
+uniform double arg0 0.25
+uniform double expected 0.5
+uniform double tolerance 0.0
+uniform int pick 1
+draw arrays GL_TRIANGLE_FAN 0 4
diff --git 
a/tests/spec/arb_gpu_shader_fp64/execution/fs-indirect-temp-double-dst.shader_test
 
b/tests/spec/arb_gpu_shader_fp64/execution/fs-indirect-temp-double-dst.shader_test
new file mode 100644
index 000..e620e9d
--- /dev/null
+++ 
b/tests/spec/arb_gpu_shader_fp64/execution/fs-indirect-temp-double-dst.shader_test
@@ -0,0 +1,43 @@
+# test indirect access to an array of doubles as a dst.
+[require]
+GLSL = 1.50
+GL_ARB_gpu_shader_fp64
+
+[vertex shader]
+in vec4 vertex;
+void main()
+{
+gl_Position = vertex;
+}
+
+[fragment shader]
+#extension GL_ARB_gpu_shader_fp64 : require
+uniform double arg0;
+uniform double arg1;
+uniform double tolerance;
+uniform double expected;
+uniform int pick;
+void main()
+{
+  double result[5];
+
+  result[pick] = (arg0 + arg1);
+  gl_FragColor = distance(result[pick], 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 1.0 0.0
+clear
+uniform double arg0 0.5
+uniform double arg1 0.25
+uniform double expected 0.75
+uniform double tolerance 0.0
+uniform int pick 3
+draw arrays GL_TRIANGLE_FAN 0 4
diff --git 
a/tests/spec/arb_gpu_shader_fp64/execution/fs-indirect-temp-double-src.shader_test
 
b/tests/spec/arb_gpu_shader_fp64/execution/fs-indirect-temp-double-src.shader_test
new file mode 100644
index 000..2f50c63
--- /dev/null
+++ 
b/tests/spec/arb_gpu_shader_fp64/execution/fs-indirect-temp-double-src.shader_test
@@ -0,0 +1,50 @@
+# test indirect access to a temporary array of doubles as a source
+[require]
+GLSL = 1.50
+GL_ARB_gpu_shader_fp64
+
+[vertex shader]
+in vec4 vertex;
+void main()
+{
+gl_Position = vertex;
+}
+
+[fragment shader]
+#extension GL_ARB_gpu_shader_fp64 : require
+uniform double arg0;
+uniform double tolerance;
+uniform double expected;
+uniform int pick;
+void main()
+{
+  double tval[5];
+  double result;
+  tval[0] = 0.0lf;
+  tval[1] = 0.25lf;
+  tval[2] = 0.5lf;
+  tval[3] = 0.75lf;
+  result = (tval[pick] + arg0);
+  gl_FragColor = distance(result, 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 1.0 0.0
+clear
+uniform double arg0 0.25
+uniform double expected 0.75
+uniform double tolerance 0.0
+uniform int pick 2
+draw arrays GL_TRIANGLE_FAN 0 4
+uniform double arg0 0.25
+uniform double expected 0.5
+uniform double tolerance 0.0
+uniform int pick 1
+draw arrays GL_TRIANGLE_FAN 0 4
-- 
2.4.3

___
Piglit mailing list
Piglit@lists.freedesktop.org
http

[Piglit] [PATCH] arb_gpu_shader5: add textureSize sampler indexing tests

2015-06-21 Thread Dave Airlie
From: Dave Airlie airl...@redhat.com

softpipe takes a different path for textureSize, so test it as well
just in case other drivers do similiar.

Signed-off-by: Dave Airlie airl...@redhat.com
---
 .../fs-simple-texture-size.shader_test | 68 ++
 1 file changed, 68 insertions(+)
 create mode 100644 
tests/spec/arb_gpu_shader5/execution/sampler_array_indexing/fs-simple-texture-size.shader_test

diff --git 
a/tests/spec/arb_gpu_shader5/execution/sampler_array_indexing/fs-simple-texture-size.shader_test
 
b/tests/spec/arb_gpu_shader5/execution/sampler_array_indexing/fs-simple-texture-size.shader_test
new file mode 100644
index 000..dca749f
--- /dev/null
+++ 
b/tests/spec/arb_gpu_shader5/execution/sampler_array_indexing/fs-simple-texture-size.shader_test
@@ -0,0 +1,68 @@
+# This test verifies that dynamically uniform indexing of sampler arrays
+# in the fragment shader behaves correctly using textureSize
+
+[require]
+GLSL = 1.50
+GL_ARB_gpu_shader5
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 150
+#extension GL_ARB_gpu_shader5: require
+
+uniform sampler2D s[4];
+
+uniform int n;
+
+out vec4 color;
+
+void main()
+{
+   color = vec4(textureSize(s[n], 0)/100.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.2 0.2 0.2 0.2
+clear
+
+uniform int s[0] 0
+uniform int s[1] 1
+uniform int s[2] 2
+uniform int s[3] 3
+
+texture checkerboard 0 0 (128, 128) (1.0, 0.0, 0.0, 0.0) (1.0, 0.0, 0.0, 0.0)
+texparameter 2D min nearest
+texparameter 2D mag nearest
+
+texture checkerboard 1 0 (64, 64) (0.0, 1.0, 0.0, 0.0) (0.0, 1.0, 0.0, 0.0)
+texparameter 2D min nearest
+texparameter 2D mag nearest
+
+texture checkerboard 2 0 (32, 32) (0.0, 0.0, 1.0, 0.0) (0.0, 0.0, 1.0, 0.0)
+texparameter 2D min nearest
+texparameter 2D mag nearest
+
+texture checkerboard 3 0 (16, 16) (1.0, 1.0, 1.0, 1.0) (1.0, 1.0, 1.0, 1.0)
+texparameter 2D min nearest
+texparameter 2D mag nearest
+
+uniform int n 0
+draw rect -1 -1 1 1
+
+relative probe rect rgb (0.0, 0.0, 0.5, 0.5) (1.0, 1.0, 0.0)
+
+uniform int n 1
+draw rect 0 -1 1 1
+
+relative probe rect rgb (0.5, 0.0, 0.5, 0.5) (0.64, 0.64, 0.0)
+
+uniform int n 2
+draw rect -1 0 1 1
+
+relative probe rect rgb (0.0, 0.5, 0.5, 0.5) (0.32, 0.32, 0.0)
+
+uniform int n 3
+draw rect 0 0 1 1
+
+relative probe rect rgb (0.5, 0.5, 0.5, 0.5) (0.16, 0.16, 0.0)
-- 
2.4.3

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


Re: [Piglit] [PATCH 00/40] Replace vpfp-generic with shader_runner.

2015-06-07 Thread Dave Airlie
On 7 June 2015 at 12:11, Kenneth Graunke kenn...@whitecape.org wrote:
 Hi all,

 This patch series ports all vpfp-generic tests to shader_runner,
 and then deletes vpfp-generic.

 A bit of history:
 - vpfp-generic was introduced by Nicolai Hähnle in 2009, as a generic
   ARB_vertex|fragment_program test runner.
 - shader_runner was introduced by Ian Romanick in 2010, as a generic
   GLSL shader runner.
 - shader_runner gained ARB program support in 2011 (courtesy of Eric Anholt).

 At this point, vpfp-generic is fairly redundant - shader_runner can do
 everything we need, and is much more widespread (12000+ tests).  I've
 been meaning to delete it for a few years, but never got around to it.

 One difference is that the new tests don't glClear() before drawing.  Since
 they draw the entire window, it's pretty unnecessary, and just makes the
 tests harder to debug.  Many shader_runner tests don't bother clearing.

This is actually annoying feature, esp if all tests use the same color
for success,

because we render one test, it passes, we render another test, it
doesn't draw anything
but it has gotten the back buffer from the previous tests, and it
magically passes.

This happens a lot more often on GPUs with VRAM.

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


Re: [Piglit] [PATCH 00/40] Replace vpfp-generic with shader_runner.

2015-06-07 Thread Dave Airlie
On 8 June 2015 at 15:31, Kenneth Graunke kenn...@whitecape.org wrote:
 On Monday, June 08, 2015 06:29:26 AM Dave Airlie wrote:
 On 7 June 2015 at 12:11, Kenneth Graunke kenn...@whitecape.org wrote:
  Hi all,
 
  This patch series ports all vpfp-generic tests to shader_runner,
  and then deletes vpfp-generic.
 
  A bit of history:
  - vpfp-generic was introduced by Nicolai Hähnle in 2009, as a generic
ARB_vertex|fragment_program test runner.
  - shader_runner was introduced by Ian Romanick in 2010, as a generic
GLSL shader runner.
  - shader_runner gained ARB program support in 2011 (courtesy of Eric 
  Anholt).
 
  At this point, vpfp-generic is fairly redundant - shader_runner can do
  everything we need, and is much more widespread (12000+ tests).  I've
  been meaning to delete it for a few years, but never got around to it.
 
  One difference is that the new tests don't glClear() before drawing.  Since
  they draw the entire window, it's pretty unnecessary, and just makes the
  tests harder to debug.  Many shader_runner tests don't bother clearing.

 This is actually annoying feature, esp if all tests use the same color
 for success,

 because we render one test, it passes, we render another test, it
 doesn't draw anything
 but it has gotten the back buffer from the previous tests, and it
 magically passes.

 This happens a lot more often on GPUs with VRAM.

 Dave.

 I don't know...the tests probe the entire window...so the only failure
 mode that will bite you like that is the driver didn't render anything
 at all.  And the assumption is that, even with such a broken driver,
 clearing will actually succeed at drawing...

Yes but what happens if all the tests run and don't bother clearing,
so drawing fails in test 1, test 2 passes because it doesn't clear,
and it gets test1 result frame, where it passed, It looks like
test2 passes when it clearly hasn't.

You've actually said it, clearing would succeed, but the problem
is the tests don't clear.

and yes there are many reasons things don't render, the main
one I see if where an earlier test has locked up the GPU but
not totally.

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


Re: [Piglit] [PATCH] texwrap: test wrapping texture offsets

2015-05-27 Thread Dave Airlie
 case GL_MIRROR_CLAMP_EXT:
 @@ -862,6 +868,10 @@ static void draw(const struct format_desc *format,
 scale[0] = scale[1] = scale[2] = scale[3] = 1.0/((1ull 
 (bits-1))-1);
 glUseProgram(prog_int);
 glUniform4fv(int_scale_loc, 1, scale);
 +   if (texture_offset)
 +   glUniform1f(int_use_offset_loc, 1.0);
 +   else
 +   glUniform1f(int_use_offset_loc, 0.0);


 Is it legal to set boolean uniforms with a float?  I would expect that
 glUniform1i() would be required here.  In any case, this could boil down to:
glUniform1f(int_use_offset_loc, texture_offset);

Yes its legal but Uniform1i with texture_offset is cleaner alright.
I'll fix that up.

and I've fixed up the tabs, can I consider that an R-b?

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


[Piglit] [PATCH] texwrap: test wrapping texture offsets

2015-05-26 Thread Dave Airlie
while writing softpipe support I realised we didn't have tests for any of
this, this just adds a new parameter to texwrap to test texture offsets,

Signed-off-by: Dave Airlie airl...@redhat.com
---
 tests/texturing/texwrap.c | 66 +--
 1 file changed, 64 insertions(+), 2 deletions(-)

diff --git a/tests/texturing/texwrap.c b/tests/texturing/texwrap.c
index 7be19a5..ef9a63c 100644
--- a/tests/texturing/texwrap.c
+++ b/tests/texturing/texwrap.c
@@ -568,6 +568,7 @@ static GLuint texture_id;
 static GLenum texture_target;
 static GLboolean texture_npot;
 static GLboolean texture_proj;
+static GLboolean texture_offset;
 static GLboolean test_border_color;
 static GLboolean texture_swizzle;
 static GLboolean has_texture_swizzle;
@@ -575,8 +576,8 @@ static GLboolean has_npot;
 static const struct test_desc *test;
 static const struct format_desc *init_format;
 static int size_x = 1, size_y = 1, size_z = 1;
-static GLuint prog_int, prog_uint;
-static GLint int_scale_loc, uint_scale_loc;
+static GLuint prog_int, prog_uint, prog_offset;
+static GLint int_scale_loc, uint_scale_loc, use_offset_loc, 
int_use_offset_loc, uint_use_offset_loc;
 
 /* Image data. */
 static const int swizzle[4] = {2, 0, 1, 3};
@@ -636,6 +637,11 @@ static void sample_nearest(int x, int y, int z,
coords[2] = 0;
}
 
+   if (texture_offset) {
+   coords[0] -= 3;
+   if (texture_target != GL_TEXTURE_1D)
+   coords[1] += 3;
+   }
/* Handle clamp mirroring. */
switch (wrap_mode) {
case GL_MIRROR_CLAMP_EXT:
@@ -862,6 +868,10 @@ static void draw(const struct format_desc *format,
scale[0] = scale[1] = scale[2] = scale[3] = 1.0/((1ull  
(bits-1))-1);
glUseProgram(prog_int);
glUniform4fv(int_scale_loc, 1, scale);
+   if (texture_offset)
+   glUniform1f(int_use_offset_loc, 1.0);
+   else
+   glUniform1f(int_use_offset_loc, 0.0);
break;
case UINT_TYPE:
scale[0] = scale[1] = scale[2] = scale[3] = 1.0/((1ull  
bits)-1);
@@ -870,8 +880,16 @@ static void draw(const struct format_desc *format,
}
glUseProgram(prog_uint);
glUniform4fv(uint_scale_loc, 1, scale);
+   if (texture_offset)
+   glUniform1f(uint_use_offset_loc, 1.0);
+   else
+   glUniform1f(uint_use_offset_loc, 0.0);
break;
default:;
+   if (texture_offset) {
+   glUseProgram(prog_offset);
+   glUniform1f(use_offset_loc, 1.0);
+   }
}
 
/* Loop over min/mag filters. */
@@ -965,6 +983,8 @@ static void draw(const struct format_desc *format,
glUseProgram(0);
break;
default:;
+   if (texture_offset)
+   glUseProgram(0);
}
 
glDisable(texture_target);
@@ -1660,18 +1680,41 @@ static const char *fp_int =
#version 130 \n
uniform isampler2D tex; \n
uniform vec4 scale; \n
+uniform bool use_offset; \n
void main() \n
{ \n
+  if (use_offset) { \n
+  gl_FragColor = vec4(textureOffset(tex, gl_TexCoord[0].xy, ivec2(-3, 
3))) * scale; \n
+  } else { \n
   gl_FragColor = vec4(texture(tex, gl_TexCoord[0].xy)) * scale; \n
+  } \n
} \n;
 
 static const char *fp_uint =
#version 130 \n
uniform usampler2D tex; \n
uniform vec4 scale; \n
+uniform bool use_offset; \n
void main() \n
{ \n
+  if (use_offset) { \n
+  gl_FragColor = vec4(textureOffset(tex, gl_TexCoord[0].xy, ivec2(-3, 
3)) * scale; \n
+  } else { \n
   gl_FragColor = vec4(texture(tex, gl_TexCoord[0].xy)) * scale; \n
+  } \n
+   } \n;
+
+static const char *fp_offset =
+   #version 130 \n
+   uniform sampler2D tex; \n
+   uniform bool use_offset; \n
+   void main() \n
+   { \n
+  if (use_offset) { \n
+  gl_FragColor = textureOffset(tex, gl_TexCoord[0].xy, ivec2(-3, 3)); 
\n
+  } else { \n
+  gl_FragColor = texture(tex, gl_TexCoord[0].xy); \n
+  } \n
} \n;
 
 void piglit_init(int argc, char **argv)
@@ -1721,6 +1764,11 @@ void piglit_init(int argc, char **argv)
printf(Using projective mapping.\n);
continue;
}
+   if (strcmp(argv[p], offset) == 0) {
+   texture_offset = 1;
+   printf(Using texture offsets.\n);
+   continue;
+   }
if (strcmp(argv[p], bordercolor) == 0) {
test_border_color = 1;
printf(Testing the border

[Piglit] [PATCH] arb_gpu_shader_fp64: make sure implicit double-float doesnt' happen

2015-05-06 Thread Dave Airlie
From: Dave Airlie airl...@redhat.com

Mesa is allowing this right now, so add a test to make it not happen
again.

Signed-off-by: Dave Airlie airl...@redhat.com
---
 .../compiler/implicit-conversion-bad.vert  | 30 ++
 1 file changed, 30 insertions(+)
 create mode 100644 
tests/spec/arb_gpu_shader_fp64/compiler/implicit-conversion-bad.vert

diff --git 
a/tests/spec/arb_gpu_shader_fp64/compiler/implicit-conversion-bad.vert 
b/tests/spec/arb_gpu_shader_fp64/compiler/implicit-conversion-bad.vert
new file mode 100644
index 000..95b85c8
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/compiler/implicit-conversion-bad.vert
@@ -0,0 +1,30 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_gpu_shader_fp64
+// [end config]
+//
+// Test double - float implicit conversion doesn't happen
+// this tests a bug in mesa
+
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : enable
+
+float _float = 0.0f;
+vec2 _vec2 = vec2(0.0f);
+vec3 _vec3 = vec3(0.0f);
+vec4 _vec4 = vec4(0.0f);
+
+double _double = 0.0lf;
+dvec2 _dvec2 = dvec2(0.0lf);
+dvec3 _dvec3 = dvec3(0.0lf);
+dvec4 _dvec4 = dvec4(0.0lf);
+
+void test() {
+
+   /* int can be converted to double (and for vectors of same) */
+   _float = _double;
+   _vec2 = _dvec2;
+   _vec3 = _dvec3;
+   _vec4 = _dvec4;
+}
-- 
2.1.0

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


[Piglit] [PATCH 1/2] shader_runner: add ARB_shader_subroutine support (v3)

2015-04-23 Thread Dave Airlie
From: Dave Airlie airl...@redhat.com

This adds basic support for executing shader subroutine tests.

it comes with two intro tests, and probably a lot of bugs.

tested against NVIDIA, for some reason -auto fails here.

v2: add support for other shader types (Ilia)
v2.1: fix printf
v3: rework code to query num subroutine locations,
and calloc them, also check for the extension.

Signed-off-by: Dave Airlie airl...@redhat.com
---
 tests/shaders/shader_runner.c | 156 ++
 1 file changed, 156 insertions(+)

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index 0a28eeb..b64b213 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -113,6 +113,9 @@ GLenum geometry_layout_output_type = GL_TRIANGLE_STRIP;
 GLint geometry_layout_vertices_out = 0;
 GLuint atomics_bo = 0;
 
+#define SHADER_TYPES 6
+static GLuint *subuniform_locations[SHADER_TYPES];
+static int num_subuniform_locations[SHADER_TYPES];
 char *shader_string;
 GLint shader_string_size;
 const char *vertex_data_start = NULL;
@@ -1241,6 +1244,17 @@ check_double_support(void)
 }
 
 /**
+ * Check that the GL implementation supports shader subroutines
+ * If not, terminate the test with a SKIP.
+ */
+void
+check_shader_subroutine_support(void)
+{
+   if (gl_version.num  40  
!piglit_is_extension_supported(GL_ARB_shader_subroutine))
+   piglit_report_result(PIGLIT_SKIP);
+}
+
+/**
  * Handles uploads of UBO uniforms by mapping the buffer and storing
  * the data.  If the uniform is not in a uniform block, returns false.
  */
@@ -1642,6 +1656,140 @@ set_uniform(const char *line, int ubo_array_index)
return;
 }
 
+static GLenum lookup_shader_type(GLuint idx)
+{
+   switch (idx) {
+   case 0:
+   return GL_VERTEX_SHADER;
+   case 1:
+   return GL_FRAGMENT_SHADER;
+   case 2:
+   return GL_GEOMETRY_SHADER;
+   case 3:
+   return GL_TESS_CONTROL_SHADER;
+   case 4:
+   return GL_TESS_EVALUATION_SHADER;
+   case 5:
+   return GL_COMPUTE_SHADER;
+   default:
+   return 0;
+   }
+}
+
+static GLenum get_shader_from_string(const char *name, int *idx)
+{
+   if (string_match(GL_VERTEX_SHADER, name)) {
+   *idx = 0;
+   return GL_VERTEX_SHADER;
+   }
+   if (string_match(GL_FRAGMENT_SHADER, name)) {
+   *idx = 1;
+   return GL_FRAGMENT_SHADER;
+   }
+   if (string_match(GL_GEOMETRY_SHADER, name)) {
+   *idx = 2;
+   return GL_GEOMETRY_SHADER;
+   }
+   if (string_match(GL_TESS_CONTROL_SHADER, name)) {
+   *idx = 3;
+   return GL_TESS_CONTROL_SHADER;
+   }
+   if (string_match(GL_TESS_EVALUATION_SHADER, name)) {
+   *idx = 4;
+   return GL_TESS_EVALUATION_SHADER;
+   }
+   if (string_match(GL_COMPUTE_SHADER, name)) {
+   *idx = 5;
+   return GL_COMPUTE_SHADER;
+   }
+   return 0;
+}
+
+void
+free_subroutine_uniforms(void)
+{
+   int sidx;
+   for (sidx = 0; sidx  4; sidx++)
+   free(subuniform_locations[sidx]);
+}
+
+void
+program_subroutine_uniforms(void)
+{
+   int sidx;
+   int stype;
+
+   for (sidx = 0; sidx  4; sidx++) {
+
+   if (num_subuniform_locations[sidx] == 0)
+   continue;
+
+   stype = lookup_shader_type(sidx);
+   if (!stype)
+   continue;
+
+   glUniformSubroutinesuiv(stype, num_subuniform_locations[sidx], 
subuniform_locations[sidx]);
+   }
+}
+
+void
+set_subroutine_uniform(const char *line)
+{
+   GLuint prog;
+   char name[512];
+   char subname[512];
+   const char *type;
+   GLint loc;
+   GLuint idx;
+   GLenum ptype = 0;
+   int sidx = 0;
+
+   type = eat_whitespace(line);
+   line = eat_text(type);
+
+   line = strcpy_to_space(name, eat_whitespace(line));
+   line = strcpy_to_space(subname, eat_whitespace(line));
+
+   ptype = get_shader_from_string(type, sidx);
+   if (ptype == 0) {
+   printf(illegal type in subroutine uniform\n);
+   piglit_report_result(PIGLIT_FAIL);
+   }
+
+   glGetIntegerv(GL_CURRENT_PROGRAM, (GLint *) prog);
+
+   if (num_subuniform_locations[sidx] == 0) {
+   glGetProgramStageiv(prog, ptype, 
GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS,
+   num_subuniform_locations[sidx]);
+
+   if (num_subuniform_locations[sidx] == 0) {
+   printf(illegal subroutine uniform specified\n);
+   piglit_report_result(PIGLIT_FAIL);
+   }
+
+   subuniform_locations[sidx] = 
calloc(num_subuniform_locations[sidx], sizeof(GLuint));
+   if (!subuniform_locations[sidx

[Piglit] [PATCH] arb_texture_stencil8: add initial texture interface test (v2)

2015-04-07 Thread Dave Airlie
this just checks the basic API works, and that 3D is rejected.

v2: add 1d/2d/cube array support (Anuj)

Signed-off-by: Dave Airlie airl...@redhat.com
---
 tests/spec/CMakeLists.txt |   1 +
 tests/spec/arb_texture_stencil8/CMakeLists.gl.txt |  14 ++
 tests/spec/arb_texture_stencil8/CMakeLists.txt|   1 +
 tests/spec/arb_texture_stencil8/stencil-texture.c | 204 ++
 4 files changed, 220 insertions(+)
 create mode 100644 tests/spec/arb_texture_stencil8/CMakeLists.gl.txt
 create mode 100644 tests/spec/arb_texture_stencil8/CMakeLists.txt
 create mode 100644 tests/spec/arb_texture_stencil8/stencil-texture.c

diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index d921df4..6ccf73d 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -124,3 +124,4 @@ add_subdirectory (oes_texture_float)
 add_subdirectory (arb_direct_state_access)
 add_subdirectory (ext_polygon_offset_clamp)
 add_subdirectory (arb_pipeline_statistics_query)
+add_subdirectory (arb_texture_stencil8)
diff --git a/tests/spec/arb_texture_stencil8/CMakeLists.gl.txt 
b/tests/spec/arb_texture_stencil8/CMakeLists.gl.txt
new file mode 100644
index 000..bd3fadd
--- /dev/null
+++ b/tests/spec/arb_texture_stencil8/CMakeLists.gl.txt
@@ -0,0 +1,14 @@
+include_directories(
+   ${GLEXT_INCLUDE_DIR}
+   ${OPENGL_INCLUDE_PATH}
+)
+
+link_libraries (
+   piglitutil_${piglit_target_api}
+   ${OPENGL_gl_LIBRARY}
+   ${OPENGL_glu_LIBRARY}
+)
+
+piglit_add_executable (arb_texture_stencil8-stencil-texture stencil-texture.c)
+
+# vim: ft=cmake:
diff --git a/tests/spec/arb_texture_stencil8/CMakeLists.txt 
b/tests/spec/arb_texture_stencil8/CMakeLists.txt
new file mode 100644
index 000..144a306
--- /dev/null
+++ b/tests/spec/arb_texture_stencil8/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git a/tests/spec/arb_texture_stencil8/stencil-texture.c 
b/tests/spec/arb_texture_stencil8/stencil-texture.c
new file mode 100644
index 000..8936a91
--- /dev/null
+++ b/tests/spec/arb_texture_stencil8/stencil-texture.c
@@ -0,0 +1,204 @@
+/*
+ * Copyright © 2011 Intel Corporation
+ * Copyright © 2015 Red Hat
+ *
+ * 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 stencil-texture.c
+ * Create a stencil texture.
+ * based on ext_packed_depth_stencil/depth-stencil-texture.c test.
+ */
+
+#include piglit-util-gl.h
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_core_version = 31;
+
+   config.window_visual = PIGLIT_GL_VISUAL_RGBA;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+static bool has_cube_array;
+
+static bool
+try_TexImage(GLenum internalFormat)
+{
+   bool pass = true;
+   GLuint tex[7];
+   unsigned i;
+
+   printf(Testing glTexImage with %s...\n,
+  piglit_get_gl_enum_name(internalFormat));
+
+   glGenTextures(ARRAY_SIZE(tex), tex);
+
+   glBindTexture(GL_TEXTURE_1D, tex[0]);
+   glTexImage1D(GL_TEXTURE_1D, 0, internalFormat,
+16, 0,
+GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, NULL);
+   pass = piglit_check_gl_error(GL_NO_ERROR)  pass;
+
+   glBindTexture(GL_TEXTURE_2D, tex[1]);
+   glTexImage2D(GL_TEXTURE_2D, 0, internalFormat,
+16, 16, 0,
+GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, NULL);
+   pass = piglit_check_gl_error(GL_NO_ERROR)  pass;
+
+   /* 3D texture is not in the list of supported STENCIL_INDEX */
+   glBindTexture(GL_TEXTURE_3D, tex[2]);
+   glTexImage3D(GL_TEXTURE_3D, 0, internalFormat,
+8, 8, 8, 0,
+GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, NULL);
+   pass = piglit_check_gl_error(GL_INVALID_OPERATION)  pass;
+
+   glBindTexture(GL_TEXTURE_CUBE_MAP, tex[3]);
+
+   for (i = 0; i  6; i++) {
+   glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i,
+0

Re: [Piglit] [PATCH 1/3] arb_vertex_attrib_64bit: add simple vertex input fp64 test

2015-04-07 Thread Dave Airlie
On 24 February 2015 at 11:30, Ilia Mirkin imir...@alum.mit.edu wrote:
 On Mon, Feb 23, 2015 at 8:26 PM, Dave Airlie airl...@gmail.com wrote:
 From: Dave Airlie airl...@redhat.com

 This is just a simple 64-bit vertex attrib test.

 Signed-off-by: Dave Airlie airl...@redhat.com
 ---
  .../execution/vs-fp64-input-trunc.shader_test  | 42 
 ++
  1 file changed, 42 insertions(+)
  create mode 100644 
 tests/spec/arb_vertex_attrib_64bit/execution/vs-fp64-input-trunc.shader_test

 diff --git 
 a/tests/spec/arb_vertex_attrib_64bit/execution/vs-fp64-input-trunc.shader_test
  
 b/tests/spec/arb_vertex_attrib_64bit/execution/vs-fp64-input-trunc.shader_test
 new file mode 100644
 index 000..9fb3e4f
 --- /dev/null
 +++ 
 b/tests/spec/arb_vertex_attrib_64bit/execution/vs-fp64-input-trunc.shader_test
 @@ -0,0 +1,42 @@
 +# test truncating a double holds precision
 +[require]
 +GLSL = 1.50
 +GL_ARB_gpu_shader_fp64
 +GL_ARB_vertex_attrib_64bit
 +
 +[vertex shader]
 +#version 150
 +#extension GL_ARB_gpu_shader_fp64 : require
 +#extension GL_ARB_vertex_attrib_64bit : require
 +in dvec4 vertex;
 +void main()
 +{
 +gl_Position = vec4(vertex);
 +}
 +
 +[fragment shader]
 +#version 150
 +#extension GL_ARB_gpu_shader_fp64 : require
 +uniform double arg0;
 +uniform double tolerance;
 +uniform double expected;
 +
 +void main()
 +{
 +  double result = trunc(arg0);
 +  gl_FragColor = distance(result, expected) = tolerance ? vec4(0.0, 1.0, 
 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);

 I think you meant

 gl_FragColor = vec4(0, 1, 0, 1);

 and get rid of all the uniform stuff.

Indeed I did.

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


[Piglit] nvidia fails with -auto was Re: [PATCH] drawpixels-color-index: new test for glDrawPixels(GL_COLOR_INDEX)

2015-04-07 Thread Dave Airlie
On 19 February 2015 at 02:40, Brian Paul bri...@vmware.com wrote:
 To exercise a Mesa failure after the format overhaul.
 Note: this test fails on nvidia if the -auto option is given.

I noticed this on a bunch of tests I was writing, anyone got any idea
when this started,

if I had to guess at something in waffle or piglit changing but I've
no idea what, or maybe nvidia just broke readpixels on their driver
badly.

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


[Piglit] [PATCH 2/2] arb_vertex_attrib_64bit: pass a 64-bit vertex attrib through to frag shader (v2)

2015-04-07 Thread Dave Airlie
From: Dave Airlie airl...@redhat.com

Check the double value unpacks cleanly in the fragment shader.

v2: just use a uniform to check value.

Signed-off-by: Dave Airlie airl...@redhat.com
---
 .../execution/vs-fs-pass-vertex-attrib.shader_test | 50 ++
 1 file changed, 50 insertions(+)
 create mode 100644 
tests/spec/arb_vertex_attrib_64bit/execution/vs-fs-pass-vertex-attrib.shader_test

diff --git 
a/tests/spec/arb_vertex_attrib_64bit/execution/vs-fs-pass-vertex-attrib.shader_test
 
b/tests/spec/arb_vertex_attrib_64bit/execution/vs-fs-pass-vertex-attrib.shader_test
new file mode 100644
index 000..465ec37
--- /dev/null
+++ 
b/tests/spec/arb_vertex_attrib_64bit/execution/vs-fs-pass-vertex-attrib.shader_test
@@ -0,0 +1,50 @@
+# test sending a double vertex attrib
+# through the pipeline unpacks correctly
+#
+[require]
+GLSL = 1.50
+GL_ARB_gpu_shader_fp64
+GL_ARB_vertex_attrib_64bit
+
+[vertex shader]
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : require
+#extension GL_ARB_vertex_attrib_64bit : require
+in dvec2 vertex;
+in double value;
+flat out double val_to_fs;
+void main()
+{
+   gl_Position = vec4(vertex, 0.0, 1.0);
+   val_to_fs = value;
+}
+
+[fragment shader]
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : require
+flat in double val_to_fs;
+uniform double expected;
+out vec4 color;
+
+void main()
+{
+   if (val_to_fs == expected)
+   color = vec4(0.0, 1.0, 0.0, 1.0);
+   else
+   color = vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[vertex data]
+vertex/double/2 value/double/1
+-1.0 -1.0 1.5
+ 1.0 -1.0 1.5
+ 1.0  1.0 1.5
+-1.0  1.0 1.5
+
+[test]
+clear color 0.0 0.0 1.0 0.0
+clear
+uniform double expected 1.5
+draw arrays GL_TRIANGLE_FAN 0 4
+probe rgba 0 0 0.0 1.0 0.0 1.0
+
-- 
2.3.4

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


[Piglit] [PATCH 1/2] arb_vertex_attrib_64bit: add simple vertex input fp64 test

2015-04-07 Thread Dave Airlie
From: Dave Airlie airl...@redhat.com

This just tests a single 64-bit attrib input that is truncated
and used as position.

Signed-off-by: Dave Airlie airl...@redhat.com
---
 .../execution/vs-fp64-input-trunc.shader_test  | 36 ++
 1 file changed, 36 insertions(+)
 create mode 100644 
tests/spec/arb_vertex_attrib_64bit/execution/vs-fp64-input-trunc.shader_test

diff --git 
a/tests/spec/arb_vertex_attrib_64bit/execution/vs-fp64-input-trunc.shader_test 
b/tests/spec/arb_vertex_attrib_64bit/execution/vs-fp64-input-trunc.shader_test
new file mode 100644
index 000..ef77594
--- /dev/null
+++ 
b/tests/spec/arb_vertex_attrib_64bit/execution/vs-fp64-input-trunc.shader_test
@@ -0,0 +1,36 @@
+# test truncating a double holds precision
+[require]
+GLSL = 1.50
+GL_ARB_gpu_shader_fp64
+GL_ARB_vertex_attrib_64bit
+
+[vertex shader]
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : require
+#extension GL_ARB_vertex_attrib_64bit : require
+in dvec4 vertex;
+void main()
+{
+gl_Position = vec4(vertex);
+}
+
+[fragment shader]
+#version 150
+#
+void main()
+{
+  gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+}
+
+[vertex data]
+vertex/double/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0  1.0
+-1.0  1.0
+
+[test]
+clear color 0.0 0.0 1.0 1.0
+clear
+draw arrays GL_TRIANGLE_FAN 0 4
+probe rgba 0 0 0.0 1.0 0.0 1.0
-- 
2.3.4

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


[Piglit] [PATCH 2/3] arb_vertex_attrib_64bit: use a dvec3 input

2015-04-07 Thread Dave Airlie
From: Dave Airlie airl...@redhat.com

This just tests a dvec3 input takes up the correct amount of space.

Signed-off-by: Dave Airlie airl...@redhat.com
---
 .../execution/vs-dvec3-input.shader_test   | 37 ++
 1 file changed, 37 insertions(+)
 create mode 100644 
tests/spec/arb_vertex_attrib_64bit/execution/vs-dvec3-input.shader_test

diff --git 
a/tests/spec/arb_vertex_attrib_64bit/execution/vs-dvec3-input.shader_test 
b/tests/spec/arb_vertex_attrib_64bit/execution/vs-dvec3-input.shader_test
new file mode 100644
index 000..d338c6c
--- /dev/null
+++ b/tests/spec/arb_vertex_attrib_64bit/execution/vs-dvec3-input.shader_test
@@ -0,0 +1,37 @@
+# test truncating a double holds precision
+[require]
+GLSL = 1.50
+GL_ARB_gpu_shader_fp64
+GL_ARB_vertex_attrib_64bit
+
+[vertex shader]
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : require
+#extension GL_ARB_vertex_attrib_64bit : require
+in dvec3 vertex;
+void main()
+{
+gl_Position = vec4(vertex, 1.0);
+}
+
+[fragment shader]
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : require
+
+void main()
+{
+  gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+}
+
+[vertex data]
+vertex/double/3
+-1.0 -1.0 0.0
+ 1.0 -1.0 0.0
+ 1.0  1.0 0.0
+-1.0  1.0 0.0
+
+[test]
+clear color 0.0 0.0 1.0 0.0
+clear
+draw arrays GL_TRIANGLE_FAN 0 4
+probe rgba 0 0 0.0 1.0 0.0 1.0
-- 
2.3.4

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


[Piglit] [PATCH 1/3] arb_vertex_attrib_64bit: exercise the VertexAttribL interfaces

2015-04-07 Thread Dave Airlie
From: Dave Airlie airl...@redhat.com

this just writes attribs and reads the current value back.

Signed-off-by: Dave Airlie airl...@redhat.com
---
 tests/all.py   |   5 +
 tests/spec/CMakeLists.txt  |   1 +
 tests/spec/arb_vertex_attrib_64bit/CMakeLists.txt  |   1 +
 .../execution/CMakeLists.gl.txt|  12 +
 .../execution/CMakeLists.txt   |   1 +
 .../execution/double_attribs.c | 342 +
 6 files changed, 362 insertions(+)
 create mode 100644 tests/spec/arb_vertex_attrib_64bit/CMakeLists.txt
 create mode 100644 
tests/spec/arb_vertex_attrib_64bit/execution/CMakeLists.gl.txt
 create mode 100644 tests/spec/arb_vertex_attrib_64bit/execution/CMakeLists.txt
 create mode 100644 
tests/spec/arb_vertex_attrib_64bit/execution/double_attribs.c

diff --git a/tests/all.py b/tests/all.py
index 7c55548..ab8ecab 100755
--- a/tests/all.py
+++ b/tests/all.py
@@ -4319,5 +4319,10 @@ with profile.group_manager(
 g(['arb_shader_image_load_store-state'], 'state')
 g(['arb_shader_image_load_store-unused'], 'unused')
 
+with profile.group_manager(
+PiglitGLTest,
+grouptools.join('spec', 'arb_vertex_attrib_64bit')) as g:
+g(['arb_vertex_attrib_64bit-double_attribs'], 'double_attribs')
+
 if platform.system() is 'Windows':
 profile.filter_tests(lambda p, _: not p.startswith('glx'))
diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index d921df4..a132e2a 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -124,3 +124,4 @@ add_subdirectory (oes_texture_float)
 add_subdirectory (arb_direct_state_access)
 add_subdirectory (ext_polygon_offset_clamp)
 add_subdirectory (arb_pipeline_statistics_query)
+add_subdirectory (arb_vertex_attrib_64bit)
diff --git a/tests/spec/arb_vertex_attrib_64bit/CMakeLists.txt 
b/tests/spec/arb_vertex_attrib_64bit/CMakeLists.txt
new file mode 100644
index 000..bb76f08
--- /dev/null
+++ b/tests/spec/arb_vertex_attrib_64bit/CMakeLists.txt
@@ -0,0 +1 @@
+add_subdirectory (execution)
diff --git a/tests/spec/arb_vertex_attrib_64bit/execution/CMakeLists.gl.txt 
b/tests/spec/arb_vertex_attrib_64bit/execution/CMakeLists.gl.txt
new file mode 100644
index 000..84fc009
--- /dev/null
+++ b/tests/spec/arb_vertex_attrib_64bit/execution/CMakeLists.gl.txt
@@ -0,0 +1,12 @@
+include_directories(
+   ${GLEXT_INCLUDE_DIR}
+   ${OPENGL_INCLUDE_PATH}
+)
+
+link_libraries (
+   piglitutil_${piglit_target_api}
+   ${OPENGL_gl_LIBRARY}
+   ${OPENGL_glu_LIBRARY}
+)
+
+piglit_add_executable (arb_vertex_attrib_64bit-double_attribs double_attribs.c)
diff --git a/tests/spec/arb_vertex_attrib_64bit/execution/CMakeLists.txt 
b/tests/spec/arb_vertex_attrib_64bit/execution/CMakeLists.txt
new file mode 100644
index 000..4a012b9
--- /dev/null
+++ b/tests/spec/arb_vertex_attrib_64bit/execution/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
\ No newline at end of file
diff --git a/tests/spec/arb_vertex_attrib_64bit/execution/double_attribs.c 
b/tests/spec/arb_vertex_attrib_64bit/execution/double_attribs.c
new file mode 100644
index 000..57d951b
--- /dev/null
+++ b/tests/spec/arb_vertex_attrib_64bit/execution/double_attribs.c
@@ -0,0 +1,342 @@
+/*
+ * Copyright (c) 2010 VMware, Inc.
+ * Copyright (c) 2015 Red Hat Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the Software),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, 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
+ * NON-INFRINGEMENT.  IN NO EVENT SHALL VMWARE AND/OR THEIR SUPPLIERS
+ * 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.
+ */
+
+/**
+ * Test GL_ARB_vertex_attrib_64bit vertex attributes.
+ * derived from Brian's gpu_shader4 tests.
+ */
+
+#include piglit-util-gl.h
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_core_version = 32;
+
+   config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+static const char *TestName = double_attribs;
+static const GLuint Index = 3;
+
+static void
+gen_double_values(GLdouble values[4], GLuint

[Piglit] [PATCH 7/9] arb_clear_buffer_object: add stencil index to invalid formats list.

2015-04-06 Thread Dave Airlie
From: Dave Airlie airl...@redhat.com

Signed-off-by: Dave Airlie airl...@redhat.com
---
 tests/spec/arb_clear_buffer_object/invalid-internal-format.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/spec/arb_clear_buffer_object/invalid-internal-format.c 
b/tests/spec/arb_clear_buffer_object/invalid-internal-format.c
index 8e87c73..06d6288 100644
--- a/tests/spec/arb_clear_buffer_object/invalid-internal-format.c
+++ b/tests/spec/arb_clear_buffer_object/invalid-internal-format.c
@@ -105,6 +105,8 @@ static const struct {
{GL_COMPRESSED_INTENSITY, GL_INTENSITY, GL_UNSIGNED_BYTE},
{GL_COMPRESSED_RGB, GL_RGB, GL_UNSIGNED_BYTE},
{GL_COMPRESSED_RGBA, GL_RGBA, GL_UNSIGNED_BYTE},
+
+   {GL_STENCIL_INDEX8, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE},
 };
 
 
-- 
2.1.0

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


[Piglit] [PATCH 3/9] arb_texture_stencil8: add basic get teximage

2015-04-06 Thread Dave Airlie
This just tests the get tex image path works okay for stencil8 textures.

Signed-off-by: Dave Airlie airl...@redhat.com
---
 tests/spec/arb_texture_stencil8/CMakeLists.gl.txt |  1 +
 tests/spec/arb_texture_stencil8/getteximage.c | 98 +++
 2 files changed, 99 insertions(+)
 create mode 100644 tests/spec/arb_texture_stencil8/getteximage.c

diff --git a/tests/spec/arb_texture_stencil8/CMakeLists.gl.txt 
b/tests/spec/arb_texture_stencil8/CMakeLists.gl.txt
index 65e6c19..4d16073 100644
--- a/tests/spec/arb_texture_stencil8/CMakeLists.gl.txt
+++ b/tests/spec/arb_texture_stencil8/CMakeLists.gl.txt
@@ -11,5 +11,6 @@ link_libraries (
 
 piglit_add_executable (arb_texture_stencil8-stencil-texture stencil-texture.c)
 piglit_add_executable (arb_texture_stencil8-draw draw.c)
+piglit_add_executable (arb_texture_stencil8-getteximage getteximage.c)
 
 # vim: ft=cmake:
diff --git a/tests/spec/arb_texture_stencil8/getteximage.c 
b/tests/spec/arb_texture_stencil8/getteximage.c
new file mode 100644
index 000..09e81de
--- /dev/null
+++ b/tests/spec/arb_texture_stencil8/getteximage.c
@@ -0,0 +1,98 @@
+/*
+ * Copyright © 2014 VMware, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the Software),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/**
+ * \file getteximage.c
+ *
+ * Test glGetTexImage with stencil formats.
+ */
+
+#include piglit-util-gl.h
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+   config.supports_gl_compat_version = 12;
+   config.window_visual = PIGLIT_GL_VISUAL_RGBA;
+PIGLIT_GL_TEST_CONFIG_END
+
+
+#define WIDTH 16
+#define HEIGHT 16
+
+static bool
+test_s8(void)
+{
+   GLubyte tex[WIDTH * HEIGHT];
+   GLubyte buf[WIDTH * HEIGHT];
+   GLuint i;
+
+   /* init tex data */
+   for (i = 0; i  WIDTH * HEIGHT; i++) {
+   GLuint s = 255 - (i  255);
+   tex[i] = s;
+   }
+
+   /* create texture */
+   glTexImage2D(GL_TEXTURE_2D, 0, GL_STENCIL_INDEX8,
+WIDTH, HEIGHT, 0,
+GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, tex);
+   if (!piglit_check_gl_error(GL_NO_ERROR))
+   return false;
+
+   /* read back the texture */
+   glGetTexImage(GL_TEXTURE_2D, 0,
+ GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, buf);
+   if (!piglit_check_gl_error(GL_NO_ERROR))
+   return false;
+
+   /* compare */
+   for (i = 0; i  WIDTH * HEIGHT; i++) {
+   if (buf[i] != tex[i]) {
+   printf(Wrong texel data at position %d: 
+  Expected 0x%08x, found 0x%08x\n,
+  i, tex[i], buf[i]);
+   return false;
+   }
+   }
+
+   return true;
+}
+
+void
+piglit_init(int argc, char **argv)
+{
+   bool pass;
+
+   piglit_require_extension(GL_ARB_texture_stencil8);
+
+   pass = test_s8();
+
+   piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);
+}
+
+
+enum piglit_result
+piglit_display(void)
+{
+   /* unused */
+   return PIGLIT_FAIL;
+}
-- 
2.1.0

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


[Piglit] [PATCH 5/9] fbo-formats: add texture_stencil8 support

2015-04-06 Thread Dave Airlie
From: Dave Airlie airl...@redhat.com

Make sure to disable stencil textures everywhere we disable depth ones.

Signed-off-by: Dave Airlie airl...@redhat.com
---
 tests/fbo/fbo-alphatest-formats.c  |  1 +
 tests/fbo/fbo-blending-formats.c   |  3 ++-
 tests/fbo/fbo-clear-formats.c  |  7 +--
 tests/fbo/fbo-colormask-formats.c  |  3 ++-
 tests/fbo/fbo-formats.h| 11 +++
 tests/fbo/fbo-generatemipmap-formats.c |  6 +++---
 tests/texturing/getteximage-formats.c  |  1 +
 7 files changed, 25 insertions(+), 7 deletions(-)

diff --git a/tests/fbo/fbo-alphatest-formats.c 
b/tests/fbo/fbo-alphatest-formats.c
index cb07f1d..c96245c 100644
--- a/tests/fbo/fbo-alphatest-formats.c
+++ b/tests/fbo/fbo-alphatest-formats.c
@@ -76,6 +76,7 @@ static enum piglit_result test_format(const struct 
format_desc *format)
 
 if (format-base_internal_format == GL_DEPTH_COMPONENT ||
 format-base_internal_format == GL_DEPTH_STENCIL ||
+format-base_internal_format == GL_STENCIL_INDEX ||
format-base_internal_format == GL_ALPHA)
return PIGLIT_SKIP;
 
diff --git a/tests/fbo/fbo-blending-formats.c b/tests/fbo/fbo-blending-formats.c
index 4632944..5eb3d8e 100644
--- a/tests/fbo/fbo-blending-formats.c
+++ b/tests/fbo/fbo-blending-formats.c
@@ -131,7 +131,8 @@ static enum piglit_result test_format(const struct 
format_desc *format)
dst5[3]*(1-src5[3]) + src5[3]*src5[3]};
 
 if (format-base_internal_format == GL_DEPTH_COMPONENT ||
-format-base_internal_format == GL_DEPTH_STENCIL)
+format-base_internal_format == GL_DEPTH_STENCIL ||
+format-base_internal_format == GL_STENCIL_INDEX)
return PIGLIT_SKIP;
 
glGenFramebuffersEXT(1, fb);
diff --git a/tests/fbo/fbo-clear-formats.c b/tests/fbo/fbo-clear-formats.c
index e4413bb..61fb162 100644
--- a/tests/fbo/fbo-clear-formats.c
+++ b/tests/fbo/fbo-clear-formats.c
@@ -273,7 +273,7 @@ create_tex(GLenum internalformat, GLenum baseformat)
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, level);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, level);
 
-   if (clear_stencil) {
+   if (clear_stencil || baseformat == GL_STENCIL_INDEX) {
if (!do_stencil_clear(format, tex, level, dim)) {
glDeleteTextures(1, tex);
return 0;
@@ -522,7 +522,10 @@ test_format(const struct format_desc *format)
 
printf(Testing %s, format-name);
 
-   if (clear_stencil  format-base_internal_format != GL_DEPTH_STENCIL) {
+   if (format-base_internal_format == GL_STENCIL_INDEX)
+   clear_stencil = true;
+
+   if (clear_stencil  format-base_internal_format != GL_DEPTH_STENCIL 
 format-base_internal_format != GL_STENCIL_INDEX) {
printf( - no stencil.\n);
return PIGLIT_SKIP;
}
diff --git a/tests/fbo/fbo-colormask-formats.c 
b/tests/fbo/fbo-colormask-formats.c
index 71e6bff..4227ed0 100644
--- a/tests/fbo/fbo-colormask-formats.c
+++ b/tests/fbo/fbo-colormask-formats.c
@@ -59,7 +59,8 @@ static enum piglit_result test_format(const struct 
format_desc *format)
float defaults[] = {-1, -1, -1, -1};
 
if (format-base_internal_format == GL_DEPTH_COMPONENT ||
-   format-base_internal_format == GL_DEPTH_STENCIL)
+   format-base_internal_format == GL_DEPTH_STENCIL ||
+   format-base_internal_format == GL_STENCIL_INDEX)
return PIGLIT_SKIP;
 
glGenFramebuffersEXT(1, fb);
diff --git a/tests/fbo/fbo-formats.h b/tests/fbo/fbo-formats.h
index 2d44105..655d149 100644
--- a/tests/fbo/fbo-formats.h
+++ b/tests/fbo/fbo-formats.h
@@ -310,6 +310,10 @@ static const struct format_desc arb_es2_compatibility[] = {
FORMAT(GL_RGB565, GL_RGB)
 };
 
+static const struct format_desc arb_texture_stencil8[] = {
+   FORMAT(GL_STENCIL_INDEX8, GL_STENCIL_INDEX)
+};
+
 struct test_desc {
const struct format_desc *format;
unsigned num_formats;
@@ -499,6 +503,13 @@ static const struct test_desc test_sets[] = {
GL_FLOAT,
{GL_ARB_texture_compression_bptc}
},
+   {
+   arb_texture_stencil8,
+   ARRAY_SIZE(arb_texture_stencil8),
+   GL_ARB_texture_stencil8,
+   GL_UNSIGNED_BYTE,
+   {GL_ARB_texture_stencil8}
+   },
 };
 
 static GLboolean
diff --git a/tests/fbo/fbo-generatemipmap-formats.c 
b/tests/fbo/fbo-generatemipmap-formats.c
index f054453..f5dd0b3 100644
--- a/tests/fbo/fbo-generatemipmap-formats.c
+++ b/tests/fbo/fbo-generatemipmap-formats.c
@@ -488,7 +488,7 @@ piglit_display(void)
/* Skip testing textures with depth-stencil internal
 * formats as they are not allowed in glGenerateMipmap

[Piglit] [PATCH 1/9] arb_texture_stencil8: add initial texture interface test

2015-04-06 Thread Dave Airlie
this just checks the basic API works, and that 3D is rejected.

Signed-off-by: Dave Airlie airl...@redhat.com
---
 tests/spec/CMakeLists.txt |   1 +
 tests/spec/arb_texture_stencil8/CMakeLists.gl.txt |  14 ++
 tests/spec/arb_texture_stencil8/CMakeLists.txt|   1 +
 tests/spec/arb_texture_stencil8/stencil-texture.c | 158 ++
 4 files changed, 174 insertions(+)
 create mode 100644 tests/spec/arb_texture_stencil8/CMakeLists.gl.txt
 create mode 100644 tests/spec/arb_texture_stencil8/CMakeLists.txt
 create mode 100644 tests/spec/arb_texture_stencil8/stencil-texture.c

diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index d921df4..6ccf73d 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -124,3 +124,4 @@ add_subdirectory (oes_texture_float)
 add_subdirectory (arb_direct_state_access)
 add_subdirectory (ext_polygon_offset_clamp)
 add_subdirectory (arb_pipeline_statistics_query)
+add_subdirectory (arb_texture_stencil8)
diff --git a/tests/spec/arb_texture_stencil8/CMakeLists.gl.txt 
b/tests/spec/arb_texture_stencil8/CMakeLists.gl.txt
new file mode 100644
index 000..bd3fadd
--- /dev/null
+++ b/tests/spec/arb_texture_stencil8/CMakeLists.gl.txt
@@ -0,0 +1,14 @@
+include_directories(
+   ${GLEXT_INCLUDE_DIR}
+   ${OPENGL_INCLUDE_PATH}
+)
+
+link_libraries (
+   piglitutil_${piglit_target_api}
+   ${OPENGL_gl_LIBRARY}
+   ${OPENGL_glu_LIBRARY}
+)
+
+piglit_add_executable (arb_texture_stencil8-stencil-texture stencil-texture.c)
+
+# vim: ft=cmake:
diff --git a/tests/spec/arb_texture_stencil8/CMakeLists.txt 
b/tests/spec/arb_texture_stencil8/CMakeLists.txt
new file mode 100644
index 000..144a306
--- /dev/null
+++ b/tests/spec/arb_texture_stencil8/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git a/tests/spec/arb_texture_stencil8/stencil-texture.c 
b/tests/spec/arb_texture_stencil8/stencil-texture.c
new file mode 100644
index 000..f58f67a
--- /dev/null
+++ b/tests/spec/arb_texture_stencil8/stencil-texture.c
@@ -0,0 +1,158 @@
+/*
+ * Copyright © 2011 Intel Corporation
+ * Copyright © 2015 Red Hat
+ *
+ * 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 stencil-texture.c
+ * Create a stencil texture.
+ * based on ext_packed_depth_stencil/depth-stencil-texture.c test.
+ */
+
+#include piglit-util-gl.h
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_compat_version = 12;
+   config.supports_gl_core_version = 31;
+
+   config.window_visual = PIGLIT_GL_VISUAL_RGBA;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+static bool
+try_TexImage(GLenum internalFormat)
+{
+   bool pass = true;
+   GLuint tex[4];
+   unsigned i;
+
+   printf(Testing glTexImage with %s...\n,
+  piglit_get_gl_enum_name(internalFormat));
+
+   glGenTextures(ARRAY_SIZE(tex), tex);
+
+   glBindTexture(GL_TEXTURE_1D, tex[0]);
+   glTexImage1D(GL_TEXTURE_1D, 0, internalFormat,
+16, 0,
+GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, NULL);
+   pass = piglit_check_gl_error(GL_NO_ERROR)  pass;
+
+   glBindTexture(GL_TEXTURE_2D, tex[1]);
+   glTexImage2D(GL_TEXTURE_2D, 0, internalFormat,
+16, 16, 0,
+GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, NULL);
+   pass = piglit_check_gl_error(GL_NO_ERROR)  pass;
+
+   /* 3D texture is not in the list of supported STENCIL_INDEX */
+   glBindTexture(GL_TEXTURE_3D, tex[2]);
+   glTexImage3D(GL_TEXTURE_3D, 0, internalFormat,
+8, 8, 8, 0,
+GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, NULL);
+   pass = piglit_check_gl_error(GL_INVALID_OPERATION)  pass;
+
+   glBindTexture(GL_TEXTURE_CUBE_MAP, tex[3]);
+
+   for (i = 0; i  6; i++) {
+   glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i,
+0, internalFormat

[Piglit] [PATCH 8/9] texwrap: add GL_ARB_texture_stencil8 support

2015-04-06 Thread Dave Airlie
From: Dave Airlie airl...@redhat.com

Signed-off-by: Dave Airlie airl...@redhat.com
---
 tests/texturing/texwrap.c | 14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/tests/texturing/texwrap.c b/tests/texturing/texwrap.c
index 88afe4e..7be19a5 100644
--- a/tests/texturing/texwrap.c
+++ b/tests/texturing/texwrap.c
@@ -349,6 +349,11 @@ static const struct format_desc arb_texture_rgb10_a2ui[] = 
{
{FORMAT(GL_RGB10_A2UI),   10, 10, 10, 2, 0, 0, 0, 0,  0, 0, 
UINT_TYPE},
 };
 
+static const struct format_desc arb_texture_stencil8[] = {
+   {FORMAT(GL_STENCIL_INDEX8),  0, 0, 0, 0, 0, 0, 0, 8, 0, 0,  UINT_TYPE},
+};
+
+
 static const struct test_desc test_sets[] = {
{
core,
@@ -486,6 +491,12 @@ static const struct test_desc test_sets[] = {
GL_ARB_ES2_compatibility,
{GL_ARB_ES2_compatibility}
},
+   {
+   arb_texture_stencil8,
+   ARRAY_SIZE(arb_texture_stencil8),
+   GL_ARB_texture_stencil8,
+   {GL_ARB_texture_stencil8}
+   },
 
{NULL}
 };
@@ -1486,6 +1497,7 @@ static void init_texture(const struct format_desc 
*format, GLboolean npot)
 {
int x, y, z;
GLenum baseformat = format-depth ? (format-stencil ? GL_DEPTH_STENCIL 
: GL_DEPTH_COMPONENT) :
+   format-stencil ? GL_STENCIL_INDEX :
format-type == FLOAT_TYPE ? GL_RGBA : 
GL_RGBA_INTEGER;
GLenum type = format-internalformat == GL_DEPTH24_STENCIL8 ? 
GL_UNSIGNED_INT_24_8 :
  format-internalformat == GL_DEPTH32F_STENCIL8 ? 
GL_FLOAT_32_UNSIGNED_INT_24_8_REV :
@@ -1516,7 +1528,7 @@ static void init_texture(const struct format_desc 
*format, GLboolean npot)
}
 
/* Convert to one-channel texture. Not nice, but easy. */
-   if (format-depth) {
+   if (format-depth || format-stencil) {
for (x = 1; x  size_z*size_y*size_x; x++) {
image[x] = image[x*4];
}
-- 
2.1.0

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


Re: [Piglit] [PATCH] generator: clear before rendering with the builtin tests

2015-04-05 Thread Dave Airlie
On 27 March 2015 at 12:18, Ilia Mirkin imir...@alum.mit.edu wrote:
 Can we just make shader_runner do a clear automatically? This has
 happened to me a number of times.

I'm not sure we should do that though, I don't really like the idea of shader
runner doing an implicit behavioural change,

but anyone else have an opinion?

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


  1   2   >