Re: [Piglit] Vulkan headers dependency

2020-05-05 Thread Lionel Landwerlin

Maybe embedding them like we do in Mesa?

-Lionel

On 05/05/2020 17:40, Jose Fonseca wrote:
Could we please make Vulkan headers an optional dependency?  It would 
simplify building and running piglit on Windows.



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


Re: [Piglit] [PATCH] EGL_EXT_image_dma_buf_import: add YUYV format support

2019-02-27 Thread Lionel Landwerlin

On 22/02/2019 12:42, Christian Gmeiner wrote:

Signed-off-by: Christian Gmeiner 
---
  tests/opengl.py |  2 ++
  tests/spec/ext_image_dma_buf_import/sample_yuv.c| 13 +
  tests/util/piglit-framework-gl/piglit_drm_dma_buf.c |  2 ++
  3 files changed, 17 insertions(+)

diff --git a/tests/opengl.py b/tests/opengl.py
index d6cfa0986..685ffae62 100644
--- a/tests/opengl.py
+++ b/tests/opengl.py
@@ -3043,6 +3043,8 @@ with profile.test_list.group_manager(
'ext_image_dma_buf_import-sample_p012', run_concurrent=False)
  g(['ext_image_dma_buf_import-sample_yuv', '-fmt=P016'],
'ext_image_dma_buf_import-sample_p016', run_concurrent=False)
+g(['ext_image_dma_buf_import-sample_yuv', '-fmt=YUYV'],
+  'ext_image_dma_buf_import-sample_yuyv', run_concurrent=False)
  g(['ext_image_dma_buf_import-transcode-nv12-as-r8-gr88'],
'ext_image_dma_buf_import-transcode-nv12-as-r8-gr88',
run_concurrent=False)
diff --git a/tests/spec/ext_image_dma_buf_import/sample_yuv.c 
b/tests/spec/ext_image_dma_buf_import/sample_yuv.c
index faa4c300c..f33317af0 100644
--- a/tests/spec/ext_image_dma_buf_import/sample_yuv.c
+++ b/tests/spec/ext_image_dma_buf_import/sample_yuv.c
@@ -143,6 +143,16 @@ piglit_display(void)
160, 127,  70, 64,
160, 133,  90, 128,
160, 140, 110, 192,
+   }, yuyv[] = {
+   /* YUYV */
+   0x32, 0x78, 0x46, 0x82,
+   0x59, 0x8C, 0x6E, 0x82,
+   0x32, 0x78, 0x46, 0x82,
+   0x59, 0x8C, 0x6E, 0x82,
+   0x32, 0x79, 0x46, 0xA1,
+   0x5A, 0x8C, 0x6E, 0xA0,
+   0x32, 0x79, 0x46, 0xA1,
+   0x5A, 0x8C, 0x6E, 0xA0,



In the interest of consistency, could we keep using base 10 values?



};
  
  	static unsigned char expected[4 * 4 * 4] = {

@@ -193,6 +203,9 @@ piglit_display(void)
case DRM_FORMAT_XYUV:
t = ayuv;
break;
+   case DRM_FORMAT_YUYV:
+   t = yuyv;
+   break;
default:
return PIGLIT_SKIP;
}
diff --git a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c 
b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
index 07e6cc219..15cba375c 100644
--- a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
+++ b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
@@ -144,6 +144,7 @@ piglit_intel_buf_create(unsigned w, unsigned h, unsigned 
fourcc,
break;
case DRM_FORMAT_GR88:
case DRM_FORMAT_RG88:
+   case DRM_FORMAT_YUYV:
cpp = 2;
break;
case DRM_FORMAT_XRGB:
@@ -279,6 +280,7 @@ piglit_gbm_buf_create(unsigned w, unsigned h, unsigned 
fourcc,
break;
case DRM_FORMAT_GR88:
case DRM_FORMAT_RG88:
+   case DRM_FORMAT_YUYV:
format = GBM_FORMAT_GR88;
cpp = 2;
src_stride = cpp * w;


I just realized that although this test passes on our HW, it's probably 
because the image is small enough.


We have a HW limitation that makes it impossible to have 2 different 
views at the same time on a give buffer.



I suppose this only starts showing up at higher resolutions (I recall 
having issues on 32x32 images).



With the value changed, this is : Reviewed-by: Lionel Landwerlin 




-Lionel

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

Re: [Piglit] [PATCH 1/3] arb_enhanced_layouts: don't call glLinkProgram twice

2019-02-20 Thread Lionel Landwerlin

On 20/02/2019 16:06, Alejandro Piñeiro wrote:

GLSL codepath uses piglit_build_simple_program_multiple_shaders, that
already calls glLinkProgram.

Minor thing, but makes debug the test more easy.



Reviewed-by: Lionel Landwerlin 



---
  .../transform-feedback-layout-qualifiers.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/tests/spec/arb_enhanced_layouts/transform-feedback-layout-qualifiers.c 
b/tests/spec/arb_enhanced_layouts/transform-feedback-layout-qualifiers.c
index 709df75f8..f2a558e34 100644
--- a/tests/spec/arb_enhanced_layouts/transform-feedback-layout-qualifiers.c
+++ b/tests/spec/arb_enhanced_layouts/transform-feedback-layout-qualifiers.c
@@ -131,6 +131,8 @@ compile_spirv_program(GLenum shader_type,
glAttachShader(prog, shader);
glDeleteShader(shader);
  
+	glLinkProgram(prog);

+
return prog;
  }
  
@@ -187,7 +189,6 @@ build_and_use_program(const struct test_config *config)

free(gs_text);
}
  
-	glLinkProgram(prog);

if (!piglit_link_check_status(prog))
piglit_report_result(PIGLIT_FAIL);
if (!piglit_check_gl_error(GL_NO_ERROR))



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

Re: [Piglit] [PATCH v2] primitive-restart: extend the test to catch regressions of bug-109451

2019-02-18 Thread Lionel Landwerlin

Pushed.

On 18/02/2019 14:05, andrey simiklit wrote:

Yes, it would be great.

Thanks,
Andrii.

On Mon, Feb 18, 2019 at 4:03 PM Lionel Landwerlin 
mailto:lionel.g.landwer...@intel.com>> 
wrote:


Do you need me to push this change?

-Lionel

On 18/02/2019 14:00, asimiklit.w...@gmail.com
<mailto:asimiklit.w...@gmail.com> wrote:
> From: Andrii Simiklit mailto:andrii.simik...@globallogic.com>>
>
> Looks like this test should be able to catch this kind of the
regressions
> os I add it here.
> This test should draw green rectangle if everything is ok.
> But in case of bug which makes us unable to disable
> the primitive restart option it should draw just one triangle.
>
> The solution was suggested.
>
> v2: Added the link to the bug in the comment of the new function
>      ( Lionel Landwerlin mailto:lionel.g.landwer...@intel.com>> )
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109451
> Reviewed-by: Lionel Landwerlin mailto:lionel.g.landwer...@intel.com>>
> Signed-off-by: Andrii Simiklit mailto:andrii.simik...@globallogic.com>>
> ---
>   tests/general/primitive-restart.c | 73
+++
>   1 file changed, 73 insertions(+)
>
> diff --git a/tests/general/primitive-restart.c
b/tests/general/primitive-restart.c
> index 4219a6c5b..941540451 100644
> --- a/tests/general/primitive-restart.c
> +++ b/tests/general/primitive-restart.c
> @@ -75,6 +75,11 @@ static bool Have_31;
>   static bool TestGL31;
>
>
> +static void
> +enable_restart(GLuint restart_index);
> +static void
> +disable_restart(void);
> +
>   static bool
>   check_rendering(void)
>   {
> @@ -184,6 +189,72 @@ test_begin_end(GLenum primMode)
>      return pass;
>   }
>
> +static void
> +write_vec2_value(GLfloat * verts, GLuint vidx, GLfloat x,
GLfloat y)
> +{
> +   verts[(vidx * 2) + 0] = x;
> +   verts[(vidx * 2) + 1] = y;
> +}
> +/* This test should draw green rectangle if everything is ok.
> + * But in case of bug which makes us unable to disable
> + * the primitive restart option it should draw just one triangle.
> + * Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109451
> + */
> +static bool
> +test_shared_ib_restart()
> +{
> +   bool pass = true;
> +   GLfloat verts[256 * 2];
> +   memset(&verts, 0, sizeof(verts));
> +   //left-bottom
> +   write_vec2_value(verts, 0, 0.0f, 0.0f);
> +   //right-bottom
> +   write_vec2_value(verts, 1, piglit_width, 0.0f);
> +   //left-top
> +   write_vec2_value(verts, 2, 0.0f, piglit_height);
> +   //right-top
> +   write_vec2_value(verts, 255, piglit_width, piglit_height);
> +
> +   const GLubyte indices[] = { 0, 1, 2, 255, 0 };
> +   const GLfloat expected[3] = { 0.0f, 1.0f, 0.0f };
> +   GLuint vbo1, vbo2;
> +
> +   piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
> +
> +   glClear(GL_COLOR_BUFFER_BIT);
> +
> +   glColor4fv(green);
> +
> +   glGenBuffers(1, &vbo1);
> +   glBindBuffer(GL_ARRAY_BUFFER, vbo1);
> +   glBufferData(GL_ARRAY_BUFFER, sizeof(verts), verts,
GL_DYNAMIC_DRAW);
> +   glVertexPointer(2, GL_FLOAT, 0, (void *)0);
> +
> +   glGenBuffers(1, &vbo2);
> +   glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vbo2);
> +   glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indices),
indices, GL_STATIC_DRAW);
> +   glEnableClientState(GL_VERTEX_ARRAY);
> +
> +   //We should draw something with an enabled restart option to
check that
> +   //it could be correctly disabled
> +   enable_restart(0xff);
> +   glDrawElements(GL_LINE_STRIP, ARRAY_SIZE(indices),
GL_UNSIGNED_BYTE, (void*)0);
> +   disable_restart();
> +
> +   //Draw full screen rectangle
> +   glDrawElements(GL_TRIANGLE_STRIP, ARRAY_SIZE(indices) - 1,
GL_UNSIGNED_BYTE, (void*)0);
> +
> +   glDisableClientState(GL_VERTEX_ARRAY);
> +   glBindBuffer(GL_ARRAY_BUFFER, 0);
> +   glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
> +   glDeleteBuffers(1, &vbo1);
> +   glDeleteBuffers(1, &vbo2);
> +   glFinish();
> +   pass = (piglit_probe_rect_rgb(0, 0, piglit_width,
piglit_height, expected) != 0) && pass;
> +   piglit_present_results();
> +   return pass;
> +}
> +
>
>   static void
>   enable_restart(GLuint restart_index)
> @@ -503,6 +574,7 @@ pr

Re: [Piglit] [PATCH v2] primitive-restart: extend the test to catch regressions of bug-109451

2019-02-18 Thread Lionel Landwerlin

Do you need me to push this change?

-Lionel

On 18/02/2019 14:00, asimiklit.w...@gmail.com wrote:

From: Andrii Simiklit 

Looks like this test should be able to catch this kind of the regressions
os I add it here.
This test should draw green rectangle if everything is ok.
But in case of bug which makes us unable to disable
the primitive restart option it should draw just one triangle.

The solution was suggested.

v2: Added the link to the bug in the comment of the new function
 ( Lionel Landwerlin  )

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109451
Reviewed-by: Lionel Landwerlin 
Signed-off-by: Andrii Simiklit 
---
  tests/general/primitive-restart.c | 73 +++
  1 file changed, 73 insertions(+)

diff --git a/tests/general/primitive-restart.c 
b/tests/general/primitive-restart.c
index 4219a6c5b..941540451 100644
--- a/tests/general/primitive-restart.c
+++ b/tests/general/primitive-restart.c
@@ -75,6 +75,11 @@ static bool Have_31;
  static bool TestGL31;
  
  
+static void

+enable_restart(GLuint restart_index);
+static void
+disable_restart(void);
+
  static bool
  check_rendering(void)
  {
@@ -184,6 +189,72 @@ test_begin_end(GLenum primMode)
 return pass;
  }
  
+static void

+write_vec2_value(GLfloat * verts, GLuint vidx, GLfloat x, GLfloat y)
+{
+   verts[(vidx * 2) + 0] = x;
+   verts[(vidx * 2) + 1] = y;
+}
+/* This test should draw green rectangle if everything is ok.
+ * But in case of bug which makes us unable to disable
+ * the primitive restart option it should draw just one triangle.
+ * Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109451
+ */
+static bool
+test_shared_ib_restart()
+{
+   bool pass = true;
+   GLfloat verts[256 * 2];
+   memset(&verts, 0, sizeof(verts));
+   //left-bottom
+   write_vec2_value(verts, 0, 0.0f, 0.0f);
+   //right-bottom
+   write_vec2_value(verts, 1, piglit_width, 0.0f);
+   //left-top
+   write_vec2_value(verts, 2, 0.0f, piglit_height);
+   //right-top
+   write_vec2_value(verts, 255, piglit_width, piglit_height);
+
+   const GLubyte indices[] = { 0, 1, 2, 255, 0 };
+   const GLfloat expected[3] = { 0.0f, 1.0f, 0.0f };
+   GLuint vbo1, vbo2;
+
+   piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
+
+   glClear(GL_COLOR_BUFFER_BIT);
+
+   glColor4fv(green);
+
+   glGenBuffers(1, &vbo1);
+   glBindBuffer(GL_ARRAY_BUFFER, vbo1);
+   glBufferData(GL_ARRAY_BUFFER, sizeof(verts), verts, GL_DYNAMIC_DRAW);
+   glVertexPointer(2, GL_FLOAT, 0, (void *)0);
+
+   glGenBuffers(1, &vbo2);
+   glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vbo2);
+   glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indices), indices, 
GL_STATIC_DRAW);
+   glEnableClientState(GL_VERTEX_ARRAY);
+
+   //We should draw something with an enabled restart option to check that
+   //it could be correctly disabled
+   enable_restart(0xff);
+   glDrawElements(GL_LINE_STRIP, ARRAY_SIZE(indices), GL_UNSIGNED_BYTE, 
(void*)0);
+   disable_restart();
+
+   //Draw full screen rectangle
+   glDrawElements(GL_TRIANGLE_STRIP, ARRAY_SIZE(indices) - 1, 
GL_UNSIGNED_BYTE, (void*)0);
+
+   glDisableClientState(GL_VERTEX_ARRAY);
+   glBindBuffer(GL_ARRAY_BUFFER, 0);
+   glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
+   glDeleteBuffers(1, &vbo1);
+   glDeleteBuffers(1, &vbo2);
+   glFinish();
+   pass = (piglit_probe_rect_rgb(0, 0, piglit_width, piglit_height, expected) != 0) 
&& pass;
+   piglit_present_results();
+   return pass;
+}
+
  
  static void

  enable_restart(GLuint restart_index)
@@ -503,6 +574,7 @@ primitive_restart_test(VBO_CFG vbo_cfg)
  
 if (Have_NV) {

TestGL31 = false;
+  pass = test_shared_ib_restart() && pass;
pass = test_begin_end(GL_TRIANGLE_STRIP) && pass;
pass = test_begin_end(GL_LINE_STRIP) && pass;
pass = test_draw_elements(vbo_cfg, GL_TRIANGLE_STRIP, GL_UNSIGNED_BYTE) 
&& pass;
@@ -521,6 +593,7 @@ primitive_restart_test(VBO_CFG vbo_cfg)
  
 if (Have_31) {

TestGL31 = true;
+  pass = test_shared_ib_restart() && pass;
pass = test_draw_elements(vbo_cfg, GL_TRIANGLE_STRIP, GL_UNSIGNED_BYTE) 
&& pass;
pass = test_draw_elements(vbo_cfg, GL_TRIANGLE_STRIP, GL_UNSIGNED_SHORT) 
&& pass;
pass = test_draw_elements(vbo_cfg, GL_TRIANGLE_STRIP, GL_UNSIGNED_INT) 
&& pass;



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

Re: [Piglit] [PATCH] primitive-restart: extend the test to catch regressions of bug-109451

2019-02-18 Thread Lionel Landwerlin

On 01/02/2019 09:27, asimiklit.w...@gmail.com wrote:

From: Andrii Simiklit 

Looks like this test should be able to catch this kind of the regressions
os I add it here.
This test should draw green rectangle if everything is ok.
But in case of bug which makes us unable to disable
the primitive restart option it should draw just one triangle.

The possible solution was suggested.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109451
Signed-off-by: Andrii Simiklit 



Looks correct to me and catches our i965 issue. Maybe you could add the 
link to the bug in the comment of the new function.



Reviewed-by: Lionel Landwerlin 



---
  tests/general/primitive-restart.c | 72 +++
  1 file changed, 72 insertions(+)

diff --git a/tests/general/primitive-restart.c 
b/tests/general/primitive-restart.c
index 4219a6c5b..aef9bed41 100644
--- a/tests/general/primitive-restart.c
+++ b/tests/general/primitive-restart.c
@@ -75,6 +75,11 @@ static bool Have_31;
  static bool TestGL31;
  
  
+static void

+enable_restart(GLuint restart_index);
+static void
+disable_restart(void);
+
  static bool
  check_rendering(void)
  {
@@ -184,6 +189,71 @@ test_begin_end(GLenum primMode)
 return pass;
  }
  
+static void

+write_vec2_value(GLfloat * verts, GLuint vidx, GLfloat x, GLfloat y)
+{
+   verts[(vidx * 2) + 0] = x;
+   verts[(vidx * 2) + 1] = y;
+}
+/* This test should draw green rectangle if everything is ok.
+ * But in case of bug which makes us unable to disable
+ * the primitive restart option it should draw just one triangle.
+ */
+static bool
+test_shared_ib_restart()
+{
+   bool pass = true;
+   GLfloat verts[256 * 2];
+   memset(&verts, 0, sizeof(verts));
+   //left-bottom
+   write_vec2_value(verts, 0, 0.0f, 0.0f);
+   //right-bottom
+   write_vec2_value(verts, 1, piglit_width, 0.0f);
+   //left-top
+   write_vec2_value(verts, 2, 0.0f, piglit_height);
+   //right-top
+   write_vec2_value(verts, 255, piglit_width, piglit_height);
+
+   const GLubyte indices[] = { 0, 1, 2, 255, 0 };
+   const GLfloat expected[3] = { 0.0f, 1.0f, 0.0f };
+   GLuint vbo1, vbo2;
+
+   piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
+
+   glClear(GL_COLOR_BUFFER_BIT);
+
+   glColor4fv(green);
+
+   glGenBuffers(1, &vbo1);
+   glBindBuffer(GL_ARRAY_BUFFER, vbo1);
+   glBufferData(GL_ARRAY_BUFFER, sizeof(verts), verts, GL_DYNAMIC_DRAW);
+   glVertexPointer(2, GL_FLOAT, 0, (void *)0);
+
+   glGenBuffers(1, &vbo2);
+   glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vbo2);
+   glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indices), indices, 
GL_STATIC_DRAW);
+   glEnableClientState(GL_VERTEX_ARRAY);
+
+   //We should draw something with an enabled restart option to check that
+   //it could be correctly disabled
+   enable_restart(0xff);
+   glDrawElements(GL_LINE_STRIP, ARRAY_SIZE(indices), GL_UNSIGNED_BYTE, 
(void*)0);
+   disable_restart();
+
+   //Draw full screen rectangle
+   glDrawElements(GL_TRIANGLE_STRIP, ARRAY_SIZE(indices) - 1, 
GL_UNSIGNED_BYTE, (void*)0);
+
+   glDisableClientState(GL_VERTEX_ARRAY);
+   glBindBuffer(GL_ARRAY_BUFFER, 0);
+   glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
+   glDeleteBuffers(1, &vbo1);
+   glDeleteBuffers(1, &vbo2);
+   glFinish();
+   pass = (piglit_probe_rect_rgb(0, 0, piglit_width, piglit_height, expected) != 0) 
&& pass;
+   piglit_present_results();
+   return pass;
+}
+
  
  static void

  enable_restart(GLuint restart_index)
@@ -503,6 +573,7 @@ primitive_restart_test(VBO_CFG vbo_cfg)
  
 if (Have_NV) {

TestGL31 = false;
+  pass = test_shared_ib_restart() && pass;
pass = test_begin_end(GL_TRIANGLE_STRIP) && pass;
pass = test_begin_end(GL_LINE_STRIP) && pass;
pass = test_draw_elements(vbo_cfg, GL_TRIANGLE_STRIP, GL_UNSIGNED_BYTE) 
&& pass;
@@ -521,6 +592,7 @@ primitive_restart_test(VBO_CFG vbo_cfg)
  
 if (Have_31) {

TestGL31 = true;
+  pass = test_shared_ib_restart() && pass;
pass = test_draw_elements(vbo_cfg, GL_TRIANGLE_STRIP, GL_UNSIGNED_BYTE) 
&& pass;
pass = test_draw_elements(vbo_cfg, GL_TRIANGLE_STRIP, GL_UNSIGNED_SHORT) 
&& pass;
pass = test_draw_elements(vbo_cfg, GL_TRIANGLE_STRIP, GL_UNSIGNED_INT) 
&& pass;



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

Re: [Piglit] [PATCH] EGL_EXT_image_dma_buf_import: add support for XYUV format

2019-02-16 Thread Lionel Landwerlin

On 16/02/2019 01:43, Vivek Kasireddy wrote:

This format is similar to AYUV except that the alpha channel
is ignored.

Cc: Tapani Palli 
Cc: Lionel Landwerlin 

Signed-off-by: Vivek Kasireddy 



Reviewed-by: Lionel Landwerlin 



---
  tests/opengl.py | 2 ++
  tests/spec/ext_image_dma_buf_import/sample_yuv.c| 1 +
  tests/util/piglit-framework-gl/piglit_drm_dma_buf.c | 1 +
  tests/util/piglit-framework-gl/piglit_drm_dma_buf.h | 4 
  4 files changed, 8 insertions(+)

diff --git a/tests/opengl.py b/tests/opengl.py
index 83f980177..e91056408 100644
--- a/tests/opengl.py
+++ b/tests/opengl.py
@@ -3035,6 +3035,8 @@ with profile.test_list.group_manager(
'ext_image_dma_buf_import-sample_yvu420', run_concurrent=False)
  g(['ext_image_dma_buf_import-sample_yuv', '-fmt=AYUV'],
'ext_image_dma_buf_import-sample_ayuv', run_concurrent=False)
+g(['ext_image_dma_buf_import-sample_yuv', '-fmt=XYUV'],
+  'ext_image_dma_buf_import-sample_xyuv', run_concurrent=False)
  g(['ext_image_dma_buf_import-sample_yuv', '-fmt=P010'],
'ext_image_dma_buf_import-sample_p010', run_concurrent=False)
  g(['ext_image_dma_buf_import-sample_yuv', '-fmt=P012'],
diff --git a/tests/spec/ext_image_dma_buf_import/sample_yuv.c 
b/tests/spec/ext_image_dma_buf_import/sample_yuv.c
index c7b4edfc0..faa4c300c 100644
--- a/tests/spec/ext_image_dma_buf_import/sample_yuv.c
+++ b/tests/spec/ext_image_dma_buf_import/sample_yuv.c
@@ -190,6 +190,7 @@ piglit_display(void)
t = yvu420;
break;
case DRM_FORMAT_AYUV:
+   case DRM_FORMAT_XYUV:
t = ayuv;
break;
default:
diff --git a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c 
b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
index 8beafad77..07e6cc219 100644
--- a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
+++ b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
@@ -155,6 +155,7 @@ piglit_intel_buf_create(unsigned w, unsigned h, unsigned 
fourcc,
case DRM_FORMAT_RGBA:
case DRM_FORMAT_BGRA:
case DRM_FORMAT_AYUV:
+   case DRM_FORMAT_XYUV:
cpp = 4;
break;
case DRM_FORMAT_NV12:
diff --git a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.h 
b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.h
index 9f59bf7da..86c45b368 100644
--- a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.h
+++ b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.h
@@ -52,6 +52,10 @@
  #define DRM_FORMAT_P016 fourcc_code('P', '0', '1', '6') /* 2x2 subsampled 
Cb:Cr plane 16 bits per channel */
  #endif
  
+#ifndef DRM_FORMAT_XYUV

+#define DRM_FORMAT_XYUV fourcc_code('X', 'Y', 'U', 'V') /* 8 bits per 
channel and no subsampling */
+#endif
+
  /* added in libdrm 2.4.95 */
  #ifndef DRM_FORMAT_INVALID
  #define DRM_FORMAT_INVALID 0



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

[Piglit] [PATCH] tests/shaders/bug-109601: drop ARB_shader_storage_buffer_object requirement

2019-02-15 Thread Lionel Landwerlin
We're failing this test on Sandybridge because we're requiring an
extension that isn't necessary. This is a leftover from a previous
iteration of the test.

Signed-off-by: Lionel Landwerlin 
Reported-by: Mark Janes 
Fixes: ffb5627758eb77 ("shaders: Reproduce a bug in the i965/anv backend 
compiler")
---
 tests/shaders/glsl-bug-109601.shader_test | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tests/shaders/glsl-bug-109601.shader_test 
b/tests/shaders/glsl-bug-109601.shader_test
index c060233e9..0e39e03d2 100644
--- a/tests/shaders/glsl-bug-109601.shader_test
+++ b/tests/shaders/glsl-bug-109601.shader_test
@@ -6,7 +6,6 @@ GLSL >= 3.30
 
 [fragment shader]
 #version 330
-#extension GL_ARB_shader_storage_buffer_object: require
 
 uniform int v1;
 uniform float v2;
-- 
2.20.1

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

[Piglit] [PATCH] shaders: Reproduce a bug in the i965/anv backend compiler

2019-02-14 Thread Lionel Landwerlin
We were dropping negations/abs while trying to optimize.

Signed-off-by: Lionel Landwerlin 
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109601
---
 tests/shaders/glsl-bug-109601.shader_test | 28 +++
 1 file changed, 28 insertions(+)
 create mode 100644 tests/shaders/glsl-bug-109601.shader_test

diff --git a/tests/shaders/glsl-bug-109601.shader_test 
b/tests/shaders/glsl-bug-109601.shader_test
new file mode 100644
index 0..c060233e9
--- /dev/null
+++ b/tests/shaders/glsl-bug-109601.shader_test
@@ -0,0 +1,28 @@
+[require]
+GL >= 3.0
+GLSL >= 3.30
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 330
+#extension GL_ARB_shader_storage_buffer_object: require
+
+uniform int v1;
+uniform float v2;
+
+void main()
+{
+   float a = -(v1 >> 16);
+   gl_FragColor = vec4(a * v2,0.0f,0.0f,1.0f);
+}
+
+[test]
+clear color 0.0 0.0 0.0 0.0
+clear
+
+uniform int v1 0x1
+uniform float v2 -1
+
+draw rect -1 -1 2 2
+probe all rgba 1.0 0.0 0.0 1.0
-- 
2.20.1

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

Re: [Piglit] [PATCH] EGL_EXT_image_dma_buf_import: test alpha channel for AYUV format

2019-02-13 Thread Lionel Landwerlin

On 13/02/2019 08:28, Tapani Pälli wrote:

Patches changes expected result to have a alpha ramp in case format
supports alpha, each alpha supporting format should make sure data
matches this expectation.

Signed-off-by: Tapani Pälli 



Looks good, thanks!


Reviewed-by: Lionel Landwerlin 



---
  .../ext_image_dma_buf_import/sample_yuv.c | 60 ---
  1 file changed, 39 insertions(+), 21 deletions(-)

diff --git a/tests/spec/ext_image_dma_buf_import/sample_yuv.c 
b/tests/spec/ext_image_dma_buf_import/sample_yuv.c
index 78a0f25f3..8205a9ffc 100644
--- a/tests/spec/ext_image_dma_buf_import/sample_yuv.c
+++ b/tests/spec/ext_image_dma_buf_import/sample_yuv.c
@@ -42,6 +42,17 @@ PIGLIT_GL_TEST_CONFIG_END
  
  static int fourcc = -1;
  
+static bool

+format_has_alpha(int fourcc)
+{
+   switch (fourcc) {
+   case DRM_FORMAT_AYUV:
+   return true;
+   default:
+   return false;
+   }
+}
+
  enum piglit_result
  piglit_display(void)
  {
@@ -90,29 +101,29 @@ piglit_display(void)
120, 140,
120, 140,
}, ayuv[] = {
-   /* AYUV (TODO: find a way to test alpha channel) */
-   130, 120,  50, 255,
-   130, 127,  70, 255,
-   130, 133,  90, 255,
-   130, 140, 110, 255,
-
-   140, 120,  50, 255,
-   140, 127,  70, 255,
-   140, 133,  90, 255,
-   140, 140, 110, 255,
-
-   150, 120,  50, 255,
-   150, 127,  70, 255,
-   150, 133,  90, 255,
-   150, 140, 110, 255,
-
-   160, 120,  50, 255,
-   160, 127,  70, 255,
-   160, 133,  90, 255,
-   160, 140, 110, 255,
+   /* Increasing alpha ramp. */
+   130, 120,  50, 0,
+   130, 127,  70, 64,
+   130, 133,  90, 128,
+   130, 140, 110, 192,
+
+   140, 120,  50, 0,
+   140, 127,  70, 64,
+   140, 133,  90, 128,
+   140, 140, 110, 192,
+
+   150, 120,  50, 0,
+   150, 127,  70, 64,
+   150, 133,  90, 128,
+   150, 140, 110, 192,
+
+   160, 120,  50, 0,
+   160, 127,  70, 64,
+   160, 133,  90, 128,
+   160, 140, 110, 192,
};
  
-	static const unsigned char expected[4 * 4 * 4] = {

+   static unsigned char expected[4 * 4 * 4] = {
 44,  41,  25, 255,
 67,  64,  48, 255,
 90,  79, 111, 255,
@@ -157,6 +168,13 @@ piglit_display(void)
return PIGLIT_SKIP;
}
  
+	/* Modify alpha values of the expected result. */

+   if (format_has_alpha(fourcc)) {
+   unsigned char *p = expected;
+   for (uint32_t i = 0; i < 4 * 4; i++, p += 4)
+   p[3] = i * (256 / 4);
+   }
+
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  
  	res = dma_buf_create_and_sample_32bpp(4, 4, fourcc, t);



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

Re: [Piglit] [PATCH] EGL_EXT_image_dma_buf_import: add P12, P16 format support

2019-02-13 Thread Lionel Landwerlin

On 13/02/2019 12:20, Tapani Pälli wrote:

Signed-off-by: Tapani Pälli 



Thanks for adding these.


Reviewed-by: Lionel Landwerlin 



---
  tests/opengl.py   |  4 +++
  .../ext_image_dma_buf_import/sample_common.c  |  2 ++
  .../ext_image_dma_buf_import/sample_yuv.c | 27 +++
  .../piglit-framework-gl/piglit_drm_dma_buf.c  |  4 +++
  .../piglit-framework-gl/piglit_drm_dma_buf.h  |  8 ++
  5 files changed, 45 insertions(+)

diff --git a/tests/opengl.py b/tests/opengl.py
index 59e05f127..83f980177 100644
--- a/tests/opengl.py
+++ b/tests/opengl.py
@@ -3037,6 +3037,10 @@ with profile.test_list.group_manager(
'ext_image_dma_buf_import-sample_ayuv', run_concurrent=False)
  g(['ext_image_dma_buf_import-sample_yuv', '-fmt=P010'],
'ext_image_dma_buf_import-sample_p010', run_concurrent=False)
+g(['ext_image_dma_buf_import-sample_yuv', '-fmt=P012'],
+  'ext_image_dma_buf_import-sample_p012', run_concurrent=False)
+g(['ext_image_dma_buf_import-sample_yuv', '-fmt=P016'],
+  'ext_image_dma_buf_import-sample_p016', run_concurrent=False)
  g(['ext_image_dma_buf_import-transcode-nv12-as-r8-gr88'],
'ext_image_dma_buf_import-transcode-nv12-as-r8-gr88',
run_concurrent=False)
diff --git a/tests/spec/ext_image_dma_buf_import/sample_common.c 
b/tests/spec/ext_image_dma_buf_import/sample_common.c
index 426f4cc52..249840f01 100644
--- a/tests/spec/ext_image_dma_buf_import/sample_common.c
+++ b/tests/spec/ext_image_dma_buf_import/sample_common.c
@@ -154,6 +154,8 @@ egl_image_for_dma_buf_fd(struct piglit_dma_buf *buf, int 
fd, int fourcc, EGLImag
switch (fourcc) {
case DRM_FORMAT_NV12:
case DRM_FORMAT_P010:
+   case DRM_FORMAT_P012:
+   case DRM_FORMAT_P016:
attr = attr_nv12;
break;
case DRM_FORMAT_YUV420:
diff --git a/tests/spec/ext_image_dma_buf_import/sample_yuv.c 
b/tests/spec/ext_image_dma_buf_import/sample_yuv.c
index 78a0f25f3..b4c0b63d1 100644
--- a/tests/spec/ext_image_dma_buf_import/sample_yuv.c
+++ b/tests/spec/ext_image_dma_buf_import/sample_yuv.c
@@ -56,6 +56,27 @@ piglit_display(void)
481, 642, 562, 642,
};
  
+	static const uint16_t p012[] = {

+   /* Y */
+803,  1124,  1445, 1766,
+803,  1124,  1445, 1766,
+803,  1124,  1445, 1766,
+803,  1124,  1445, 1766,
+   /* UV */
+   1927, 2088, 2248, 2088,
+   1927, 2569, 2248, 2569,
+   };
+
+   static const uint16_t p016[] = {
+   12850, 17990, 23130, 28270,
+   12850, 17990, 23130, 28270,
+   12850, 17990, 23130, 28270,
+   12850, 17990, 23130, 28270,
+   /* UV */
+   30840, 33410, 35980, 33410,
+   30840, 41120, 35980, 41120,
+   };
+
static const unsigned char nv12[] = {
/* Y */
 50,  70,  90, 110,
@@ -141,6 +162,12 @@ piglit_display(void)
case DRM_FORMAT_P010:
t = (unsigned char *) p010;
break;
+   case DRM_FORMAT_P012:
+   t = (unsigned char *) p012;
+   break;
+   case DRM_FORMAT_P016:
+   t = (unsigned char *) p016;
+   break;
case DRM_FORMAT_NV12:
t = nv12;
break;
diff --git a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c 
b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
index 7f7420b23..8beafad77 100644
--- a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
+++ b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
@@ -164,6 +164,8 @@ piglit_intel_buf_create(unsigned w, unsigned h, unsigned 
fourcc,
buf_h = h * 3 / 2;
break;
case DRM_FORMAT_P010:
+   case DRM_FORMAT_P012:
+   case DRM_FORMAT_P016:
cpp = 2;
buf_h = h * 3 / 2;
break;
@@ -197,6 +199,8 @@ piglit_intel_buf_create(unsigned w, unsigned h, unsigned 
fourcc,
switch (fourcc) {
case DRM_FORMAT_NV12:
case DRM_FORMAT_P010:
+   case DRM_FORMAT_P012:
+   case DRM_FORMAT_P016:
buf->offset[1] = stride * h;
buf->stride[1] = stride;
break;
diff --git a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.h 
b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.h
index b57ffa484..9f59bf7da 100644
--- a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.h
+++ b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.h
@@ -44,6 +44,14 @@
  #define DRM_FORMAT_P010 fourcc_code('P', '0', '1', '0') /* 2x2 subsampled 
Cb:Cr plane 10 bits per channel */
  #endif
  
+#ifndef DRM_FORMAT_P012

+#define DRM_FOR

Re: [Piglit] [PATCH v2] EGL_EXT_image_dma_buf_import: add P10 format support

2019-02-11 Thread Lionel Landwerlin

Reviewed-by: Lionel Landwerlin 

On 11/02/2019 09:44, Tapani Pälli wrote:

v2: use correct range for P10

Signed-off-by: Tapani Pälli 
Signed-off-by: Harish Krupo 
---
  tests/opengl.py|  2 ++
  .../spec/ext_image_dma_buf_import/sample_common.c  |  1 +
  .../spec/ext_image_dma_buf_import/sample_common.h  |  1 +
  tests/spec/ext_image_dma_buf_import/sample_yuv.c   | 14 ++
  .../util/piglit-framework-gl/piglit_drm_dma_buf.c  |  5 +
  .../util/piglit-framework-gl/piglit_drm_dma_buf.h  |  4 
  6 files changed, 27 insertions(+)

diff --git a/tests/opengl.py b/tests/opengl.py
index 97dfbf984..8676e231c 100644
--- a/tests/opengl.py
+++ b/tests/opengl.py
@@ -3030,6 +3030,8 @@ with profile.test_list.group_manager(
'ext_image_dma_buf_import-sample_yvu420', run_concurrent=False)
  g(['ext_image_dma_buf_import-sample_yuv', '-fmt=AYUV'],
'ext_image_dma_buf_import-sample_ayuv', run_concurrent=False)
+g(['ext_image_dma_buf_import-sample_yuv', '-fmt=P010'],
+  'ext_image_dma_buf_import-sample_p010', run_concurrent=False)
  g(['ext_image_dma_buf_import-transcode-nv12-as-r8-gr88'],
'ext_image_dma_buf_import-transcode-nv12-as-r8-gr88',
run_concurrent=False)
diff --git a/tests/spec/ext_image_dma_buf_import/sample_common.c 
b/tests/spec/ext_image_dma_buf_import/sample_common.c
index 2f586c774..426f4cc52 100644
--- a/tests/spec/ext_image_dma_buf_import/sample_common.c
+++ b/tests/spec/ext_image_dma_buf_import/sample_common.c
@@ -153,6 +153,7 @@ egl_image_for_dma_buf_fd(struct piglit_dma_buf *buf, int 
fd, int fourcc, EGLImag
EGLint *attr;
switch (fourcc) {
case DRM_FORMAT_NV12:
+   case DRM_FORMAT_P010:
attr = attr_nv12;
break;
case DRM_FORMAT_YUV420:
diff --git a/tests/spec/ext_image_dma_buf_import/sample_common.h 
b/tests/spec/ext_image_dma_buf_import/sample_common.h
index 36a5bb584..155301250 100644
--- a/tests/spec/ext_image_dma_buf_import/sample_common.h
+++ b/tests/spec/ext_image_dma_buf_import/sample_common.h
@@ -25,6 +25,7 @@
  
  #include "piglit-util-egl.h"

  #include "piglit-util-gl.h"
+#include "piglit-framework-gl/piglit_drm_dma_buf.h"
  
  /**

   * Create a dma buffer with format 'fourcc' setting the given pixels as its
diff --git a/tests/spec/ext_image_dma_buf_import/sample_yuv.c 
b/tests/spec/ext_image_dma_buf_import/sample_yuv.c
index ed9f87e0f..78a0f25f3 100644
--- a/tests/spec/ext_image_dma_buf_import/sample_yuv.c
+++ b/tests/spec/ext_image_dma_buf_import/sample_yuv.c
@@ -45,6 +45,17 @@ static int fourcc = -1;
  enum piglit_result
  piglit_display(void)
  {
+   static const uint16_t p010[] = {
+   /* Y */
+   201,  281,  361, 441,
+   201,  281,  361, 441,
+   201,  281,  361, 441,
+   201,  281,  361, 441,
+   /* UV */
+   481, 522, 562, 522,
+   481, 642, 562, 642,
+   };
+
static const unsigned char nv12[] = {
/* Y */
 50,  70,  90, 110,
@@ -127,6 +138,9 @@ piglit_display(void)
  
  	enum piglit_result res;

switch (fourcc) {
+   case DRM_FORMAT_P010:
+   t = (unsigned char *) p010;
+   break;
case DRM_FORMAT_NV12:
t = nv12;
break;
diff --git a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c 
b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
index 13bf883f2..7f7420b23 100644
--- a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
+++ b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
@@ -163,6 +163,10 @@ piglit_intel_buf_create(unsigned w, unsigned h, unsigned 
fourcc,
cpp = 1;
buf_h = h * 3 / 2;
break;
+   case DRM_FORMAT_P010:
+   cpp = 2;
+   buf_h = h * 3 / 2;
+   break;
default:
fprintf(stderr, "invalid fourcc: %.4s\n", (char *)&fourcc);
return false;
@@ -192,6 +196,7 @@ piglit_intel_buf_create(unsigned w, unsigned h, unsigned 
fourcc,
  
  	switch (fourcc) {

case DRM_FORMAT_NV12:
+   case DRM_FORMAT_P010:
buf->offset[1] = stride * h;
buf->stride[1] = stride;
break;
diff --git a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.h 
b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.h
index b8a4e485d..b57ffa484 100644
--- a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.h
+++ b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.h
@@ -40,6 +40,10 @@
  #define DRM_FORMAT_GR88 fourcc_code('G', 'R', '8', '8')
  #endif
  
+#ifndef DRM_FORMAT_P010

+#define DRM_FORMAT_P010 fourcc_code('P', '0', '1'

Re: [Piglit] [PATCH v2] fbo-blit-check-limits: New test

2019-02-06 Thread Lionel Landwerlin

On 06/02/2019 11:29, Sergii Romantsov wrote:


I think that should be part of the commit message.

Ok, will add. Also in plans is to extend a test

You have a patch for mesa as well?

We have initial version (but looks like it is incomplete): 
https://patchwork.freedesktop.org/patch/253443/ and one more 
partly-related: https://patchwork.freedesktop.org/patch/248561/ where 
Jason said:

I think we likely want to
either do a full audit of all blorp_blit callers or somehow solve it in
blorp_blit.  The fact that we're using floats at all bothers me quite a bit
because it means we're likely loosing some precision somewhere.



I agree with Jason. As far as I can tell, all the call site of 
blorp_blit() are using integers.


It's only brw_blorp_blit_miptrees() that starts taking floats, leading 
to precision issues.


I think we should try to make brw_blorp_blit_miptrees() & blorp 
functions take integers.


That sounds like a cleaner fix, rather than trying to bump the precision 
(there might still be cases where that won't workout well).



-Lionel



So in plans also is to try to use integers... What is your opinion?

On Wed, Feb 6, 2019 at 12:46 PM Lionel Landwerlin 
mailto:lionel.g.landwer...@intel.com>> 
wrote:


Thanks Sergii,

That was the explanation I was looking for :)
I think that should be part of the commit message.

You have a patch for mesa as well?

Thanks,

-Lionel

On 06/02/2019 10:25, Sergii Romantsov wrote:

Hello, Lionel. Thanks for looking on that.

Will try to explain:
Assume that a size of framebuffer is 160*160
We have a read-buffer and write-buffer.
In general: reading of pixels of any region-size and writing them
into region-size that greater or equal to 160 should give us the
same results (whole area of write-buffer should be filled by
color of read-buffer). That is satisfied except we are using some
big pixel-values (dstX1, dstY1) starting from 0x7ff.
I haven't found any restrictions in minimum/maximum values for
parameters (dstX0, dstY0) and (dstX1, dstY1), they are integers
so looks like they could be any valid integer.

Test shows that for big dest-region a draw performed incorrectly.
Correct blit of 160*160 region to dest (0xff, 0xff):
read160_to0xff.png
Incorrect blit of 160*160 region to dest (0x7fff,
0x7fff): read160_to0x7fff.png
Incorrect blit of INT_MAX*INT_MAX region to dest (INT_MAX,
INT_MAX): readIntMax_toIntMax.png

On Tue, Feb 5, 2019 at 1:13 PM Lionel Landwerlin
mailto:lionel.g.landwer...@intel.com>> wrote:

On 05/02/2019 07:52, Sergii Romantsov wrote:
> From: Vadym Shovkoplias mailto:vadim.shovkopl...@gmail.com>>
>
> This test checks max possible blit buffers sizes
>
> v2: copyright updated
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108088
> Signed-off-by: Vadym Shovkoplias
mailto:vadym.shovkopl...@globallogic.com>>

Hi Sergii,

The bug opened about does not give any description about what is
incorrect in the current implementations or what is being
tested in the
spec.

The only paragraph I could find in the spec related to this is :
"
The actual region written to the draw framebuffer is limited
to the
intersection of
the destination buffers being written, which may include
multiple draw
buffers,
the depth buffer, and/or the stencil buffer depending on
mask. Whether
or not the
source or destination regions are altered due to these
limits, the
scaling and offset
applied to pixels being transferred is performed as though no
such
limits were
present.
"

I'm struggling to understand whether the "intersection" is
related to
dimensions or the attachments.
Could give more context?

Thanks,

-Lionel


> ---
>   tests/fbo/CMakeLists.gl.txt       |  1 +
>   tests/fbo/fbo-blit-check-limits.c | 85
+++
>   tests/opengl.py                   |  1 +
>   3 files changed, 87 insertions(+)
>   create mode 100644 tests/fbo/fbo-blit-check-limits.c
>
> diff --git a/tests/fbo/CMakeLists.gl.txt
b/tests/fbo/CMakeLists.gl.txt
> index 1a1a607..e2c7b3a 100644
> --- a/tests/fbo/CMakeLists.gl.txt
> +++ b/tests/fbo/CMakeLists.gl.txt
> @@ -91,6 +91,7 @@ piglit_add_executable
(fbo-storage-formats fbo-storage-formats.c)
>   piglit_add_executable (fbo-storage-completeness
fbo-storage-completen

Re: [Piglit] [PATCH v2] fbo-blit-check-limits: New test

2019-02-06 Thread Lionel Landwerlin

Thanks Sergii,

That was the explanation I was looking for :)
I think that should be part of the commit message.

You have a patch for mesa as well?

Thanks,

-Lionel

On 06/02/2019 10:25, Sergii Romantsov wrote:

Hello, Lionel. Thanks for looking on that.

Will try to explain:
Assume that a size of framebuffer is 160*160
We have a read-buffer and write-buffer.
In general: reading of pixels of any region-size and writing them into 
region-size that greater or equal to 160 should give us the same 
results (whole area of write-buffer should be filled by color of 
read-buffer). That is satisfied except we are using some big 
pixel-values (dstX1, dstY1) starting from 0x7ff.
I haven't found any restrictions in minimum/maximum values for 
parameters (dstX0, dstY0) and (dstX1, dstY1), they are integers so 
looks like they could be any valid integer.


Test shows that for big dest-region a draw performed incorrectly.
Correct blit of 160*160 region to dest (0xff, 0xff): 
read160_to0xff.png
Incorrect blit of 160*160 region to dest (0x7fff, 0x7fff): 
read160_to0x7fff.png
Incorrect blit of INT_MAX*INT_MAX region to dest (INT_MAX, INT_MAX): 
readIntMax_toIntMax.png


On Tue, Feb 5, 2019 at 1:13 PM Lionel Landwerlin 
mailto:lionel.g.landwer...@intel.com>> 
wrote:


On 05/02/2019 07:52, Sergii Romantsov wrote:
> From: Vadym Shovkoplias mailto:vadim.shovkopl...@gmail.com>>
>
> This test checks max possible blit buffers sizes
>
> v2: copyright updated
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108088
> Signed-off-by: Vadym Shovkoplias
mailto:vadym.shovkopl...@globallogic.com>>

Hi Sergii,

The bug opened about does not give any description about what is
incorrect in the current implementations or what is being tested
in the
spec.

The only paragraph I could find in the spec related to this is :
"
The actual region written to the draw framebuffer is limited to the
intersection of
the destination buffers being written, which may include multiple
draw
buffers,
the depth buffer, and/or the stencil buffer depending on mask.
Whether
or not the
source or destination regions are altered due to these limits, the
scaling and offset
applied to pixels being transferred is performed as though no such
limits were
present.
"

I'm struggling to understand whether the "intersection" is related to
dimensions or the attachments.
Could give more context?

Thanks,

-Lionel


> ---
>   tests/fbo/CMakeLists.gl.txt       |  1 +
>   tests/fbo/fbo-blit-check-limits.c | 85
+++
>   tests/opengl.py                   |  1 +
>   3 files changed, 87 insertions(+)
>   create mode 100644 tests/fbo/fbo-blit-check-limits.c
>
> diff --git a/tests/fbo/CMakeLists.gl.txt
b/tests/fbo/CMakeLists.gl.txt
> index 1a1a607..e2c7b3a 100644
> --- a/tests/fbo/CMakeLists.gl.txt
> +++ b/tests/fbo/CMakeLists.gl.txt
> @@ -91,6 +91,7 @@ piglit_add_executable (fbo-storage-formats
fbo-storage-formats.c)
>   piglit_add_executable (fbo-storage-completeness
fbo-storage-completeness.c)
>   piglit_add_executable (fbo-sys-blit fbo-sys-blit.c)
>   piglit_add_executable (fbo-sys-sub-blit fbo-sys-sub-blit.c)
> +piglit_add_executable (fbo-blit-check-limits
fbo-blit-check-limits.c)
>   piglit_add_executable (fbo-tex-rgbx fbo-tex-rgbx.c)
>   piglit_add_executable (fbo-pbo-readpixels-small
fbo-pbo-readpixels-small.c)
>   piglit_add_executable (fbo-copyteximage fbo-copyteximage.c)
> diff --git a/tests/fbo/fbo-blit-check-limits.c
b/tests/fbo/fbo-blit-check-limits.c
> new file mode 100644
> index 000..92f54df
> --- /dev/null
> +++ b/tests/fbo/fbo-blit-check-limits.c
> @@ -0,0 +1,85 @@
> +/*
> + * Copyright (C) 2018 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 

Re: [Piglit] [PATCH v2] fbo-blit-check-limits: New test

2019-02-05 Thread Lionel Landwerlin

On 05/02/2019 07:52, Sergii Romantsov wrote:

From: Vadym Shovkoplias 

This test checks max possible blit buffers sizes

v2: copyright updated

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108088
Signed-off-by: Vadym Shovkoplias 


Hi Sergii,

The bug opened about does not give any description about what is 
incorrect in the current implementations or what is being tested in the 
spec.


The only paragraph I could find in the spec related to this is :
"
The actual region written to the draw framebuffer is limited to the 
intersection of
the destination buffers being written, which may include multiple draw 
buffers,
the depth buffer, and/or the stencil buffer depending on mask. Whether 
or not the
source or destination regions are altered due to these limits, the 
scaling and offset
applied to pixels being transferred is performed as though no such 
limits were

present.
"

I'm struggling to understand whether the "intersection" is related to 
dimensions or the attachments.

Could give more context?

Thanks,

-Lionel



---
  tests/fbo/CMakeLists.gl.txt   |  1 +
  tests/fbo/fbo-blit-check-limits.c | 85 +++
  tests/opengl.py   |  1 +
  3 files changed, 87 insertions(+)
  create mode 100644 tests/fbo/fbo-blit-check-limits.c

diff --git a/tests/fbo/CMakeLists.gl.txt b/tests/fbo/CMakeLists.gl.txt
index 1a1a607..e2c7b3a 100644
--- a/tests/fbo/CMakeLists.gl.txt
+++ b/tests/fbo/CMakeLists.gl.txt
@@ -91,6 +91,7 @@ piglit_add_executable (fbo-storage-formats 
fbo-storage-formats.c)
  piglit_add_executable (fbo-storage-completeness fbo-storage-completeness.c)
  piglit_add_executable (fbo-sys-blit fbo-sys-blit.c)
  piglit_add_executable (fbo-sys-sub-blit fbo-sys-sub-blit.c)
+piglit_add_executable (fbo-blit-check-limits fbo-blit-check-limits.c)
  piglit_add_executable (fbo-tex-rgbx fbo-tex-rgbx.c)
  piglit_add_executable (fbo-pbo-readpixels-small fbo-pbo-readpixels-small.c)
  piglit_add_executable (fbo-copyteximage fbo-copyteximage.c)
diff --git a/tests/fbo/fbo-blit-check-limits.c 
b/tests/fbo/fbo-blit-check-limits.c
new file mode 100644
index 000..92f54df
--- /dev/null
+++ b/tests/fbo/fbo-blit-check-limits.c
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2018 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+/** @file fbo-blit-check-limits.c
+ *
+ * Test FBO blits with MAX possible buffer sizes
+ * Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108088
+ *
+ * \author Vadym Shovkoplias 
+ */
+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_compat_version = 10;
+
+   config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGB;
+   config.requires_displayed_window = true;
+   config.khr_no_error_support = PIGLIT_NO_ERRORS;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+enum piglit_result piglit_display(void)
+{
+   const float green[] = {0.0f, 1.0f, 0.0f};
+   int w = piglit_width;
+   int h = piglit_height;
+   bool success = 1;
+
+   glDrawBuffer(GL_BACK);
+   /* back buffer green */
+   glClearColor(0.0f, 1.0f, 0.0f, 1.0f);
+   glClear(GL_COLOR_BUFFER_BIT);
+
+glDrawBuffer(GL_FRONT);
+   /* front buffer red */
+   glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
+   glClear(GL_COLOR_BUFFER_BIT);
+
+   glReadBuffer(GL_BACK);
+
+   glBlitFramebufferEXT(INT_MIN, INT_MIN, INT_MAX, INT_MAX,
+INT_MIN, INT_MIN, INT_MAX, INT_MAX,
+GL_COLOR_BUFFER_BIT, GL_NEAREST);
+
+   glReadBuffer(GL_FRONT);
+
+   /* the corners should be green */
+   success &= piglit_probe_pixel_rgb(0, 0, green);
+   success &= piglit_probe_pixel_rgb(w - 1, 0, green);
+   success &= piglit_probe_pixel_rgb(0, h - 1, green);
+   success &= piglit_probe_pixel_rgb(w - 1, h - 1, green);
+
+   glFlush();
+
+   return suc

Re: [Piglit] [PATCH] Add test for external sampler with 2D tex

2019-02-03 Thread Lionel Landwerlin

On 02/02/2019 08:42, Aditya Swarup wrote:

Commit 649c149dbb96ac367 removed the test for intel external sampler
with dma only because of failure due to commit a5c39ed974402c -
("i965: Lift restriction in external textures for EGLImage support").
Since, there is no test coverage for external sampler with 2D tex,
adding the test with modifications to pass for external sampler using
EGLImage with 2D tex.

Signed-off-by: Aditya Swarup 
Cc: Tapani Pälli 
Cc: Kenneth Graunke 
---
This test case covers the scenario of binding a texture ID of type 
GL_TEXTURE_EXTERNAL with EGLImage created using 2D texture.

This test is not covered in deqp but in CTS SKQP test - CtsSkQPTestCases 
"#unitTest_EGLImageTest". Explanation in 
https://bugs.freedesktop.org/show_bug.cgi?id=105301.

It would be nice to have test coverage in piglit as well, so that we come to 
know if this scenario is broken in near future.

  tests/opengl.py   |   2 +
  .../CMakeLists.gles2.txt  |   1 +
  .../intel_external_sampler_with_2D_tex.c  | 103 ++
  3 files changed, 106 insertions(+)
  create mode 100644 
tests/spec/ext_image_dma_buf_import/intel_external_sampler_with_2D_tex.c



This test isn't intel specific, so I think that should be dropped from 
the name.





diff --git a/tests/opengl.py b/tests/opengl.py
index af68560bf..926af2036 100644
--- a/tests/opengl.py
+++ b/tests/opengl.py
@@ -3017,6 +3017,8 @@ with profile.test_list.group_manager(
  g(['ext_image_dma_buf_import-unsupported_format'], run_concurrent=False)
  g(['ext_image_dma_buf_import-intel_external_sampler_only'],
run_concurrent=False)
+g(['ext_image_dma_buf_import-intel_external_sampler_with_2D_tex'],
+  run_concurrent=False)
  g(['ext_image_dma_buf_import-refcount'])
  g(['ext_image_dma_buf_import-sample_rgb', '-fmt=AR24'],
'ext_image_dma_buf_import-sample_argb', run_concurrent=False)
diff --git a/tests/spec/ext_image_dma_buf_import/CMakeLists.gles2.txt 
b/tests/spec/ext_image_dma_buf_import/CMakeLists.gles2.txt
index f99a5d800..c22aeed73 100644
--- a/tests/spec/ext_image_dma_buf_import/CMakeLists.gles2.txt
+++ b/tests/spec/ext_image_dma_buf_import/CMakeLists.gles2.txt
@@ -19,6 +19,7 @@ if(PIGLIT_BUILD_DMA_BUF_TESTS)
piglit_add_executable(ext_image_dma_buf_import-refcount refcount.c 
sample_common.c image_common.c)
piglit_add_executable(ext_image_dma_buf_import-sample_yuv sample_yuv.c 
sample_common.c image_common.c)
piglit_add_executable(ext_image_dma_buf_import-sample_rgb sample_rgb.c 
sample_common.c image_common.c)
+   
piglit_add_executable(ext_image_dma_buf_import-intel_external_sampler_with_2D_tex
 intel_external_sampler_with_2D_tex.c image_common.c)







piglit_add_executable(ext_image_dma_buf_import-transcode-nv12-as-r8-gr88 
transcode-nv12-as-r8-gr88.c image_common.c)
  endif()
  
diff --git a/tests/spec/ext_image_dma_buf_import/intel_external_sampler_with_2D_tex.c b/tests/spec/ext_image_dma_buf_import/intel_external_sampler_with_2D_tex.c

new file mode 100644
index 0..82e6a201e
--- /dev/null
+++ b/tests/spec/ext_image_dma_buf_import/intel_external_sampler_with_2D_tex.c
@@ -0,0 +1,103 @@
+/*
+ * 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 "image_common.h"
+
+/**
+ * @file intel_external_sampler_with_2D_tex.c
+ *
+ * Intel driver allows image external sampler to be used with regular 
2D-texutre
+ * and imported dma buffers. This test creates an egl image based on a 
2D-texture,
+ * attempts to use the image as target for an external texture, and should 
pass.
+ *
+ */
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_es_version = 10;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+static EGLImageKHR
+create_tex_based_egl_image(unsigned w, unsigned h, const unsigned char *pixels)
+{
+   GLuint tex;
+  

Re: [Piglit] [PATCH] vulkan: Add some tests for block member decorations

2019-01-24 Thread Lionel Landwerlin

On 24/01/2019 16:15, Alejandro Piñeiro wrote:

From: Neil Roberts 

v2: imported to piglit from a example vkrunner examples branch, also
 updated description on the top comment (Alejandro Piñeiro)

v3: use location 1 instead of location 0 for one of the tests (Lionel)

Reviewed-by: Lionel Landwerlin 



Still Rb!

Thanks,


-Lionel



---
  .../block-layout-location.vk_shader_test  | 121 +
  ...lock-member-layout-location.vk_shader_test |  69 ++
  ...block-mixed-layout-location.vk_shader_test | 126 ++
  3 files changed, 316 insertions(+)
  create mode 100644 tests/vulkan/shaders/block-layout-location.vk_shader_test
  create mode 100644 
tests/vulkan/shaders/block-member-layout-location.vk_shader_test
  create mode 100644 
tests/vulkan/shaders/block-mixed-layout-location.vk_shader_test

diff --git a/tests/vulkan/shaders/block-layout-location.vk_shader_test 
b/tests/vulkan/shaders/block-layout-location.vk_shader_test
new file mode 100644
index 0..32adf5a2c
--- /dev/null
+++ b/tests/vulkan/shaders/block-layout-location.vk_shader_test
@@ -0,0 +1,121 @@
+# Test that interface block members are correctly matched by explicit
+# location, when only the main variable has a location, so the
+# location of the members should be derived from this.
+#
+# Note that we include the spirv assembly. This is because although we
+# used a GLSL shader as reference, we tweaked the SPIR-V generated
+
+[vertex shader spirv]
+   OpCapability Shader
+  %1 = OpExtInstImport "GLSL.std.450"
+   OpMemoryModel Logical GLSL450
+   OpEntryPoint Vertex %main "main" %name %_ %piglit_vertex
+   OpSource GLSL 440
+   OpName %main "main"
+   OpName %block "block"
+   OpMemberName %block 0 "a"
+   OpMemberName %block 1 "b"
+   OpMemberName %block 2 "c"
+   OpMemberName %block 3 "d"
+   OpName %name "name"
+   OpName %gl_PerVertex "gl_PerVertex"
+   OpMemberName %gl_PerVertex 0 "gl_Position"
+   OpMemberName %gl_PerVertex 1 "gl_PointSize"
+   OpMemberName %gl_PerVertex 2 "gl_ClipDistance"
+   OpName %_ ""
+   OpName %piglit_vertex "piglit_vertex"
+   OpDecorate %block Block
+; Only the main name variable has a location. The locations of the members
+; should be derived from this.
+   OpDecorate %name Location 1
+   OpMemberDecorate %gl_PerVertex 0 BuiltIn Position
+   OpMemberDecorate %gl_PerVertex 1 BuiltIn PointSize
+   OpMemberDecorate %gl_PerVertex 2 BuiltIn ClipDistance
+   OpDecorate %gl_PerVertex Block
+   OpDecorate %piglit_vertex Location 0
+   %void = OpTypeVoid
+  %3 = OpTypeFunction %void
+  %float = OpTypeFloat 32
+%v4float = OpTypeVector %float 4
+  %block = OpTypeStruct %v4float %v4float %v4float %v4float
+%_ptr_Output_block = OpTypePointer Output %block
+   %name = OpVariable %_ptr_Output_block Output
+%int = OpTypeInt 32 1
+  %int_0 = OpConstant %int 0
+%float_1 = OpConstant %float 1
+%float_0 = OpConstant %float 0
+ %15 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+  %int_1 = OpConstant %int 1
+ %19 = OpConstantComposite %v4float %float_0 %float_1 %float_0 %float_1
+  %int_2 = OpConstant %int 2
+ %22 = OpConstantComposite %v4float %float_0 %float_0 %float_1 %float_1
+  %int_3 = OpConstant %int 3
+ %25 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+   %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_arr_float_uint_1 = OpTypeArray %float %uint_1
+%gl_PerVertex = OpTypeStruct %v4float %float %_arr_float_uint_1
+%_ptr_Output_gl_PerVertex = OpTypePointer Output %gl_PerVertex
+  %_ = OpVariable %_ptr_Output_gl_PerVertex Output
+%_ptr_Input_v4float = OpTypePointer Input %v4float
+%piglit_vertex = OpVariable %_ptr_Input_v4float Input
+   %main = OpFunction %void None %3
+  %5 = OpLabel
+ %17 = OpAccessChain %_ptr_Output_v4float %name %int_0
+   OpStore %17 %15
+ %20 = OpAccessChain %_ptr_Output_v4float %name %int_1
+   OpStore %20 %19
+ %23 = OpAccessChain %_ptr_Output_v4float %name %int_2
+   OpStore %23 %22
+ %26 = OpAccessChain %_ptr_Output_v4float %name %int_3
+   OpStore %26 %25
+ %35 = OpLoad %v4float %piglit_vertex
+ %36 = OpAccessChain %_ptr_Output_v4float %_ %int_0
+   OpStore %36 %35
+   OpReturn
+   OpFunctionEnd
+
+[fragment shader]
+#version 440
+
+layout(location = 1) in vec

Re: [Piglit] [PATCH] vulkan: Add some tests for block member decorations

2019-01-24 Thread Lionel Landwerlin

On 24/01/2019 15:45, apinheiro wrote:


On 24/1/19 16:28, Lionel Landwerlin wrote:

Thanks a lot for explaining.

I was wondering whether it would be worth checking something like this :

(layout location = 1) out block myBlock {
    vec4 a;
    vec4 b;
}

And verify whether a would bet location 1 and b location 2.



So do you mean adding a new test, or modify the current one to base on 
0 instead of base on 1?



I figured the location =1 on myBlock would cover better the issue 
because we would know that the 0 wasn't selected by accident.


So the same test, just modified a bit.







But this current version looks good to me :

Reviewed-by: Lionel Landwerlin 



Thanks!




Side question that I cannot find the answer to in the spec, the 
following would be illegal right? :


layout (location= 1) out block myOtherBlock {
   layout (location = 1) vec4 a;
   layout (location = 0) vec4 b;
   layout (location = 3) vec4 c;
   layout (location = 2) vec4 d;
};



Well, I don't think so. This is the spec quote that we included on the 
first patch of the mesa merge request:


   “If the structure type is a Block but without a Location, then 
each

    of its members must have a Location decoration. If it is a Block
    with a Location decoration, then its members are assigned
    consecutive locations in declaration order, starting from the
    first member which is initially the Block. Any member with its 
own

    Location decoration is assigned that location. Each remaining
    member is assigned the location after the immediately preceding
    member in declaration order.”

What I understand from here, is that the location used for the block 
would be the one used as "base_location" when assigning locations for 
members that lacks it, specially at the beginning of the block. But if 
the member has a location, then we use it, and we also use it for the 
following members. So for example, in this case:


layout (location = 5) out myOtherBlock {
   vec4 a;
   layout (location = 0) vec4 b;
   layout (location = 3) vec4 c;
   layout (location = 2) vec4 d;
};

'a' gets assigned 5, and the rest would get assigned 0, 3 and 2 
respectively. And I have just tested with glslang, and it is doing 
just that.



Thanks! :)


-Lionel






Thanks again.

-Lionel

On 24/01/2019 13:17, apinheiro wrote:


On 24/1/19 12:28, Lionel Landwerlin wrote:
I'm not sure whether my understanding of 
block-layout-location.vk_shader_test is correct.
Is the expectation that the location of %name (0) is added to the 
location of its field (a, b, c, d)?



Not sure if added is the proper word, but derived. So for those 
members, SPIR-V doesn't include the location. The block has the 
location, so the members get a location based on it. So that 
specific test comes from a block like this:


(layout location= 0) out block myBlock {

 vec4 a;

 vec4 b:

 vec4 c;

 vec4 d;

};

That glslang translates to SPIR-V with setting location 0 to 
myBlock,  but not setting a location for the members. Such members 
would get locations 0, 1, 2, 3 respectively. Those locations are 
assigned right now by the driver, at least on the anv case that I 
tested. Note that as mentioned on the original email, this is the 
case that is working right now. I only tested it with anv, but those 
location assignment is done on the spirv to nir pass, so that would 
affect other Vulkan drivers using it.


FWIW, what we are trying to fix with the MR I sent to review [1], 
and tested with the tests on this patch, is basically the case where 
there is a explicit location for any block member, that doesn't 
follow the "default location assignment rule" based on the block 
base location. So for example, this:


layout (location= 0) out block myOtherBlock {

   layout (location = 1) vec4 a;

   layout (location = 0) vec4 b;

   layout (location = 3) vec4 c;

   layout (location = 2) vec4 d;

};


[1] https://gitlab.freedesktop.org/mesa/mesa/merge_requests/142




Thanks,

-Lionel

On 23/01/2019 15:07, Alejandro Piñeiro wrote:

From: Neil Roberts 

v2: imported to piglit from a example vkrunner examples branch, also
 updated description on the top comment (Alejandro Piñeiro)
---

This tests are intended to test the patches at the following mesa MR:

https://gitlab.freedesktop.org/mesa/mesa/merge_requests/142

Although FWIW, block-layout-location.vk_shader_test is passing right
now with just master. The other two tests require the first patch
included on that MR.

  .../block-layout-location.vk_shader_test  | 121 
+

  ...lock-member-layout-location.vk_shader_test |  69 ++
  ...block-mixed-layout-location.vk_shader_test | 126 
++

  3 files changed, 316 insertions(+)
  create mode 100644 
tests/vulkan/shaders/block-layout-location.vk_shader_test
  create mode 100644 
tests/vulkan/shaders/block-member-layout-location.vk_shader_test
  crea

Re: [Piglit] [PATCH] vulkan: Add some tests for block member decorations

2019-01-24 Thread Lionel Landwerlin

Thanks a lot for explaining.

I was wondering whether it would be worth checking something like this :

(layout location = 1) out block myBlock {
    vec4 a;
    vec4 b;
}

And verify whether a would bet location 1 and b location 2.

But this current version looks good to me :

Reviewed-by: Lionel Landwerlin 

Side question that I cannot find the answer to in the spec, the 
following would be illegal right? :


layout (location= 1) out block myOtherBlock {
   layout (location = 1) vec4 a;
   layout (location = 0) vec4 b;
   layout (location = 3) vec4 c;
   layout (location = 2) vec4 d;
};

Thanks again.

-Lionel

On 24/01/2019 13:17, apinheiro wrote:


On 24/1/19 12:28, Lionel Landwerlin wrote:
I'm not sure whether my understanding of 
block-layout-location.vk_shader_test is correct.
Is the expectation that the location of %name (0) is added to the 
location of its field (a, b, c, d)?



Not sure if added is the proper word, but derived. So for those 
members, SPIR-V doesn't include the location. The block has the 
location, so the members get a location based on it. So that specific 
test comes from a block like this:


(layout location= 0) out block myBlock {

 vec4 a;

 vec4 b:

 vec4 c;

 vec4 d;

};

That glslang translates to SPIR-V with setting location 0 to myBlock,  
but not setting a location for the members. Such members would get 
locations 0, 1, 2, 3 respectively. Those locations are assigned right 
now by the driver, at least on the anv case that I tested. Note that 
as mentioned on the original email, this is the case that is working 
right now. I only tested it with anv, but those location assignment is 
done on the spirv to nir pass, so that would affect other Vulkan 
drivers using it.


FWIW, what we are trying to fix with the MR I sent to review [1], and 
tested with the tests on this patch, is basically the case where there 
is a explicit location for any block member, that doesn't follow the 
"default location assignment rule" based on the block base location. 
So for example, this:


layout (location= 0) out block myOtherBlock {

   layout (location = 1) vec4 a;

   layout (location = 0) vec4 b;

   layout (location = 3) vec4 c;

   layout (location = 2) vec4 d;

};


[1] https://gitlab.freedesktop.org/mesa/mesa/merge_requests/142




Thanks,

-Lionel

On 23/01/2019 15:07, Alejandro Piñeiro wrote:

From: Neil Roberts 

v2: imported to piglit from a example vkrunner examples branch, also
 updated description on the top comment (Alejandro Piñeiro)
---

This tests are intended to test the patches at the following mesa MR:

https://gitlab.freedesktop.org/mesa/mesa/merge_requests/142

Although FWIW, block-layout-location.vk_shader_test is passing right
now with just master. The other two tests require the first patch
included on that MR.

  .../block-layout-location.vk_shader_test  | 121 +
  ...lock-member-layout-location.vk_shader_test |  69 ++
  ...block-mixed-layout-location.vk_shader_test | 126 
++

  3 files changed, 316 insertions(+)
  create mode 100644 
tests/vulkan/shaders/block-layout-location.vk_shader_test
  create mode 100644 
tests/vulkan/shaders/block-member-layout-location.vk_shader_test
  create mode 100644 
tests/vulkan/shaders/block-mixed-layout-location.vk_shader_test


diff --git 
a/tests/vulkan/shaders/block-layout-location.vk_shader_test 
b/tests/vulkan/shaders/block-layout-location.vk_shader_test

new file mode 100644
index 0..3eb2c0402
--- /dev/null
+++ b/tests/vulkan/shaders/block-layout-location.vk_shader_test
@@ -0,0 +1,121 @@
+# Test that interface block members are correctly matched by explicit
+# location, when only the main variable has a location, so the
+# location of the members should be derived from this.
+#
+# Note that we include the spirv assembly. This is because although we
+# used a GLSL shader as reference, we tweaked the SPIR-V generated
+
+[vertex shader spirv]
+   OpCapability Shader
+  %1 = OpExtInstImport "GLSL.std.450"
+   OpMemoryModel Logical GLSL450
+   OpEntryPoint Vertex %main "main" %name %_ 
%piglit_vertex

+   OpSource GLSL 440
+   OpName %main "main"
+   OpName %block "block"
+   OpMemberName %block 0 "a"
+   OpMemberName %block 1 "b"
+   OpMemberName %block 2 "c"
+   OpMemberName %block 3 "d"
+   OpName %name "name"
+   OpName %gl_PerVertex "gl_PerVertex"
+   OpMemberName %gl_PerVertex 0 "gl_Position"
+   OpMemberName %gl_PerVertex 1 "gl_PointSize"
+   OpMemberName %gl_PerVertex 2 "gl_ClipDistance"
+   OpName %_ ""
+   OpName %piglit_vertex "piglit_vertex"
+   Op

Re: [Piglit] [PATCH] vulkan: Add some tests for block member decorations

2019-01-24 Thread Lionel Landwerlin
I'm not sure whether my understanding of 
block-layout-location.vk_shader_test is correct.
Is the expectation that the location of %name (0) is added to the 
location of its field (a, b, c, d)?


Thanks,

-Lionel

On 23/01/2019 15:07, Alejandro Piñeiro wrote:

From: Neil Roberts 

v2: imported to piglit from a example vkrunner examples branch, also
 updated description on the top comment (Alejandro Piñeiro)
---

This tests are intended to test the patches at the following mesa MR:

https://gitlab.freedesktop.org/mesa/mesa/merge_requests/142

Although FWIW, block-layout-location.vk_shader_test is passing right
now with just master. The other two tests require the first patch
included on that MR.

  .../block-layout-location.vk_shader_test  | 121 +
  ...lock-member-layout-location.vk_shader_test |  69 ++
  ...block-mixed-layout-location.vk_shader_test | 126 ++
  3 files changed, 316 insertions(+)
  create mode 100644 tests/vulkan/shaders/block-layout-location.vk_shader_test
  create mode 100644 
tests/vulkan/shaders/block-member-layout-location.vk_shader_test
  create mode 100644 
tests/vulkan/shaders/block-mixed-layout-location.vk_shader_test

diff --git a/tests/vulkan/shaders/block-layout-location.vk_shader_test 
b/tests/vulkan/shaders/block-layout-location.vk_shader_test
new file mode 100644
index 0..3eb2c0402
--- /dev/null
+++ b/tests/vulkan/shaders/block-layout-location.vk_shader_test
@@ -0,0 +1,121 @@
+# Test that interface block members are correctly matched by explicit
+# location, when only the main variable has a location, so the
+# location of the members should be derived from this.
+#
+# Note that we include the spirv assembly. This is because although we
+# used a GLSL shader as reference, we tweaked the SPIR-V generated
+
+[vertex shader spirv]
+   OpCapability Shader
+  %1 = OpExtInstImport "GLSL.std.450"
+   OpMemoryModel Logical GLSL450
+   OpEntryPoint Vertex %main "main" %name %_ %piglit_vertex
+   OpSource GLSL 440
+   OpName %main "main"
+   OpName %block "block"
+   OpMemberName %block 0 "a"
+   OpMemberName %block 1 "b"
+   OpMemberName %block 2 "c"
+   OpMemberName %block 3 "d"
+   OpName %name "name"
+   OpName %gl_PerVertex "gl_PerVertex"
+   OpMemberName %gl_PerVertex 0 "gl_Position"
+   OpMemberName %gl_PerVertex 1 "gl_PointSize"
+   OpMemberName %gl_PerVertex 2 "gl_ClipDistance"
+   OpName %_ ""
+   OpName %piglit_vertex "piglit_vertex"
+   OpDecorate %block Block
+; Only the main name variable has a location. The locations of the members
+; should be derived from this.
+   OpDecorate %name Location 0
+   OpMemberDecorate %gl_PerVertex 0 BuiltIn Position
+   OpMemberDecorate %gl_PerVertex 1 BuiltIn PointSize
+   OpMemberDecorate %gl_PerVertex 2 BuiltIn ClipDistance
+   OpDecorate %gl_PerVertex Block
+   OpDecorate %piglit_vertex Location 0
+   %void = OpTypeVoid
+  %3 = OpTypeFunction %void
+  %float = OpTypeFloat 32
+%v4float = OpTypeVector %float 4
+  %block = OpTypeStruct %v4float %v4float %v4float %v4float
+%_ptr_Output_block = OpTypePointer Output %block
+   %name = OpVariable %_ptr_Output_block Output
+%int = OpTypeInt 32 1
+  %int_0 = OpConstant %int 0
+%float_1 = OpConstant %float 1
+%float_0 = OpConstant %float 0
+ %15 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+  %int_1 = OpConstant %int 1
+ %19 = OpConstantComposite %v4float %float_0 %float_1 %float_0 %float_1
+  %int_2 = OpConstant %int 2
+ %22 = OpConstantComposite %v4float %float_0 %float_0 %float_1 %float_1
+  %int_3 = OpConstant %int 3
+ %25 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+   %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_arr_float_uint_1 = OpTypeArray %float %uint_1
+%gl_PerVertex = OpTypeStruct %v4float %float %_arr_float_uint_1
+%_ptr_Output_gl_PerVertex = OpTypePointer Output %gl_PerVertex
+  %_ = OpVariable %_ptr_Output_gl_PerVertex Output
+%_ptr_Input_v4float = OpTypePointer Input %v4float
+%piglit_vertex = OpVariable %_ptr_Input_v4float Input
+   %main = OpFunction %void None %3
+  %5 = OpLabel
+ %17 = OpAccessChain %_ptr_Output_v4float %name %int_0
+   OpStore %17 %15
+ %20 = OpAccessChain %_ptr_Output_v4float %name %int_1
+   OpStore %20 %19
+ %23 = OpAccessChain %_ptr_Output_v4float %name %int_2
+   OpStore %23 %22
+ %26 = OpAccessChain %_ptr_Output_v4float %name %int_3
+   OpStore %26 %25
+ %35 = OpLoad %v4float %piglit_vertex
+   

Re: [Piglit] [PATCH] util: fix off-by-one when loading source

2019-01-20 Thread Lionel Landwerlin

On 19/01/2019 23:49, Caio Marcelo de Oliveira Filho wrote:

One extra character is leaking from the text into the copied line.
The "+ 1" is an artifact from when malloc was used, strndup will add
the extra '\0' after copying text_size bytes (if available).

7c8ee3f0f "util: simplify string duplication logic"
---
  tests/util/piglit-shader-test.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/util/piglit-shader-test.c b/tests/util/piglit-shader-test.c
index 39df2948d..35ed3a81e 100644
--- a/tests/util/piglit-shader-test.c
+++ b/tests/util/piglit-shader-test.c
@@ -140,7 +140,7 @@ piglit_load_source_from_shader_test(const char *filename,
return false;
}
  
-	text_size = line - first_line + 1;

+   text_size = line - first_line;



The difference between strndup & snprintf is that the former one copies 
n characters plus an additional '\0' while the latter copies n 
characters including '\0'.



Reviewed-by: Lionel Landwerlin 


  
  	if (output_source)

*output_source = strndup(first_line, text_size);



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


Re: [Piglit] [PATCH crucible] Add test for bug 108911

2018-12-04 Thread Lionel Landwerlin

On 04/12/2018 19:13, Lionel Landwerlin wrote:

+if (resolvedData[1][i] != 0xff00ff00) {
+printf("unexpected clear color in layer1: got 0x%x expected 
0x00ff00ff\n",
+   resolvedData[1][i]);
+t_fail();
+return;


Duh! fixed that error message locally

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


[Piglit] [PATCH crucible] Add test for bug 108911

2018-12-04 Thread Lionel Landwerlin
Signed-off-by: Lionel Landwerlin 
---
 Makefile.am|   1 +
 src/tests/bug/108911.c | 306 +
 2 files changed, 307 insertions(+)
 create mode 100644 src/tests/bug/108911.c

diff --git a/Makefile.am b/Makefile.am
index 528650a..6e99516 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -75,6 +75,7 @@ bin_crucible_SOURCES = \
src/qonos/qonos_pipeline.c \
src/tests/bug/104809.c \
src/tests/bug/108909.c \
+   src/tests/bug/108911.c \
src/tests/bench/copy-buffer.c \
src/tests/example/basic.c \
src/tests/example/images.c \
diff --git a/src/tests/bug/108911.c b/src/tests/bug/108911.c
new file mode 100644
index 000..cc94bf4
--- /dev/null
+++ b/src/tests/bug/108911.c
@@ -0,0 +1,306 @@
+// Copyright 2018 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 
+#include 
+#include "tapi/t.h"
+#include "util/misc.h"
+
+/* This is a test for https://bugs.freedesktop.org/show_bug.cgi?id=108911
+ *
+ * The wrong clear color was landing into the layer1+ of a multi-layered
+ * multi-sampled image.
+ */
+
+static VkImage
+create_image_and_bind_memory(const VkImageCreateInfo *info)
+{
+VkImage img;
+VkDeviceMemory mem;
+
+vkCreateImage(t_device, info, NULL, &img);
+mem = qoAllocImageMemory(t_device, img,
+ .properties = 
VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT);
+qoBindImageMemory(t_device, img, mem, 0);
+
+return img;
+}
+
+#define SIZE (8)
+
+static void
+test(void)
+{
+VkRenderPass renderPass;
+VkImage fbImage, imageLayers[2];
+VkImageView viewLayers[2];
+VkFramebuffer fbLayers[2];
+VkBuffer bufferLayers[2];
+VkDeviceMemory bufferMem[2];
+
+renderPass = qoCreateRenderPass(t_device,
+.attachmentCount = 1,
+.pAttachments = &(VkAttachmentDescription) 
{
+.format = VK_FORMAT_R8G8B8A8_UNORM,
+.samples = VK_SAMPLE_COUNT_4_BIT,
+.loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR,
+.storeOp = 
VK_ATTACHMENT_STORE_OP_STORE,
+.stencilLoadOp = 
VK_ATTACHMENT_LOAD_OP_DONT_CARE,
+.stencilStoreOp = 
VK_ATTACHMENT_STORE_OP_DONT_CARE,
+.initialLayout = 
VK_IMAGE_LAYOUT_UNDEFINED,
+.finalLayout = 
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
+},
+.subpassCount = 1,
+.pSubpasses = &(VkSubpassDescription) {
+.pipelineBindPoint = 
VK_PIPELINE_BIND_POINT_GRAPHICS,
+.colorAttachmentCount = 1,
+.pColorAttachments = 
&(VkAttachmentReference) {
+.attachment = 0,
+.layout = 
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
+},
+});
+
+fbImage = create_image_and_bind_memory(&(VkImageCreateInfo) {
+.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,
+.imageType = VK_IMAGE_TYPE_2D,
+.format = VK_FORMAT_R8G8B8A8_UNORM,
+.extent = (VkExtent3D) {
+.width = SIZE,
+.height = SIZE,
+.depth = 1,
+},
+.mipLevels = 1,
+.arrayLayers = 2,
+.samples = VK_SAMPLE_COUNT_4_BIT,
+.tiling = VK_IMAGE_TILING_OPT

Re: [Piglit] [PATCH crucible] Add a test for bug 108909

2018-12-04 Thread Lionel Landwerlin

On 04/12/2018 14:52, Józef Kucia wrote:

On Tue, Dec 4, 2018 at 3:46 PM Lionel Landwerlin
 wrote:

Signed-off-by: Lionel Landwerlin 
---
  Makefile.am|   1 +
  src/tests/bug/108909.c | 106 +
  2 files changed, 107 insertions(+)
  create mode 100644 src/tests/bug/108909.c

diff --git a/Makefile.am b/Makefile.am
index b35e329..528650a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -74,6 +74,7 @@ bin_crucible_SOURCES = \
 src/qonos/qonos.c \
 src/qonos/qonos_pipeline.c \
 src/tests/bug/104809.c \
+   src/tests/bug/108909.c \
 src/tests/bench/copy-buffer.c \
 src/tests/example/basic.c \
 src/tests/example/images.c \
diff --git a/src/tests/bug/108909.c b/src/tests/bug/108909.c
new file mode 100644
index 000..1faadbf
--- /dev/null
+++ b/src/tests/bug/108909.c
@@ -0,0 +1,106 @@
+// Copyright 2018 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 
+#include 
+#include "tapi/t.h"
+#include "util/misc.h"
+
+/* This is a test for https://bugs.freedesktop.org/show_bug.cgi?id=108909
+ *
+ * Ensure ordering of operations for between 3d pipeline and command
+ * streamer on Intel HW.
+ */
+
+static void
+test(void)
+{
+const uint64_t initialData[] = {
+0xdeaddeadbeef,
+0xdeaddeadbeef,
+0xdeaddeadbeef,
+0xdeaddeadbeef,
+};
+VkBuffer dataBuffer = qoCreateBuffer(t_device,
+  .size = sizeof(initialData),
+  .usage = 
VK_BUFFER_USAGE_TRANSFER_SRC_BIT);
+VkDeviceMemory dataMem = qoAllocBufferMemory(t_device, dataBuffer,
+  .properties = 
VK_MEMORY_PROPERTY_HOST_COHERENT_BIT |
+  
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT);
+memcpy(qoMapMemory(t_device, dataMem, /*offset*/ 0,
+   sizeof(initialData), /*flags*/ 0),
+   initialData,
+   sizeof(initialData));
+qoBindBufferMemory(t_device, dataBuffer, dataMem, /*offset*/ 0);
+
+VkBuffer resultBuffer = qoCreateBuffer(t_device,
+.size = sizeof(initialData),
+.usage = 
VK_BUFFER_USAGE_TRANSFER_DST_BIT);
+VkDeviceMemory resultMem = qoAllocBufferMemory(t_device, resultBuffer,
+   .properties = 
VK_MEMORY_PROPERTY_HOST_COHERENT_BIT |
+   
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT);
+qoBindBufferMemory(t_device, resultBuffer, resultMem, /*offset*/ 0);
+
+VkQueryPool pool = qoCreateQueryPool(t_device,
+   .queryType = 
VK_QUERY_TYPE_TIMESTAMP,
+   .queryCount = 
ARRAY_LENGTH(initialData));
+
+
+/* vkCmdCopyQueryPoolResults should be ordered with regard to 
vkCmdCopyBuffer. */
+VkCommandBuffer cmdBuffer = qoAllocateCommandBuffer(t_device, t_cmd_pool);
+qoBeginCommandBuffer(cmdBuffer);
+vkCmdWriteTimestamp(cmdBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, pool, 0);
+vkCmdWriteTimestamp(cmdBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, pool, 1);
+vkCmdCopyBuffer(cmdBuffer, dataBuffer, resultBuffer,
+1, &(VkBufferCopy){ .srcOffset = 0, .dstOffset = 0, .size 
= sizeof(initialData) });
+vkCmdWriteTimestamp(cmdBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, pool, 2);
+vkCmdWriteTimestamp(cmdBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, pool, 3);
+vkCmdCopyQueryPoolResults(cmdBuffer, pool, /*firstQuery*/ 0, 
/*queryCount*/ 4,
+  resultBuffer, /*dstBufferOffset*/ 0, 
sizeof(uint64_t),
+  VK_QUERY_RESULT_WAIT_BIT);

A pi

[Piglit] [PATCH crucible] Add a test for bug 108909

2018-12-04 Thread Lionel Landwerlin
Signed-off-by: Lionel Landwerlin 
---
 Makefile.am|   1 +
 src/tests/bug/108909.c | 106 +
 2 files changed, 107 insertions(+)
 create mode 100644 src/tests/bug/108909.c

diff --git a/Makefile.am b/Makefile.am
index b35e329..528650a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -74,6 +74,7 @@ bin_crucible_SOURCES = \
src/qonos/qonos.c \
src/qonos/qonos_pipeline.c \
src/tests/bug/104809.c \
+   src/tests/bug/108909.c \
src/tests/bench/copy-buffer.c \
src/tests/example/basic.c \
src/tests/example/images.c \
diff --git a/src/tests/bug/108909.c b/src/tests/bug/108909.c
new file mode 100644
index 000..1faadbf
--- /dev/null
+++ b/src/tests/bug/108909.c
@@ -0,0 +1,106 @@
+// Copyright 2018 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 
+#include 
+#include "tapi/t.h"
+#include "util/misc.h"
+
+/* This is a test for https://bugs.freedesktop.org/show_bug.cgi?id=108909
+ *
+ * Ensure ordering of operations for between 3d pipeline and command
+ * streamer on Intel HW.
+ */
+
+static void
+test(void)
+{
+const uint64_t initialData[] = {
+0xdeaddeadbeef,
+0xdeaddeadbeef,
+0xdeaddeadbeef,
+0xdeaddeadbeef,
+};
+VkBuffer dataBuffer = qoCreateBuffer(t_device,
+  .size = sizeof(initialData),
+  .usage = 
VK_BUFFER_USAGE_TRANSFER_SRC_BIT);
+VkDeviceMemory dataMem = qoAllocBufferMemory(t_device, dataBuffer,
+  .properties = 
VK_MEMORY_PROPERTY_HOST_COHERENT_BIT |
+  
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT);
+memcpy(qoMapMemory(t_device, dataMem, /*offset*/ 0,
+   sizeof(initialData), /*flags*/ 0),
+   initialData,
+   sizeof(initialData));
+qoBindBufferMemory(t_device, dataBuffer, dataMem, /*offset*/ 0);
+
+VkBuffer resultBuffer = qoCreateBuffer(t_device,
+.size = sizeof(initialData),
+.usage = 
VK_BUFFER_USAGE_TRANSFER_DST_BIT);
+VkDeviceMemory resultMem = qoAllocBufferMemory(t_device, resultBuffer,
+   .properties = 
VK_MEMORY_PROPERTY_HOST_COHERENT_BIT |
+   
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT);
+qoBindBufferMemory(t_device, resultBuffer, resultMem, /*offset*/ 0);
+
+VkQueryPool pool = qoCreateQueryPool(t_device,
+   .queryType = 
VK_QUERY_TYPE_TIMESTAMP,
+   .queryCount = 
ARRAY_LENGTH(initialData));
+
+
+/* vkCmdCopyQueryPoolResults should be ordered with regard to 
vkCmdCopyBuffer. */
+VkCommandBuffer cmdBuffer = qoAllocateCommandBuffer(t_device, t_cmd_pool);
+qoBeginCommandBuffer(cmdBuffer);
+vkCmdWriteTimestamp(cmdBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, pool, 0);
+vkCmdWriteTimestamp(cmdBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, pool, 1);
+vkCmdCopyBuffer(cmdBuffer, dataBuffer, resultBuffer,
+1, &(VkBufferCopy){ .srcOffset = 0, .dstOffset = 0, .size 
= sizeof(initialData) });
+vkCmdWriteTimestamp(cmdBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, pool, 2);
+vkCmdWriteTimestamp(cmdBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, pool, 3);
+vkCmdCopyQueryPoolResults(cmdBuffer, pool, /*firstQuery*/ 0, 
/*queryCount*/ 4,
+  resultBuffer, /*dstBufferOffset*/ 0, 
sizeof(uint64_t),
+  VK_QUERY_RESULT_WAIT_BIT);
+qoEndCommandBuffer(cmdBuffer);
+
+qoQueueSubmit(t_queue, 1, &cmdBuffer, VK_NULL_HANDLE);
+qoQueueWaitIdle(t_queu

Re: [Piglit] [PATCH piglit 2/2] ext_image_dma_buf_import/unsupported_format has no reason to be intel-only

2018-11-30 Thread Lionel Landwerlin

On 30/11/2018 13:59, Eric Engestrom wrote:

Signed-off-by: Eric Engestrom 



Reviewed-by: Lionel Landwerlin 



---
  tests/opengl.py   |  3 +--
  .../ext_image_dma_buf_import/CMakeLists.gles1.txt |  2 +-
  ...ntel_unsupported_format.c => unsupported_format.c} | 11 +--
  3 files changed, 3 insertions(+), 13 deletions(-)
  rename tests/spec/ext_image_dma_buf_import/{intel_unsupported_format.c => 
unsupported_format.c} (90%)

diff --git a/tests/opengl.py b/tests/opengl.py
index e4e37148613858c806b4..96e92ae7b642d58ba523 100644
--- a/tests/opengl.py
+++ b/tests/opengl.py
@@ -3013,8 +3013,7 @@ def f(name, format, p1=None, p2=None):
  g(['ext_image_dma_buf_import-invalid_attributes'], run_concurrent=False)
  g(['ext_image_dma_buf_import-missing_attributes'], run_concurrent=False)
  g(['ext_image_dma_buf_import-ownership_transfer'], run_concurrent=False)
-g(['ext_image_dma_buf_import-intel_unsupported_format'],
-  run_concurrent=False)
+g(['ext_image_dma_buf_import-unsupported_format'], run_concurrent=False)
  g(['ext_image_dma_buf_import-intel_external_sampler_only'],
run_concurrent=False)
  g(['ext_image_dma_buf_import-refcount'])
diff --git a/tests/spec/ext_image_dma_buf_import/CMakeLists.gles1.txt 
b/tests/spec/ext_image_dma_buf_import/CMakeLists.gles1.txt
index 39a2b292dbb612ea653b..0099f5bece34b9e1ca0d 100644
--- a/tests/spec/ext_image_dma_buf_import/CMakeLists.gles1.txt
+++ b/tests/spec/ext_image_dma_buf_import/CMakeLists.gles1.txt
@@ -21,7 +21,7 @@ if(PIGLIT_BUILD_DMA_BUF_TESTS)
piglit_add_executable(ext_image_dma_buf_import-invalid_attributes 
invalid_attributes.c image_common.c)
piglit_add_executable(ext_image_dma_buf_import-missing_attributes 
missing_attributes.c image_common.c)
piglit_add_executable(ext_image_dma_buf_import-ownership_transfer 
ownership_transfer.c image_common.c)
-   piglit_add_executable(ext_image_dma_buf_import-intel_unsupported_format 
intel_unsupported_format.c image_common.c)
+   piglit_add_executable(ext_image_dma_buf_import-unsupported_format 
unsupported_format.c image_common.c)

piglit_add_executable(ext_image_dma_buf_import-intel_external_sampler_only 
intel_external_sampler_only.c image_common.c)
  endif()
  
diff --git a/tests/spec/ext_image_dma_buf_import/intel_unsupported_format.c b/tests/spec/ext_image_dma_buf_import/unsupported_format.c

similarity index 90%
rename from tests/spec/ext_image_dma_buf_import/intel_unsupported_format.c
rename to tests/spec/ext_image_dma_buf_import/unsupported_format.c
index 448274a48aa765a9ee98..408999a14f6f601bfc6d 100644
--- a/tests/spec/ext_image_dma_buf_import/intel_unsupported_format.c
+++ b/tests/spec/ext_image_dma_buf_import/unsupported_format.c
@@ -26,7 +26,7 @@
  #include "image_common.h"
  
  /**

- * @file intel_unsupported_format.c
+ * @file unsupported_format.c
   *
   * From the EXT_image_dma_buf_import spec:
   *
@@ -102,17 +102,8 @@ piglit_display(void)
  void
  piglit_init(int argc, char **argv)
  {
-   static const char intel_id[] = "Intel Open Source Technology Center";
-   const char *vendor_str;
EGLDisplay egl_dpy = eglGetCurrentDisplay();
  
  	piglit_require_egl_extension(egl_dpy, "EGL_EXT_image_dma_buf_import");

piglit_require_egl_extension(egl_dpy, "EGL_KHR_image_base");
-
-   vendor_str = (const char *)glGetString(GL_VENDOR);
-
-   if (strncmp(vendor_str, intel_id, sizeof(intel_id) - 1) != 0) {
-   printf("Test requires intel gpu\n");
-   piglit_report_result(PIGLIT_SKIP);
-   }
  }



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


Re: [Piglit] [PATCH piglit 1/2] make sure 'unsupported format' test always uses an unsupported format

2018-11-30 Thread Lionel Landwerlin

On 30/11/2018 13:58, Eric Engestrom wrote:

Instead of using the fact this one driver currently doesn't support this
one format, let's just use a format that will never be supported by
anyone.



Maybe put it in tests/util/piglit-framework-gl/piglit_drm_dma_buf.h ?



Signed-off-by: Eric Engestrom 
---
  .../ext_image_dma_buf_import/intel_unsupported_format.c| 7 ++-
  1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tests/spec/ext_image_dma_buf_import/intel_unsupported_format.c 
b/tests/spec/ext_image_dma_buf_import/intel_unsupported_format.c
index 8373e903891a3865dd65..448274a48aa765a9ee98 100644
--- a/tests/spec/ext_image_dma_buf_import/intel_unsupported_format.c
+++ b/tests/spec/ext_image_dma_buf_import/intel_unsupported_format.c
@@ -41,13 +41,18 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
  
  PIGLIT_GL_TEST_CONFIG_END
  
+/* added in libdrm 2.4.95 */

+#ifndef DRM_FORMAT_INVALID
+#define DRM_FORMAT_INVALID 0
+#endif
+
  static EGLImageKHR
  create_image(unsigned w, unsigned h, int fd, unsigned stride, unsigned offset)
  {
EGLint attr[] = {
EGL_WIDTH, w,
EGL_HEIGHT, h,
-   EGL_LINUX_DRM_FOURCC_EXT, DRM_FORMAT_RGB332,
+   EGL_LINUX_DRM_FOURCC_EXT, DRM_FORMAT_INVALID,
EGL_DMA_BUF_PLANE0_FD_EXT, fd,
EGL_DMA_BUF_PLANE0_OFFSET_EXT, offset,
EGL_DMA_BUF_PLANE0_PITCH_EXT, stride,



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


Re: [Piglit] [PATCH v2] EGL_EXT_image_dma_buf_import: add fbo option to yuv formats with alpha channel

2018-11-15 Thread Lionel Landwerlin

On 14/11/2018 17:12, Eric Anholt wrote:

Lionel Landwerlin  writes:


Depending on the platform you're running on, the test might fail with
the AYUV format. To make this reliable, force to render to fbo.

It should be reliable with just the RGBA change.

Separately, I think you should be able to get the -fbo argument (and
thus fewer windows flickering during a test run) by just removing the
run_concurrent=False from the test setup.  That will improve the
performance of piglit runs while making these tests less special.


Indeed.

Dropping this patch in favor a new title.

Thanks!


-

Lionel

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


[Piglit] [PATCH] EGL_EXT_image_dma_buf_import: set RGBA visual for yuv sampling tests

2018-11-15 Thread Lionel Landwerlin
Depending on the platform you're running on, the test might fail with
the AYUV format (or another format with alpha channel). To make this
reliable, force to visual to RGBA.

Signed-off-by: Lionel Landwerlin 
Suggested-by: Eric Anholt 
---
 tests/spec/ext_image_dma_buf_import/sample_yuv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/spec/ext_image_dma_buf_import/sample_yuv.c 
b/tests/spec/ext_image_dma_buf_import/sample_yuv.c
index 38c0ee697..ed9f87e0f 100644
--- a/tests/spec/ext_image_dma_buf_import/sample_yuv.c
+++ b/tests/spec/ext_image_dma_buf_import/sample_yuv.c
@@ -36,6 +36,7 @@
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
config.supports_gl_es_version = 20;
+   config.window_visual = PIGLIT_GL_VISUAL_RGBA;
 
 PIGLIT_GL_TEST_CONFIG_END
 
-- 
2.19.1

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


[Piglit] [PATCH v2] EGL_EXT_image_dma_buf_import: fix error check with unknown drm format

2018-11-14 Thread Lionel Landwerlin
According to the EGL_EXT_image_dma_buf_import spec, creating an EGL
image with a DRM format not supported should yield the BAD_MATCH
error :

"
   * If  is EGL_LINUX_DMA_BUF_EXT, and the EGL_LINUX_DRM_FOURCC_EXT
 attribute is set to a format not supported by the EGL, EGL_BAD_MATCH
 is generated.
"

v2: Add spec quote (Eric)

Signed-off-by: Lionel Landwerlin 
Fixes: 0ee445dbbc161f ("tests/spec: EXT_image_dma_buf_import invalid 
attributes")
---
 tests/spec/ext_image_dma_buf_import/invalid_attributes.c | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tests/spec/ext_image_dma_buf_import/invalid_attributes.c 
b/tests/spec/ext_image_dma_buf_import/invalid_attributes.c
index cc0b0462a..e4bc78f7d 100644
--- a/tests/spec/ext_image_dma_buf_import/invalid_attributes.c
+++ b/tests/spec/ext_image_dma_buf_import/invalid_attributes.c
@@ -162,10 +162,17 @@ test_invalid_format(unsigned w, unsigned h, int fd, 
unsigned stride,
EGL_NONE
};
 
+   /**
+* The spec says:
+*
+* "If  is EGL_LINUX_DMA_BUF_EXT, and the 
EGL_LINUX_DRM_FOURCC_EXT
+*  attribute is set to a format not supported by the EGL, 
EGL_BAD_MATCH
+*  is generated."
+*/
img = eglCreateImageKHR(eglGetCurrentDisplay(), EGL_NO_CONTEXT,
EGL_LINUX_DMA_BUF_EXT, (EGLClientBuffer)0, attr);
 
-   if (!piglit_check_egl_error(EGL_BAD_ATTRIBUTE)) {
+   if (!piglit_check_egl_error(EGL_BAD_MATCH)) {
if (img)
eglDestroyImageKHR(eglGetCurrentDisplay(), img);
return false;
-- 
2.19.1

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


[Piglit] [PATCH v2] EGL_EXT_image_dma_buf_import: add fbo option to yuv formats with alpha channel

2018-11-14 Thread Lionel Landwerlin
Depending on the platform you're running on, the test might fail with
the AYUV format. To make this reliable, force to render to fbo.

v2: request RGBA visual (Eric)

Signed-off-by: Lionel Landwerlin 
---
 tests/opengl.py  | 2 +-
 tests/spec/ext_image_dma_buf_import/sample_yuv.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/opengl.py b/tests/opengl.py
index 8957de6e2..7c96e9412 100644
--- a/tests/opengl.py
+++ b/tests/opengl.py
@@ -3027,7 +3027,7 @@ with profile.test_list.group_manager(
   'ext_image_dma_buf_import-sample_yuv420', run_concurrent=False)
 g(['ext_image_dma_buf_import-sample_yuv', '-fmt=YV12'],
   'ext_image_dma_buf_import-sample_yvu420', run_concurrent=False)
-g(['ext_image_dma_buf_import-sample_yuv', '-fmt=AYUV'],
+g(['ext_image_dma_buf_import-sample_yuv', '-fmt=AYUV', '-fbo'],
   'ext_image_dma_buf_import-sample_ayuv', run_concurrent=False)
 g(['ext_image_dma_buf_import-transcode-nv12-as-r8-gr88'],
   'ext_image_dma_buf_import-transcode-nv12-as-r8-gr88',
diff --git a/tests/spec/ext_image_dma_buf_import/sample_yuv.c 
b/tests/spec/ext_image_dma_buf_import/sample_yuv.c
index 38c0ee697..ed9f87e0f 100644
--- a/tests/spec/ext_image_dma_buf_import/sample_yuv.c
+++ b/tests/spec/ext_image_dma_buf_import/sample_yuv.c
@@ -36,6 +36,7 @@
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
config.supports_gl_es_version = 20;
+   config.window_visual = PIGLIT_GL_VISUAL_RGBA;
 
 PIGLIT_GL_TEST_CONFIG_END
 
-- 
2.19.1

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


[Piglit] [PATCH 2/2] EGL_EXT_image_dma_buf_import: add fbo option to yuv formats with alpha channel

2018-11-13 Thread Lionel Landwerlin
Depending on the platform you're running on, the test might fail with
the AYUV format. To make this reliable, force to render to fbo.

Signed-off-by: Lionel Landwerlin 
---
 tests/opengl.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/opengl.py b/tests/opengl.py
index 8957de6e2..7c96e9412 100644
--- a/tests/opengl.py
+++ b/tests/opengl.py
@@ -3027,7 +3027,7 @@ with profile.test_list.group_manager(
   'ext_image_dma_buf_import-sample_yuv420', run_concurrent=False)
 g(['ext_image_dma_buf_import-sample_yuv', '-fmt=YV12'],
   'ext_image_dma_buf_import-sample_yvu420', run_concurrent=False)
-g(['ext_image_dma_buf_import-sample_yuv', '-fmt=AYUV'],
+g(['ext_image_dma_buf_import-sample_yuv', '-fmt=AYUV', '-fbo'],
   'ext_image_dma_buf_import-sample_ayuv', run_concurrent=False)
 g(['ext_image_dma_buf_import-transcode-nv12-as-r8-gr88'],
   'ext_image_dma_buf_import-transcode-nv12-as-r8-gr88',
-- 
2.19.1

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


[Piglit] [PATCH 1/2] EGL_EXT_image_dma_buf_import: drop alpha-one to sample yuv tests

2018-11-13 Thread Lionel Landwerlin
This option only applies to the sample_rgb tests.

Signed-off-by: Lionel Landwerlin 
---
 tests/opengl.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/opengl.py b/tests/opengl.py
index c672fdad4..8957de6e2 100644
--- a/tests/opengl.py
+++ b/tests/opengl.py
@@ -3021,11 +3021,11 @@ with profile.test_list.group_manager(
   'ext_image_dma_buf_import-sample_argb', run_concurrent=False)
 g(['ext_image_dma_buf_import-sample_rgb', '-fmt=XR24', '-alpha-one'],
   'ext_image_dma_buf_import-sample_xrgb', run_concurrent=False)
-g(['ext_image_dma_buf_import-sample_yuv', '-fmt=NV12', '-alpha-one'],
+g(['ext_image_dma_buf_import-sample_yuv', '-fmt=NV12'],
   'ext_image_dma_buf_import-sample_nv12', run_concurrent=False)
-g(['ext_image_dma_buf_import-sample_yuv', '-fmt=YU12', '-alpha-one'],
+g(['ext_image_dma_buf_import-sample_yuv', '-fmt=YU12'],
   'ext_image_dma_buf_import-sample_yuv420', run_concurrent=False)
-g(['ext_image_dma_buf_import-sample_yuv', '-fmt=YV12', '-alpha-one'],
+g(['ext_image_dma_buf_import-sample_yuv', '-fmt=YV12'],
   'ext_image_dma_buf_import-sample_yvu420', run_concurrent=False)
 g(['ext_image_dma_buf_import-sample_yuv', '-fmt=AYUV'],
   'ext_image_dma_buf_import-sample_ayuv', run_concurrent=False)
-- 
2.19.1

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


[Piglit] [PATCH] EGL_EXT_image_dma_buf_import: fix error check with unknown drm format

2018-11-13 Thread Lionel Landwerlin
According to the EGL_EXT_image_dma_buf_import spec, creating an EGL
image with a DRM format not supported should yield the BAD_MATCH
error :

"
   * If  is EGL_LINUX_DMA_BUF_EXT, and the EGL_LINUX_DRM_FOURCC_EXT
 attribute is set to a format not supported by the EGL, EGL_BAD_MATCH
 is generated.
"

Signed-off-by: Lionel Landwerlin 
Fixes: 0ee445dbbc161f ("tests/spec: EXT_image_dma_buf_import invalid 
attributes")
---
 tests/spec/ext_image_dma_buf_import/invalid_attributes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/spec/ext_image_dma_buf_import/invalid_attributes.c 
b/tests/spec/ext_image_dma_buf_import/invalid_attributes.c
index cc0b0462a..e41447936 100644
--- a/tests/spec/ext_image_dma_buf_import/invalid_attributes.c
+++ b/tests/spec/ext_image_dma_buf_import/invalid_attributes.c
@@ -165,7 +165,7 @@ test_invalid_format(unsigned w, unsigned h, int fd, 
unsigned stride,
img = eglCreateImageKHR(eglGetCurrentDisplay(), EGL_NO_CONTEXT,
EGL_LINUX_DMA_BUF_EXT, (EGLClientBuffer)0, attr);
 
-   if (!piglit_check_egl_error(EGL_BAD_ATTRIBUTE)) {
+   if (!piglit_check_egl_error(EGL_BAD_MATCH)) {
if (img)
eglDestroyImageKHR(eglGetCurrentDisplay(), img);
return false;
-- 
2.19.1

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


Re: [Piglit] [PATCH v2] EGL_EXT_image_dma_buf_import: add AYUV format support

2018-11-13 Thread Lionel Landwerlin

On 09/11/2018 17:31, Eric Engestrom wrote:

On Friday, 2018-11-09 17:27:15 +, Lionel Landwerlin wrote:

v2: Forgot to add the new test to opengl.py
 Drop some code to deal with alpha channel

Signed-off-by: Lionel Landwerlin 
---
  tests/opengl.py   |  2 ++
  .../ext_image_dma_buf_import/sample_yuv.c | 26 ++-
  .../piglit-framework-gl/piglit_drm_dma_buf.c  |  1 +
  3 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/tests/opengl.py b/tests/opengl.py
index b74606be1..e01f3e6e7 100644
--- a/tests/opengl.py
+++ b/tests/opengl.py
@@ -3029,6 +3029,8 @@ with profile.test_list.group_manager(
'ext_image_dma_buf_import-sample_yuv420', run_concurrent=False)
  g(['ext_image_dma_buf_import-sample_yuv', '-fmt=YV12', '-alpha-one'],
'ext_image_dma_buf_import-sample_yvu420', run_concurrent=False)
+g(['ext_image_dma_buf_import-sample_yuv', '-fmt=AYUV'],
+  'ext_image_dma_buf_import-sample_ayuv', run_concurrent=False)
  g(['ext_image_dma_buf_import-transcode-nv12-as-r8-gr88'],
'ext_image_dma_buf_import-transcode-nv12-as-r8-gr88',
run_concurrent=False)
diff --git a/tests/spec/ext_image_dma_buf_import/sample_yuv.c 
b/tests/spec/ext_image_dma_buf_import/sample_yuv.c
index a314bc56f..bb9997102 100644
--- a/tests/spec/ext_image_dma_buf_import/sample_yuv.c
+++ b/tests/spec/ext_image_dma_buf_import/sample_yuv.c
@@ -77,9 +77,30 @@ piglit_display(void)
/* U */
120, 140,
120, 140,
+   }, ayuv[] = {
+   /* AYUV (TODO: find a way to test alpha channel) */
+   130, 120,  50, 255,
+   130, 127,  70, 255,
+   130, 133,  90, 255,
+   130, 140, 110, 255,
+
+   140, 120,  50, 255,
+   140, 127,  70, 255,
+   140, 133,  90, 255,
+   140, 140, 110, 255,
+
+   150, 120,  50, 255,
+   150, 127,  70, 255,
+   150, 133,  90, 255,
+   150, 140, 110, 255,
+
+   160, 120,  50, 255,
+   160, 127,  70, 255,
+   160, 133,  90, 255,
+   160, 140, 110, 255,
};
  
-	static const unsigned char expected[4 * 4 * 4] = {

+   unsigned char expected[4 * 4 * 4] = {

I assume that wasn't meant to be committed?



Indeed. Does the rest of the patch look okay?





 44,  41,  25, 255,
 67,  64,  48, 255,
 90,  79, 111, 255,
@@ -114,6 +135,9 @@ piglit_display(void)
case DRM_FORMAT_YVU420:
t = yvu420;
break;
+   case DRM_FORMAT_AYUV:
+   t = ayuv;
+   break;
default:
return PIGLIT_SKIP;
}
diff --git a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c 
b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
index 869d9db7d..13bf883f2 100644
--- a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
+++ b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
@@ -154,6 +154,7 @@ piglit_intel_buf_create(unsigned w, unsigned h, unsigned 
fourcc,
case DRM_FORMAT_ABGR:
case DRM_FORMAT_RGBA:
case DRM_FORMAT_BGRA:
+   case DRM_FORMAT_AYUV:
cpp = 4;
break;
case DRM_FORMAT_NV12:
--
2.19.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 v2] EGL_EXT_image_dma_buf_import: add AYUV format support

2018-11-09 Thread Lionel Landwerlin
v2: Forgot to add the new test to opengl.py
Drop some code to deal with alpha channel

Signed-off-by: Lionel Landwerlin 
---
 tests/opengl.py   |  2 ++
 .../ext_image_dma_buf_import/sample_yuv.c | 26 ++-
 .../piglit-framework-gl/piglit_drm_dma_buf.c  |  1 +
 3 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/tests/opengl.py b/tests/opengl.py
index b74606be1..e01f3e6e7 100644
--- a/tests/opengl.py
+++ b/tests/opengl.py
@@ -3029,6 +3029,8 @@ with profile.test_list.group_manager(
   'ext_image_dma_buf_import-sample_yuv420', run_concurrent=False)
 g(['ext_image_dma_buf_import-sample_yuv', '-fmt=YV12', '-alpha-one'],
   'ext_image_dma_buf_import-sample_yvu420', run_concurrent=False)
+g(['ext_image_dma_buf_import-sample_yuv', '-fmt=AYUV'],
+  'ext_image_dma_buf_import-sample_ayuv', run_concurrent=False)
 g(['ext_image_dma_buf_import-transcode-nv12-as-r8-gr88'],
   'ext_image_dma_buf_import-transcode-nv12-as-r8-gr88',
   run_concurrent=False)
diff --git a/tests/spec/ext_image_dma_buf_import/sample_yuv.c 
b/tests/spec/ext_image_dma_buf_import/sample_yuv.c
index a314bc56f..bb9997102 100644
--- a/tests/spec/ext_image_dma_buf_import/sample_yuv.c
+++ b/tests/spec/ext_image_dma_buf_import/sample_yuv.c
@@ -77,9 +77,30 @@ piglit_display(void)
/* U */
120, 140,
120, 140,
+   }, ayuv[] = {
+   /* AYUV (TODO: find a way to test alpha channel) */
+   130, 120,  50, 255,
+   130, 127,  70, 255,
+   130, 133,  90, 255,
+   130, 140, 110, 255,
+
+   140, 120,  50, 255,
+   140, 127,  70, 255,
+   140, 133,  90, 255,
+   140, 140, 110, 255,
+
+   150, 120,  50, 255,
+   150, 127,  70, 255,
+   150, 133,  90, 255,
+   150, 140, 110, 255,
+
+   160, 120,  50, 255,
+   160, 127,  70, 255,
+   160, 133,  90, 255,
+   160, 140, 110, 255,
};
 
-   static const unsigned char expected[4 * 4 * 4] = {
+   unsigned char expected[4 * 4 * 4] = {
 44,  41,  25, 255,
 67,  64,  48, 255,
 90,  79, 111, 255,
@@ -114,6 +135,9 @@ piglit_display(void)
case DRM_FORMAT_YVU420:
t = yvu420;
break;
+   case DRM_FORMAT_AYUV:
+   t = ayuv;
+   break;
default:
return PIGLIT_SKIP;
}
diff --git a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c 
b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
index 869d9db7d..13bf883f2 100644
--- a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
+++ b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
@@ -154,6 +154,7 @@ piglit_intel_buf_create(unsigned w, unsigned h, unsigned 
fourcc,
case DRM_FORMAT_ABGR:
case DRM_FORMAT_RGBA:
case DRM_FORMAT_BGRA:
+   case DRM_FORMAT_AYUV:
cpp = 4;
break;
case DRM_FORMAT_NV12:
-- 
2.19.1

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


[Piglit] [PATCH] remove ext_image_dma_buf_import-intel_external_sampler_with_dma_only

2018-11-09 Thread Lionel Landwerlin
Commit a5c39ed974402c ("i965: Lift restriction in external textures
for EGLImage support") from Mesa lifted the restriction that this test
was checking. Easy fix!

Signed-off-by: Lionel Landwerlin 
---
 tests/opengl.py   |   2 -
 .../CMakeLists.gles2.txt  |   1 -
 .../intel_external_sampler_with_dma_only.c| 104 --
 3 files changed, 107 deletions(-)
 delete mode 100644 
tests/spec/ext_image_dma_buf_import/intel_external_sampler_with_dma_only.c

diff --git a/tests/opengl.py b/tests/opengl.py
index b74606be1..83cc18fe0 100644
--- a/tests/opengl.py
+++ b/tests/opengl.py
@@ -3016,8 +3016,6 @@ with profile.test_list.group_manager(
   run_concurrent=False)
 g(['ext_image_dma_buf_import-intel_external_sampler_only'],
   run_concurrent=False)
-g(['ext_image_dma_buf_import-intel_external_sampler_with_dma_only'],
-  run_concurrent=False)
 g(['ext_image_dma_buf_import-refcount'])
 g(['ext_image_dma_buf_import-sample_rgb', '-fmt=AR24'],
   'ext_image_dma_buf_import-sample_argb', run_concurrent=False)
diff --git a/tests/spec/ext_image_dma_buf_import/CMakeLists.gles2.txt 
b/tests/spec/ext_image_dma_buf_import/CMakeLists.gles2.txt
index 93f43fad9..f99a5d800 100644
--- a/tests/spec/ext_image_dma_buf_import/CMakeLists.gles2.txt
+++ b/tests/spec/ext_image_dma_buf_import/CMakeLists.gles2.txt
@@ -19,7 +19,6 @@ if(PIGLIT_BUILD_DMA_BUF_TESTS)
piglit_add_executable(ext_image_dma_buf_import-refcount refcount.c 
sample_common.c image_common.c)
piglit_add_executable(ext_image_dma_buf_import-sample_yuv sample_yuv.c 
sample_common.c image_common.c)
piglit_add_executable(ext_image_dma_buf_import-sample_rgb sample_rgb.c 
sample_common.c image_common.c)
-   
piglit_add_executable(ext_image_dma_buf_import-intel_external_sampler_with_dma_only
 intel_external_sampler_with_dma_only.c image_common.c)

piglit_add_executable(ext_image_dma_buf_import-transcode-nv12-as-r8-gr88 
transcode-nv12-as-r8-gr88.c image_common.c)
 endif()
 
diff --git 
a/tests/spec/ext_image_dma_buf_import/intel_external_sampler_with_dma_only.c 
b/tests/spec/ext_image_dma_buf_import/intel_external_sampler_with_dma_only.c
deleted file mode 100644
index 6b5c7a1e7..0
--- a/tests/spec/ext_image_dma_buf_import/intel_external_sampler_with_dma_only.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * 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 "image_common.h"
-
-/**
- * @file intel_external_sampler_with_dma_only.c
- *
- * Intel driver allows image external sampler to be used only with imported 
- * dma buffers. This test creates an egl image based on a 2D-texture, attempts
- * to use the image as target for an external texture, and expects to fail with
- * GL_INVALID_OPERATION.
- */
-
-PIGLIT_GL_TEST_CONFIG_BEGIN
-
-   config.supports_gl_es_version = 10;
-
-PIGLIT_GL_TEST_CONFIG_END
-
-static EGLImageKHR
-create_tex_based_egl_image(unsigned w, unsigned h, const unsigned char *pixels)
-{
-   GLuint tex;
-   EGLImageKHR img;
-
-   glGenTextures(1, &tex);
-   glBindTexture(GL_TEXTURE_2D, tex);
-
-   glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA,
-  GL_UNSIGNED_BYTE, pixels);
-
-   img = eglCreateImageKHR(eglGetCurrentDisplay(), eglGetCurrentContext(),
-  EGL_GL_TEXTURE_2D_KHR, (EGLClientBuffer)(intptr_t)tex, 0);
-   if (!img)
-  printf("failed to create EGL image out of texture\n");
-
-   glDeleteTextures(1, &tex);
-
-   return img;
-}
-
-enum piglit_result
-piglit_display(void)
-{
-   GLuint tex;
-   enum piglit_result result = PIGLIT_FAIL;
-   const unsigned char src[] = { 0x00, 0x00, 0x00, 0x00 };
-  

[Piglit] [PATCH] EGL_EXT_image_dma_buf_import: add AYUV format support

2018-11-08 Thread Lionel Landwerlin
Signed-off-by: Lionel Landwerlin 
---
 .../ext_image_dma_buf_import/sample_yuv.c | 33 ++-
 .../piglit-framework-gl/piglit_drm_dma_buf.c  |  1 +
 2 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/tests/spec/ext_image_dma_buf_import/sample_yuv.c 
b/tests/spec/ext_image_dma_buf_import/sample_yuv.c
index a314bc56f..b909221ee 100644
--- a/tests/spec/ext_image_dma_buf_import/sample_yuv.c
+++ b/tests/spec/ext_image_dma_buf_import/sample_yuv.c
@@ -77,9 +77,30 @@ piglit_display(void)
/* U */
120, 140,
120, 140,
+   }, ayuv[] = {
+   /* AYUV (TODO: find a way to test alpha channel) */
+   130, 120,  50, 255,
+   130, 127,  70, 255,
+   130, 133,  90, 255,
+   130, 140, 110, 255,
+
+   140, 120,  50, 255,
+   140, 127,  70, 255,
+   140, 133,  90, 255,
+   140, 140, 110, 255,
+
+   150, 120,  50, 255,
+   150, 127,  70, 255,
+   150, 133,  90, 255,
+   150, 140, 110, 255,
+
+   160, 120,  50, 255,
+   160, 127,  70, 255,
+   160, 133,  90, 255,
+   160, 140, 110, 255,
};
 
-   static const unsigned char expected[4 * 4 * 4] = {
+   unsigned char expected[4 * 4 * 4] = {
 44,  41,  25, 255,
 67,  64,  48, 255,
 90,  79, 111, 255,
@@ -114,6 +135,16 @@ piglit_display(void)
case DRM_FORMAT_YVU420:
t = yvu420;
break;
+   case DRM_FORMAT_AYUV:
+   t = ayuv;
+   /* Override the alpha channel. */
+   for (int y = 0; y < 4; y++) {
+   for (int x = 0; x < 4; x++) {
+   expected[y * 4 * 4 + x * 4 + 3] =
+   ayuv[y * 4 * 4 + x * 4 + 3];
+   }
+   }
+   break;
default:
return PIGLIT_SKIP;
}
diff --git a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c 
b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
index 869d9db7d..13bf883f2 100644
--- a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
+++ b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
@@ -154,6 +154,7 @@ piglit_intel_buf_create(unsigned w, unsigned h, unsigned 
fourcc,
case DRM_FORMAT_ABGR:
case DRM_FORMAT_RGBA:
case DRM_FORMAT_BGRA:
+   case DRM_FORMAT_AYUV:
cpp = 4;
break;
case DRM_FORMAT_NV12:
-- 
2.19.1

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


Re: [Piglit] [PATCH] ext_texture_norm16-render: read SNORM formats if EXT_render_snorm

2018-07-31 Thread Lionel Landwerlin

On 31/07/18 12:21, Tapani Pälli wrote:

This was missed from commit a440e4390.

Signed-off-by: Tapani Pälli 


Reviewed-by: Lionel Landwerlin 


---
  tests/spec/ext_texture_norm16/render.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/spec/ext_texture_norm16/render.c 
b/tests/spec/ext_texture_norm16/render.c
index 46cc7c91b..08a84501c 100644
--- a/tests/spec/ext_texture_norm16/render.c
+++ b/tests/spec/ext_texture_norm16/render.c
@@ -239,8 +239,8 @@ verify_contents(const struct fmt_test *test)
bool result = true;
unsigned amount = piglit_width * piglit_height;
unsigned short *pix = malloc (amount * 8);
-   glReadPixels(0, 0, piglit_width, piglit_height, GL_RGBA,
-GL_UNSIGNED_SHORT, pix);
+   glReadPixels(0, 0, piglit_width, piglit_height, GL_RGBA, test->type,
+pix);
  
  	/* Setup expected value, alpha is always max in the test. */

unsigned short value[4] = { 0 };
@@ -476,6 +476,7 @@ piglit_display(void)
case GL_RG16_SNORM_EXT:
case GL_RGBA16_SNORM_EXT:
test->req_render = true;
+   test->can_read = true;
}
}
}



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


Re: [Piglit] [PATCH v2] GL_ARB_texture_buffer_object: New test for error behavior.

2018-07-26 Thread Lionel Landwerlin

Looks good to me but maybe Ilia or Ian can confirm.

Acked-by: Lionel Landwerlin 

-
Lionel

On 26/07/18 14:14, Vadim Shovkoplias wrote:

ping

2018-06-06 12:57 GMT+03:00 Illia Iorin <mailto:illia.io...@gmail.com>>:


This test checks that if we allocate more memory for the buffer
 than possible, we get GL_OUT_OF_MEMORY error.

V2:
  - check GL_ARB_texture_buffer_object extension
  - change storage format to GL_RGBA32I
  - check gl compat version 3.1 because
        function glTexBuffer() require that version

Signed-off-by: Illia Iorin mailto:illia.io...@globallogic.com>>
---
 tests/opengl.py                               |  1 +
 .../CMakeLists.gl.txt                         |  1 +
 .../negative-bad-oom.c                        | 62
+++
 3 files changed, 64 insertions(+)
 create mode 100644
tests/spec/arb_texture_buffer_object/negative-bad-oom.c

diff --git a/tests/opengl.py b/tests/opengl.py
index 9c43d32c9..56cf4f041 100644
--- a/tests/opengl.py
+++ b/tests/opengl.py
@@ -2365,6 +2365,7 @@ with profile.test_list.group_manager(
     g(['arb_texture_buffer_object-max-size'], 'max-size')
     g(['arb_texture_buffer_object-minmax'], 'minmax')
     g(['arb_texture_buffer_object-negative-bad-bo'],
'negative-bad-bo')
+    g(['arb_texture_buffer_object-negative-bad-oom'],
'negative-bad-oom')
     g(['arb_texture_buffer_object-negative-bad-format'],
'negative-bad-format')
     g(['arb_texture_buffer_object-negative-bad-target'],
'negative-bad-target')
     g(['arb_texture_buffer_object-negative-unsupported'],
diff --git
a/tests/spec/arb_texture_buffer_object/CMakeLists.gl.txt
b/tests/spec/arb_texture_buffer_object/CMakeLists.gl.txt
index 959ca0c2f..98d1e16d8 100644
--- a/tests/spec/arb_texture_buffer_object/CMakeLists.gl.txt
+++ b/tests/spec/arb_texture_buffer_object/CMakeLists.gl.txt
@@ -25,3 +25,4 @@ piglit_add_executable
(arb_texture_buffer_object-subdata-sync subdata-sync.c)
 piglit_add_executable (arb_texture_buffer_object-unused-name
unused-name.c)
 piglit_add_executable
(arb_texture_buffer_object-fetch-outside-bounds
fetch-outside-bounds.c)
 piglit_add_executable (arb_texture_buffer_object-indexed indexed.c)
+piglit_add_executable (arb_texture_buffer_object-negative-bad-oom
negative-bad-oom.c)
\ No newline at end of file
diff --git
a/tests/spec/arb_texture_buffer_object/negative-bad-oom.c
b/tests/spec/arb_texture_buffer_object/negative-bad-oom.c
new file mode 100644
index 0..4841f6a52
--- /dev/null
+++ b/tests/spec/arb_texture_buffer_object/negative-bad-oom.c
@@ -0,0 +1,62 @@
+/* Copyright © 2018 Illia Iorin
+ *
+ * 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 negative-bad-oom.c
+* This test checks  allocat more memory than possible,
+* the glGetError() will return  GL_OUT_OF_MEMORY error flag
+*/
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+       config.supports_gl_compat_version = 31;
+       config.supports_gl_core_version = 31;
+
+       config.window_visual = PIGLIT_GL_VISUAL_DOUBLE |
PIGLIT_GL_VISUAL_RGBA;
+       config.khr_no_error_support = PIGLIT_HAS_ERRORS;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+enum piglit_result
+piglit_display(void)
+{
+       return PIGLIT_FAIL; /* UNREACHED */
+}
+
+
+void
+piglit_init(int argc, char **argv)
+{
+ 

[Piglit] [PATCH] tests: intel_conservative_rasterization: fix invalid draws

2018-07-10 Thread Lionel Landwerlin
In a12310df3bdd0a we realized that
intel_conservative_rasterization-invalid_gles3 was not added to the
test list. Turns out we didn't even run this test on gles.

Although quite a few cases are opengl specific, there are still 2
invalid cases we can verify on gles.

Fixes: a12310df3bdd0a ("tests/opengl: Add 
intel_conservative_rasterization-invalid_gles3")
Signed-off-by: Lionel Landwerlin 
---
 .../intel_conservative_rasterization/invalid.c   | 16 +++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/tests/spec/intel_conservative_rasterization/invalid.c 
b/tests/spec/intel_conservative_rasterization/invalid.c
index 1e7181628..7ae43f664 100644
--- a/tests/spec/intel_conservative_rasterization/invalid.c
+++ b/tests/spec/intel_conservative_rasterization/invalid.c
@@ -35,6 +35,8 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
 
 #if defined(PIGLIT_USE_OPENGL)
config.supports_gl_core_version = 42;
+#elif defined(PIGLIT_USE_OPENGL_ES3)
+   config.supports_gl_es_version = 31;
 #endif
 
 PIGLIT_GL_TEST_CONFIG_END
@@ -52,6 +54,9 @@ void piglit_init(int argc, char **argv)
GLuint prog = piglit_build_simple_program(
 #if defined(PIGLIT_USE_OPENGL)
"#version 330\n"
+#elif defined(PIGLIT_USE_OPENGL_ES3)
+   "#version 310 es\n"
+   "precision highp float;\n"
 #endif
"in vec4 piglit_vertex;\n"
"void main()\n"
@@ -60,8 +65,13 @@ void piglit_init(int argc, char **argv)
"}\n",
 #if defined(PIGLIT_USE_OPENGL)
"#version 330\n"
-   "out vec4 color;\n"
+#elif defined(PIGLIT_USE_OPENGL_ES3)
+   "#version 310 es\n"
+   "precision highp float;\n"
 #endif
+   "\n"
+   "out vec4 color;\n"
+   "\n"
"void main()\n"
"{\n"
"  color = vec4(1.0, 0.0, 0.0, 1.0);\n"
@@ -89,7 +99,9 @@ void piglit_init(int argc, char **argv)
glEnableVertexAttribArray(0);
 
glEnable(GL_CONSERVATIVE_RASTERIZATION_INTEL);
+#ifdef PIGLIT_USE_OPENGL
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+#endif
glClear(GL_COLOR_BUFFER_BIT);
 
glDrawArrays(GL_POINTS, 0, 3);
@@ -100,6 +112,7 @@ void piglit_init(int argc, char **argv)
if (!piglit_check_gl_error(GL_INVALID_OPERATION))
piglit_report_result(PIGLIT_FAIL);
 
+#ifdef PIGLIT_USE_OPENGL
glPolygonMode(GL_FRONT_AND_BACK, GL_POINT);
glDrawArrays(GL_LINES, 0, 3);
if (!piglit_check_gl_error(GL_INVALID_OPERATION))
@@ -109,6 +122,7 @@ void piglit_init(int argc, char **argv)
glDrawArrays(GL_LINES, 0, 3);
if (!piglit_check_gl_error(GL_INVALID_OPERATION))
piglit_report_result(PIGLIT_FAIL);
+#endif
 
piglit_report_result(PIGLIT_PASS);
 }
-- 
2.18.0

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


Re: [Piglit] [PATCH 7/9] tests/opengl: Add intel_conservative_rasterization-invalid_gles3

2018-06-29 Thread Lionel Landwerlin

Reviewed-by: Lionel Landwerlin 

On 27/06/18 18:32, Dylan Baker wrote:

Fixes: ed153b51b57762e43d44e8f49dbe9bf0422e1400
("Add GL_INTEL_conservative_rasterization tests")
CC: Lionel Landwerlin 
---
  tests/opengl.py | 1 +
  1 file changed, 1 insertion(+)

diff --git a/tests/opengl.py b/tests/opengl.py
index a83d235c1..e5addfbb7 100644
--- a/tests/opengl.py
+++ b/tests/opengl.py
@@ -4861,6 +4861,7 @@ with profile.test_list.group_manager(
  g(['intel_conservative_rasterization-tri'])
  g(['intel_conservative_rasterization-depthcoverage_gles3'])
  g(['intel_conservative_rasterization-innercoverage_gles3'])
+g(['intel_conservative_rasterization-invalid_gles3'])
  g(['intel_conservative_rasterization-tri_gles3'])
  
  # Group INTEL_blackhole_render



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


Re: [Piglit] [PATCH 8/9] tests/opengl: Add nv_image_formats-gles3

2018-06-29 Thread Lionel Landwerlin

Reviewed-by: Lionel Landwerlin 

On 27/06/18 18:32, Dylan Baker wrote:

Fixes: 6ed37e5d2a58d36b4b04b09f8c069f2dbcff1968
("Add nv_image_formats tests")
CC: Lionel Landwerlin 
---
  tests/opengl.py | 5 +
  1 file changed, 5 insertions(+)

diff --git a/tests/opengl.py b/tests/opengl.py
index e5addfbb7..bc910ac69 100644
--- a/tests/opengl.py
+++ b/tests/opengl.py
@@ -4893,5 +4893,10 @@ with profile.test_list.group_manager(
grouptools.join('spec', 'ARB_sample_locations')) as g:
  g(['arb_sample_locations'], 'test')
  
+with profile.test_list.group_manager(

+PiglitGLTest,
+grouptools.join('spec', 'NV_image_formats')) as g:
+g(['nv_image_formats-gles3'])
+
  if platform.system() is 'Windows':
  profile.filters.append(lambda p, _: not p.startswith('glx'))



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


Re: [Piglit] [PATCH v2 4/4] getteximage-simple: Stress an i965 blitter path

2018-06-20 Thread Lionel Landwerlin

On 20/06/18 20:49, Nanley Chery wrote:

On Wed, Jun 20, 2018 at 06:32:58PM +0100, Lionel Landwerlin wrote:

On 19/06/18 18:53, Nanley Chery wrote:

On Tue, Jun 19, 2018 at 11:03:17AM +0100, Lionel Landwerlin wrote:

On 18/06/18 19:57, Nanley Chery wrote:

Change the dimension of the texture to test how i965 handles having a
row pitch too large for the BLT engine.

v2: Query the maximum supported texture width (Ilia Mirkin)
---
tests/texturing/getteximage-simple.c | 25 +
1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/tests/texturing/getteximage-simple.c 
b/tests/texturing/getteximage-simple.c
index 525e6a392..5b87b7ccd 100644
--- a/tests/texturing/getteximage-simple.c
+++ b/tests/texturing/getteximage-simple.c
@@ -8,6 +8,10 @@
 * texture images is executed before the readback.
 *
 * This used to crash for R300+bufmgr.
+ *
+ * This also used to stress test the blit methods in i965. The BLT engine only
+ * supports pitch sizes up to but not including 32768 dwords. BLORP supports
+ * even larger sizes.
 */
#include "piglit-util-gl.h"
@@ -21,10 +25,10 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
PIGLIT_GL_TEST_CONFIG_END
-#define MAX_TYPE_VAL UINT8_MAX
-#define PIX_TYPE GLubyte
-#define TEX_TYPE GL_UNSIGNED_BYTE
-#define TEX_INT_FMT GL_RGBA8
+#define MAX_TYPE_VAL 1.0
+#define PIX_TYPE GLfloat
+#define TEX_TYPE GL_FLOAT
+#define TEX_INT_FMT GL_RGBA32F
#define TEX_FMT GL_RGBA
#define CHANNELS_PER_PIXEL 4

This is changing the format of the texture we're testing with.

Yes, a higher resolution format is needed to hit the row pitch of
interest on the older gens which have a max width of 8K.


In patch 3 I thought you wanted to make this configurable (through arguments
to the test maybe?), but this is just switching the format.

In patch 3, I attempted to make the test configurable via a group of
#defines.


Why not add a command line parameter?


I didn't want to add a command line parameter because there didn't seem
to be any benefit to doing so. By changing the format and width, we're
able to continue testing the issue in R300 as well as the teximage
upload and download paths of interest in i965. Thoughts?

Not really, I was just wondering whether that format change would mean that
some driver wouldn't get tested anymore.

Sorry for not mentioning it in the cover letter, but we do lose testing
on i915 which doesn't support GL_ARB_texture_float. I didn't feel bad
about this because it's not actively developed and the test was written
to catch a regression in the R300 driver (which does support the
extension AFACIT). Is that okay with you?


Yeah, I just wasn't sure whether you thought about it :)



-Nanley


I guess it's a common enough format that everybody probably supports it.

Thanks for the explanation :


Reviewed-by: Lionel Landwerlin 


-Nanley


Thanks,

-
Lionel


@@ -42,8 +46,8 @@ static bool test_getteximage(PIX_TYPE *data, size_t 
data_size, GLint w, GLint h)
const unsigned pixel_channel = i % CHANNELS_PER_PIXEL;
printf("GetTexImage() returns incorrect data in element 
%i\n", i);
printf("corresponding to (%i,%i) channel %i\n", 
pixel % w, pixel / w, pixel_channel);
-   printf("expected: %i\n", data[i]);
-   printf("got: %i\n", compare[i]);
+   printf("expected: %f\n", data[i]);
+   printf("got: %f\n", compare[i]);
match = false;
break;
}
@@ -53,11 +57,13 @@ static bool test_getteximage(PIX_TYPE *data, size_t 
data_size, GLint w, GLint h)
return match;
}
+
enum piglit_result
piglit_display(void)
{
-   GLsizei height = 16;
-   GLsizei width = 64;
+   GLsizei height = 2;
+   GLsizei width;
+   glGetIntegerv(GL_MAX_TEXTURE_SIZE, &width);
/* Upload random data to a texture with the given dimensions */
const unsigned data_channels = width * height * CHANNELS_PER_PIXEL;
@@ -94,6 +100,9 @@ piglit_display(void)
void piglit_init(int argc, char **argv)
{
+   if (TEX_TYPE == GL_FLOAT)
+   piglit_require_extension("GL_ARB_texture_float");
+
GLuint tex;
glGenTextures(1, &tex);



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


Re: [Piglit] [PATCH v2 4/4] getteximage-simple: Stress an i965 blitter path

2018-06-20 Thread Lionel Landwerlin

On 19/06/18 18:53, Nanley Chery wrote:

On Tue, Jun 19, 2018 at 11:03:17AM +0100, Lionel Landwerlin wrote:

On 18/06/18 19:57, Nanley Chery wrote:

Change the dimension of the texture to test how i965 handles having a
row pitch too large for the BLT engine.

v2: Query the maximum supported texture width (Ilia Mirkin)
---
   tests/texturing/getteximage-simple.c | 25 +
   1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/tests/texturing/getteximage-simple.c 
b/tests/texturing/getteximage-simple.c
index 525e6a392..5b87b7ccd 100644
--- a/tests/texturing/getteximage-simple.c
+++ b/tests/texturing/getteximage-simple.c
@@ -8,6 +8,10 @@
* texture images is executed before the readback.
*
* This used to crash for R300+bufmgr.
+ *
+ * This also used to stress test the blit methods in i965. The BLT engine only
+ * supports pitch sizes up to but not including 32768 dwords. BLORP supports
+ * even larger sizes.
*/
   #include "piglit-util-gl.h"
@@ -21,10 +25,10 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
   PIGLIT_GL_TEST_CONFIG_END
-#define MAX_TYPE_VAL UINT8_MAX
-#define PIX_TYPE GLubyte
-#define TEX_TYPE GL_UNSIGNED_BYTE
-#define TEX_INT_FMT GL_RGBA8
+#define MAX_TYPE_VAL 1.0
+#define PIX_TYPE GLfloat
+#define TEX_TYPE GL_FLOAT
+#define TEX_INT_FMT GL_RGBA32F
   #define TEX_FMT GL_RGBA
   #define CHANNELS_PER_PIXEL 4

This is changing the format of the texture we're testing with.

Yes, a higher resolution format is needed to hit the row pitch of
interest on the older gens which have a max width of 8K.


In patch 3 I thought you wanted to make this configurable (through arguments
to the test maybe?), but this is just switching the format.

In patch 3, I attempted to make the test configurable via a group of
#defines.


Why not add a command line parameter?


I didn't want to add a command line parameter because there didn't seem
to be any benefit to doing so. By changing the format and width, we're
able to continue testing the issue in R300 as well as the teximage
upload and download paths of interest in i965. Thoughts?


Not really, I was just wondering whether that format change would mean 
that some driver wouldn't get tested anymore.

I guess it's a common enough format that everybody probably supports it.

Thanks for the explanation :


Reviewed-by: Lionel Landwerlin 



-Nanley


Thanks,

-
Lionel


@@ -42,8 +46,8 @@ static bool test_getteximage(PIX_TYPE *data, size_t 
data_size, GLint w, GLint h)
const unsigned pixel_channel = i % CHANNELS_PER_PIXEL;
printf("GetTexImage() returns incorrect data in element 
%i\n", i);
printf("corresponding to (%i,%i) channel %i\n", 
pixel % w, pixel / w, pixel_channel);
-   printf("expected: %i\n", data[i]);
-   printf("got: %i\n", compare[i]);
+   printf("expected: %f\n", data[i]);
+   printf("got: %f\n", compare[i]);
match = false;
break;
}
@@ -53,11 +57,13 @@ static bool test_getteximage(PIX_TYPE *data, size_t 
data_size, GLint w, GLint h)
return match;
   }
+
   enum piglit_result
   piglit_display(void)
   {
-   GLsizei height = 16;
-   GLsizei width = 64;
+   GLsizei height = 2;
+   GLsizei width;
+   glGetIntegerv(GL_MAX_TEXTURE_SIZE, &width);
/* Upload random data to a texture with the given dimensions */
const unsigned data_channels = width * height * CHANNELS_PER_PIXEL;
@@ -94,6 +100,9 @@ piglit_display(void)
   void piglit_init(int argc, char **argv)
   {
+   if (TEX_TYPE == GL_FLOAT)
+   piglit_require_extension("GL_ARB_texture_float");
+
GLuint tex;
glGenTextures(1, &tex);




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


Re: [Piglit] [PATCH v2 4/4] getteximage-simple: Stress an i965 blitter path

2018-06-19 Thread Lionel Landwerlin

On 18/06/18 19:57, Nanley Chery wrote:

Change the dimension of the texture to test how i965 handles having a
row pitch too large for the BLT engine.

v2: Query the maximum supported texture width (Ilia Mirkin)
---
  tests/texturing/getteximage-simple.c | 25 +
  1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/tests/texturing/getteximage-simple.c 
b/tests/texturing/getteximage-simple.c
index 525e6a392..5b87b7ccd 100644
--- a/tests/texturing/getteximage-simple.c
+++ b/tests/texturing/getteximage-simple.c
@@ -8,6 +8,10 @@
   * texture images is executed before the readback.
   *
   * This used to crash for R300+bufmgr.
+ *
+ * This also used to stress test the blit methods in i965. The BLT engine only
+ * supports pitch sizes up to but not including 32768 dwords. BLORP supports
+ * even larger sizes.
   */
  
  #include "piglit-util-gl.h"

@@ -21,10 +25,10 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
  
  PIGLIT_GL_TEST_CONFIG_END
  
-#define MAX_TYPE_VAL UINT8_MAX

-#define PIX_TYPE GLubyte
-#define TEX_TYPE GL_UNSIGNED_BYTE
-#define TEX_INT_FMT GL_RGBA8
+#define MAX_TYPE_VAL 1.0
+#define PIX_TYPE GLfloat
+#define TEX_TYPE GL_FLOAT
+#define TEX_INT_FMT GL_RGBA32F
  #define TEX_FMT GL_RGBA
  #define CHANNELS_PER_PIXEL 4


This is changing the format of the texture we're testing with.
In patch 3 I thought you wanted to make this configurable (through 
arguments to the test maybe?), but this is just switching the format.

Why not add a command line parameter?

Thanks,

-
Lionel

  
@@ -42,8 +46,8 @@ static bool test_getteximage(PIX_TYPE *data, size_t data_size, GLint w, GLint h)

const unsigned pixel_channel = i % CHANNELS_PER_PIXEL;
printf("GetTexImage() returns incorrect data in element 
%i\n", i);
printf("corresponding to (%i,%i) channel %i\n", 
pixel % w, pixel / w, pixel_channel);
-   printf("expected: %i\n", data[i]);
-   printf("got: %i\n", compare[i]);
+   printf("expected: %f\n", data[i]);
+   printf("got: %f\n", compare[i]);
match = false;
break;
}
@@ -53,11 +57,13 @@ static bool test_getteximage(PIX_TYPE *data, size_t 
data_size, GLint w, GLint h)
return match;
  }
  
+

  enum piglit_result
  piglit_display(void)
  {
-   GLsizei height = 16;
-   GLsizei width = 64;
+   GLsizei height = 2;
+   GLsizei width;
+   glGetIntegerv(GL_MAX_TEXTURE_SIZE, &width);
  
  	/* Upload random data to a texture with the given dimensions */

const unsigned data_channels = width * height * CHANNELS_PER_PIXEL;
@@ -94,6 +100,9 @@ piglit_display(void)
  
  void piglit_init(int argc, char **argv)

  {
+   if (TEX_TYPE == GL_FLOAT)
+   piglit_require_extension("GL_ARB_texture_float");
+
GLuint tex;
  
  	glGenTextures(1, &tex);



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


Re: [Piglit] [PATCH v2 0/4] Stress an i965 blitter path

2018-06-19 Thread Lionel Landwerlin

Patches 1 to 3 are :

Reviewed-by: Lionel Landwerlin 

On 18/06/18 19:57, Nanley Chery wrote:

This series modifies getteximage-simple to work on a texture of maximum
width. This enables us to test an existing fallback path for i965 which
changes the texture's tiling to linear. It also enables us to test an
alternative fallback path [1] which keeps the texture's tiling.

This works on all GEN hardware, but on gen4 we run into the floating
point texture values being a tad off. This isn't a new problem as that
platform also fails another floating point teximage test. This test
passes on gen4 if I change the texture to be an integer format. We lose
the interesting pattern if I do so, however. I don't mind changing the
format if people prefer.

1. https://patchwork.freedesktop.org/patch/226092/

Nanley Chery (4):
   getteximage-simple: Fix the coordinate printf
   getteximage-simple: Switch to parameter passing
   getteximage-simple: Allow configurable texture parameters
   getteximage-simple: Stress an i965 blitter path

  tests/texturing/getteximage-simple.c | 64 +++-
  1 file changed, 45 insertions(+), 19 deletions(-)



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


Re: [Piglit] [PATCH piglit] glsl-1.50: fix glsl-1.50-geometry-primitive-types

2018-06-12 Thread Lionel Landwerlin

On 11/06/18 18:38, Eric Engestrom wrote:

ARRAY_SIZE() on a pointer results in `sizeof(pointer) / sizeof(pointer)`,
which means the loop only ever executed the first test.

Effectively revert most of fc189b7ff1160e3adc067 for this file to fix it.

Fixes: fc189b7ff1160e3adc067 "Remove GLenum stringification macros."
Cc: Fabian Bieler 
Cc: Brian Paul 
Signed-off-by: Eric Engestrom 


Reviewed-by: Lionel Landwerlin 


---
  .../execution/geometry/primitive-types.c  | 35 +++
  1 file changed, 20 insertions(+), 15 deletions(-)

diff --git a/tests/spec/glsl-1.50/execution/geometry/primitive-types.c 
b/tests/spec/glsl-1.50/execution/geometry/primitive-types.c
index d243e70251daab331365..4be5332be10753491dfd 100644
--- a/tests/spec/glsl-1.50/execution/geometry/primitive-types.c
+++ b/tests/spec/glsl-1.50/execution/geometry/primitive-types.c
@@ -275,22 +275,27 @@ static const struct test_set
GLenum prim_type;
const char *input_layout;
unsigned vertices_per_prim;
+   unsigned num_test_vectors;
const struct test_vector *test_vectors;
  } tests[] = {
-   { GL_POINTS, "points", 1, points_tests },
-   { GL_LINE_LOOP, "lines", 2, line_loop_tests },
-   { GL_LINE_STRIP, "lines", 2, line_strip_tests },
-   { GL_LINES, "lines", 2, lines_tests },
-   { GL_TRIANGLES, "triangles", 3, triangles_tests },
-   { GL_TRIANGLE_STRIP, "triangles", 3, triangle_strip_tests },
-   { GL_TRIANGLE_FAN, "triangles", 3, triangle_fan_tests },
-   { GL_LINES_ADJACENCY, "lines_adjacency", 4, lines_adjacency_tests },
-   { GL_LINE_STRIP_ADJACENCY, "lines_adjacency", 4,
-   line_strip_adjacency_tests },
-   { GL_TRIANGLES_ADJACENCY, "triangles_adjacency", 6,
-   triangles_adjacency_tests },
-   { GL_TRIANGLE_STRIP_ADJACENCY, "triangles_adjacency", 6,
-   triangle_strip_adjacency_tests },
+#define TEST(prim_type, input_layout, vertices_per_prim, test_array) \
+   { prim_type, input_layout, vertices_per_prim, \
+   ARRAY_SIZE(test_array), test_array }
+   TEST(GL_POINTS, "points", 1, points_tests),
+   TEST(GL_LINE_LOOP, "lines", 2, line_loop_tests),
+   TEST(GL_LINE_STRIP, "lines", 2, line_strip_tests),
+   TEST(GL_LINES, "lines", 2, lines_tests),
+   TEST(GL_TRIANGLES, "triangles", 3, triangles_tests),
+   TEST(GL_TRIANGLE_STRIP, "triangles", 3, triangle_strip_tests),
+   TEST(GL_TRIANGLE_FAN, "triangles", 3, triangle_fan_tests),
+   TEST(GL_LINES_ADJACENCY, "lines_adjacency", 4, lines_adjacency_tests),
+   TEST(GL_LINE_STRIP_ADJACENCY, "lines_adjacency", 4,
+line_strip_adjacency_tests),
+   TEST(GL_TRIANGLES_ADJACENCY, "triangles_adjacency", 6,
+triangles_adjacency_tests),
+   TEST(GL_TRIANGLE_STRIP_ADJACENCY, "triangles_adjacency", 6,
+triangle_strip_adjacency_tests),
+#undef TEST
  };
  
  
@@ -416,7 +421,7 @@ piglit_init(int argc, char **argv)

glGenQueries(1, &generated_query);
glEnable(GL_RASTERIZER_DISCARD);
  
-	for (i = 0; i < ARRAY_SIZE(test->test_vectors); i++) {

+   for (i = 0; i < test->num_test_vectors; i++) {
pass = do_test_vector(test, &test->test_vectors[i]) && pass;
}
  



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


[Piglit] [PATCH v2] tests/egl: add query test for egl_ext_image_dma_buf_import_modifiers

2018-06-07 Thread Lionel Landwerlin
We've been running into crashes in i965 because of a number of issue
throughout the driver stack. This is a really basic tests that list
the formats and their associated modifiers to just catch any
regressions.

v2: by Jason
Use piglit_egl_get_default_display
Drop printf
Properly check the required EGL version

Signed-off-by: Lionel Landwerlin 
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106642
---
 tests/egl/spec/CMakeLists.txt |   1 +
 .../CMakeLists.no_api.txt |   7 +
 .../CMakeLists.txt|   1 +
 .../query_format_modifiers.c  | 148 ++
 tests/opengl.py   |   6 +
 5 files changed, 163 insertions(+)
 create mode 100644 
tests/egl/spec/egl_ext_image_dma_buf_import_modifiers/CMakeLists.no_api.txt
 create mode 100644 
tests/egl/spec/egl_ext_image_dma_buf_import_modifiers/CMakeLists.txt
 create mode 100644 
tests/egl/spec/egl_ext_image_dma_buf_import_modifiers/query_format_modifiers.c

diff --git a/tests/egl/spec/CMakeLists.txt b/tests/egl/spec/CMakeLists.txt
index 66d76db60..772f8258a 100644
--- a/tests/egl/spec/CMakeLists.txt
+++ b/tests/egl/spec/CMakeLists.txt
@@ -2,6 +2,7 @@ add_subdirectory (egl-1.4)
 add_subdirectory (egl_ext_client_extensions)
 add_subdirectory (egl_ext_device_query)
 add_subdirectory (egl_ext_device_enumeration)
+add_subdirectory (egl_ext_image_dma_buf_import_modifiers)
 add_subdirectory (egl_khr_create_context)
 add_subdirectory (egl_khr_get_all_proc_addresses)
 add_subdirectory (egl_khr_gl_image)
diff --git 
a/tests/egl/spec/egl_ext_image_dma_buf_import_modifiers/CMakeLists.no_api.txt 
b/tests/egl/spec/egl_ext_image_dma_buf_import_modifiers/CMakeLists.no_api.txt
new file mode 100644
index 0..f6b672e44
--- /dev/null
+++ 
b/tests/egl/spec/egl_ext_image_dma_buf_import_modifiers/CMakeLists.no_api.txt
@@ -0,0 +1,7 @@
+link_libraries(
+   piglitutil
+)
+
+piglit_add_executable(egl_ext_image_dma_buf_import_modifiers-query 
query_format_modifiers.c)
+
+# vim: ft=cmake:
diff --git 
a/tests/egl/spec/egl_ext_image_dma_buf_import_modifiers/CMakeLists.txt 
b/tests/egl/spec/egl_ext_image_dma_buf_import_modifiers/CMakeLists.txt
new file mode 100644
index 0..144a306f4
--- /dev/null
+++ b/tests/egl/spec/egl_ext_image_dma_buf_import_modifiers/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git 
a/tests/egl/spec/egl_ext_image_dma_buf_import_modifiers/query_format_modifiers.c
 
b/tests/egl/spec/egl_ext_image_dma_buf_import_modifiers/query_format_modifiers.c
new file mode 100644
index 0..0d4b0e2b4
--- /dev/null
+++ 
b/tests/egl/spec/egl_ext_image_dma_buf_import_modifiers/query_format_modifiers.c
@@ -0,0 +1,148 @@
+/*
+ * Copyright 2018 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.h"
+#include "piglit-util-egl.h"
+
+int
+main(int argc, char *argv[])
+{
+   EGLDisplay dpy;
+   EGLBoolean (*peglQueryDmaBufFormatsEXT)(EGLDisplay dpy,
+   EGLint max_formats,
+   EGLint *formats,
+   EGLint *num_formats);
+   EGLBoolean (*peglQueryDmaBufModifiersEXT)(EGLDisplay dpy,
+ EGLint format,
+ EGLint max_modifiers,
+ EGLuint64KHR *modifiers,
+ EGLBoolean *external_only,
+ EGLint *num_modifiers);
+   EGLint f, n_formats, *formats, rand_format, n_modifiers;
+   EGLint egl_major, egl_minor;
+   EGLBoolean ret;
+   bool in_list;
+
+   /* Strip common piglit args. *

Re: [Piglit] [PATCH] tests/egl: add query test for egl_ext_image_dma_buf_import_modifiers

2018-06-07 Thread Lionel Landwerlin

On 07/06/18 17:22, Jason Ekstrand wrote:
On Thu, Jun 7, 2018 at 7:16 AM, Lionel Landwerlin 
mailto:lionel.g.landwer...@intel.com>> 
wrote:


We've been running into crashes in i965 because of a number of issue
throughout the driver stack. This is a really basic tests that list
the formats and their associated modifiers to just catch any
regressions.

Signed-off-by: Lionel Landwerlin mailto:lionel.g.landwer...@intel.com>>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106642
<https://bugs.freedesktop.org/show_bug.cgi?id=106642>
---
 tests/egl/spec/CMakeLists.txt                 |   1 +
 .../CMakeLists.no_api.txt                     |   7 +
 .../CMakeLists.txt                            |   1 +
 .../query_format_modifiers.c                  | 148
++
 tests/opengl.py                               |   6 +
 5 files changed, 163 insertions(+)
 create mode 100644
tests/egl/spec/egl_ext_image_dma_buf_import_modifiers/CMakeLists.no_api.txt
 create mode 100644
tests/egl/spec/egl_ext_image_dma_buf_import_modifiers/CMakeLists.txt
 create mode 100644

tests/egl/spec/egl_ext_image_dma_buf_import_modifiers/query_format_modifiers.c

diff --git a/tests/egl/spec/CMakeLists.txt
b/tests/egl/spec/CMakeLists.txt
index 66d76db60..772f8258a 100644
--- a/tests/egl/spec/CMakeLists.txt
+++ b/tests/egl/spec/CMakeLists.txt
@@ -2,6 +2,7 @@ add_subdirectory (egl-1.4)
 add_subdirectory (egl_ext_client_extensions)
 add_subdirectory (egl_ext_device_query)
 add_subdirectory (egl_ext_device_enumeration)
+add_subdirectory (egl_ext_image_dma_buf_import_modifiers)
 add_subdirectory (egl_khr_create_context)
 add_subdirectory (egl_khr_get_all_proc_addresses)
 add_subdirectory (egl_khr_gl_image)
diff --git

a/tests/egl/spec/egl_ext_image_dma_buf_import_modifiers/CMakeLists.no_api.txt

b/tests/egl/spec/egl_ext_image_dma_buf_import_modifiers/CMakeLists.no_api.txt
new file mode 100644
index 0..f6b672e44
--- /dev/null
+++

b/tests/egl/spec/egl_ext_image_dma_buf_import_modifiers/CMakeLists.no_api.txt
@@ -0,0 +1,7 @@
+link_libraries(
+       piglitutil
+)
+
+piglit_add_executable(egl_ext_image_dma_buf_import_modifiers-query
query_format_modifiers.c)
+
+# vim: ft=cmake:
diff --git
a/tests/egl/spec/egl_ext_image_dma_buf_import_modifiers/CMakeLists.txt
b/tests/egl/spec/egl_ext_image_dma_buf_import_modifiers/CMakeLists.txt
new file mode 100644
index 0..144a306f4
--- /dev/null
+++
b/tests/egl/spec/egl_ext_image_dma_buf_import_modifiers/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git

a/tests/egl/spec/egl_ext_image_dma_buf_import_modifiers/query_format_modifiers.c

b/tests/egl/spec/egl_ext_image_dma_buf_import_modifiers/query_format_modifiers.c
new file mode 100644
index 0..d58886654
--- /dev/null
+++

b/tests/egl/spec/egl_ext_image_dma_buf_import_modifiers/query_format_modifiers.c
@@ -0,0 +1,148 @@
+/*
+ * Copyright 2018 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.h"
+#include "piglit-util-egl.h"
+
+int
+main(int argc, char *argv[])
+{
+       EGLDisplay dpy;
+       EGLBoolean (*peglQueryDmaBufFormatsEXT)(EGLDisplay dpy,
+                                               EGLint max_formats,
+                                               EGLint *formats,
+                                               EGLint *num_formats);
+       EGLBoolean (*pe

Re: [Piglit] [PATCH 1/8] README: Move README.md so it gets parsed by GitLab

2018-06-07 Thread Lionel Landwerlin

Not a markdown expert but this series looks good to me :

Acked-by: Lionel Landwerlin 

On 07/06/18 17:03, Jason Ekstrand wrote:

---
  README => README.md | 0
  1 file changed, 0 insertions(+), 0 deletions(-)
  rename README => README.md (100%)

diff --git a/README b/README.md
similarity index 100%
rename from README
rename to README.md



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


[Piglit] [PATCH] tests/egl: add query test for egl_ext_image_dma_buf_import_modifiers

2018-06-07 Thread Lionel Landwerlin
We've been running into crashes in i965 because of a number of issue
throughout the driver stack. This is a really basic tests that list
the formats and their associated modifiers to just catch any
regressions.

Signed-off-by: Lionel Landwerlin 
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106642
---
 tests/egl/spec/CMakeLists.txt |   1 +
 .../CMakeLists.no_api.txt |   7 +
 .../CMakeLists.txt|   1 +
 .../query_format_modifiers.c  | 148 ++
 tests/opengl.py   |   6 +
 5 files changed, 163 insertions(+)
 create mode 100644 
tests/egl/spec/egl_ext_image_dma_buf_import_modifiers/CMakeLists.no_api.txt
 create mode 100644 
tests/egl/spec/egl_ext_image_dma_buf_import_modifiers/CMakeLists.txt
 create mode 100644 
tests/egl/spec/egl_ext_image_dma_buf_import_modifiers/query_format_modifiers.c

diff --git a/tests/egl/spec/CMakeLists.txt b/tests/egl/spec/CMakeLists.txt
index 66d76db60..772f8258a 100644
--- a/tests/egl/spec/CMakeLists.txt
+++ b/tests/egl/spec/CMakeLists.txt
@@ -2,6 +2,7 @@ add_subdirectory (egl-1.4)
 add_subdirectory (egl_ext_client_extensions)
 add_subdirectory (egl_ext_device_query)
 add_subdirectory (egl_ext_device_enumeration)
+add_subdirectory (egl_ext_image_dma_buf_import_modifiers)
 add_subdirectory (egl_khr_create_context)
 add_subdirectory (egl_khr_get_all_proc_addresses)
 add_subdirectory (egl_khr_gl_image)
diff --git 
a/tests/egl/spec/egl_ext_image_dma_buf_import_modifiers/CMakeLists.no_api.txt 
b/tests/egl/spec/egl_ext_image_dma_buf_import_modifiers/CMakeLists.no_api.txt
new file mode 100644
index 0..f6b672e44
--- /dev/null
+++ 
b/tests/egl/spec/egl_ext_image_dma_buf_import_modifiers/CMakeLists.no_api.txt
@@ -0,0 +1,7 @@
+link_libraries(
+   piglitutil
+)
+
+piglit_add_executable(egl_ext_image_dma_buf_import_modifiers-query 
query_format_modifiers.c)
+
+# vim: ft=cmake:
diff --git 
a/tests/egl/spec/egl_ext_image_dma_buf_import_modifiers/CMakeLists.txt 
b/tests/egl/spec/egl_ext_image_dma_buf_import_modifiers/CMakeLists.txt
new file mode 100644
index 0..144a306f4
--- /dev/null
+++ b/tests/egl/spec/egl_ext_image_dma_buf_import_modifiers/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git 
a/tests/egl/spec/egl_ext_image_dma_buf_import_modifiers/query_format_modifiers.c
 
b/tests/egl/spec/egl_ext_image_dma_buf_import_modifiers/query_format_modifiers.c
new file mode 100644
index 0..d58886654
--- /dev/null
+++ 
b/tests/egl/spec/egl_ext_image_dma_buf_import_modifiers/query_format_modifiers.c
@@ -0,0 +1,148 @@
+/*
+ * Copyright 2018 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.h"
+#include "piglit-util-egl.h"
+
+int
+main(int argc, char *argv[])
+{
+   EGLDisplay dpy;
+   EGLBoolean (*peglQueryDmaBufFormatsEXT)(EGLDisplay dpy,
+   EGLint max_formats,
+   EGLint *formats,
+   EGLint *num_formats);
+   EGLBoolean (*peglQueryDmaBufModifiersEXT)(EGLDisplay dpy,
+ EGLint format,
+ EGLint max_modifiers,
+ EGLuint64KHR *modifiers,
+ EGLBoolean *external_only,
+ EGLint *num_modifiers);
+   EGLint f, n_formats, *formats, rand_format, n_modifiers;
+   EGLint egl_major, egl_minor;
+   EGLBoolean ret;
+   bool in_list;
+
+   /* Strip common piglit args. */
+   piglit_strip_arg(&argc, argv, "-fbo");
+   piglit_strip_arg(&argc, argv, "-auto&quo

Re: [Piglit] [PATCH 2/2] Specify an explicit window size in builtin uniform tests.

2018-05-16 Thread Lionel Landwerlin

Reviewed-by: Lionel Landwerlin 

On 10/05/18 00:12, Kenneth Graunke wrote:

Currently, these tests assume a 250x250 window size, but don't specify
SIZE 250x250, which means they can break when using PIGLIT_DEFAULT_SIZE.

The tests draw multiple 4x4 rectangles side by side, and lay them out
based on the window size.  We bump the window width to 256 so that it's
a multiple of 4, and shrink y to fit the number of rows.
---
  generated_tests/gen_builtin_uniform_tests.py | 17 +
  1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/generated_tests/gen_builtin_uniform_tests.py 
b/generated_tests/gen_builtin_uniform_tests.py
index ac09a64fc..8001f7123 100644
--- a/generated_tests/gen_builtin_uniform_tests.py
+++ b/generated_tests/gen_builtin_uniform_tests.py
@@ -48,6 +48,7 @@ from __future__ import print_function, division, 
absolute_import
  from builtin_function import *
  import abc
  import numpy
+import math
  import optparse
  import os
  import os.path
@@ -357,15 +358,14 @@ class ShaderTest(object):
  # Size of the rectangles drawn by the test.
  self.rect_width = 4
  self.rect_height = 4
-# shader_runner currently defaults to a 250x250 window.  We
-# could reduce window size to cut test time, but there are
-# platform-dependent limits we haven't really characterized
-# (smaller on Linux than Windows, but still present in some
-# window managers).
-self.win_width = 250
-self.win_height = 250
+
+# Use a 256xN window.  Make it at least 160 pixels tall to avoid
+# window manager issues with small window sizes (see comments in
+# piglit_gl_test_config_init() for details).
+self.win_width = 256
  self.tests_per_row = (self.win_width // self.rect_width)
-self.test_rows = (self.win_height // self.rect_height)
+self.test_rows = math.ceil(len(test_vectors) / self.tests_per_row)
+self.win_height = max(self.test_rows * self.rect_height, 160)
  
  if use_if:

  self._comparator = BoolIfComparator(signature)
@@ -560,6 +560,7 @@ class ShaderTest(object):
  shader_test = '[require]\n'
  shader_test += 'GLSL >= {0:1.2f}\n'.format(
  float(self.glsl_version()) / 100)
+shader_test += 'SIZE {0}x{1}'.format(self.win_width, self.win_height)
  for extension in self.extensions():
  shader_test += 'GL_{}\n'.format(extension)
  shader_test += self.make_additional_requirements()



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


Re: [Piglit] [PATCH 1/2] Fix bogus assertions in builtin uniform test generator.

2018-05-16 Thread Lionel Landwerlin

Reviewed-by: Lionel Landwerlin 

On 10/05/18 00:12, Kenneth Graunke wrote:

self.test_rows is measured in a number of 4x4 rectangles, but y is
measured in pixels, so they are not comparable.  The only reason this
doesn't trip is because self.test_rows is currently the number of 4x4
rectangles that can fit in a 250x250 window (62)...and no test has
nearly that many rows of rectangles.

Instead, just assert y fits in the window height.
---
  generated_tests/gen_builtin_uniform_tests.py | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/generated_tests/gen_builtin_uniform_tests.py 
b/generated_tests/gen_builtin_uniform_tests.py
index 50cced444..ac09a64fc 100644
--- a/generated_tests/gen_builtin_uniform_tests.py
+++ b/generated_tests/gen_builtin_uniform_tests.py
@@ -386,7 +386,7 @@ class ShaderTest(object):
  def draw_command(self, test_num):
  x = (test_num % self.tests_per_row) * self.rect_width
  y = (test_num // self.tests_per_row) * self.rect_height
-assert(y < self.test_rows)
+assert(y + self.rect_height <= self.win_height)
  return 'draw rect ortho {0} {1} {2} {3}\n'.format(x, y,
self.rect_width,
self.rect_height)
@@ -662,7 +662,7 @@ class TessellationShaderTest(ShaderTest):
  def draw_command(self, test_num):
  x = (test_num % self.tests_per_row) * self.rect_width
  y = (test_num // self.tests_per_row) * self.rect_height
-assert(y < self.test_rows)
+assert(y + self.rect_height <= self.win_height)
  return 'draw rect ortho patch {0} {1} {2} {3}\n'.format(x, y,
  
self.rect_width,
  
self.rect_height)



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


Re: [Piglit] [PATCH] tests: intel_blackhole_render: use GLSL ES 1.0 on ES profiles

2018-04-09 Thread Lionel Landwerlin

On 09/04/18 16:16, Tapani Pälli wrote:

One nit that you can consider below ..

Reviewed-by: Tapani Pälli 

On 09.04.2018 14:00, Lionel Landwerlin wrote:

Not all of our platforms support GLSL ES 3.0 so extend the coverage by
lowering the GLSL requirements.

Signed-off-by: Lionel Landwerlin 
---
  tests/spec/intel_blackhole_render/blackhole_draw.c | 9 +
  1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tests/spec/intel_blackhole_render/blackhole_draw.c 
b/tests/spec/intel_blackhole_render/blackhole_draw.c

index 32249c8a7..cbabffc0c 100644
--- a/tests/spec/intel_blackhole_render/blackhole_draw.c
+++ b/tests/spec/intel_blackhole_render/blackhole_draw.c
@@ -54,10 +54,11 @@ piglit_display(void)
  prog = piglit_build_simple_program(
  #if defined(PIGLIT_USE_OPENGL)
  "#version 330\n"
+    "in vec4 piglit_vertex;\n"
  #elif defined(PIGLIT_USE_OPENGL_ES2) || defined(PIGLIT_USE_OPENGL_ES3)
-    "#version 300 es\n"
+    "#version 100\n"
+    "attribute vec4 piglit_vertex;\n"
  #endif
-    "in vec4 piglit_vertex;\n"
  "void main()\n"
  "{\n"
  "  gl_Position = piglit_vertex;\n"
@@ -66,8 +67,8 @@ piglit_display(void)
  "#version 330\n"
  "out vec4 color;\n"
  #elif defined(PIGLIT_USE_OPENGL_ES2) || defined(PIGLIT_USE_OPENGL_ES3)
-    "#version 300 es\n"
-    "out highp vec4 color;\n"
+    "#version 100\n"
+    "#define color gl_FragColor\n"


Maybe just use gl_FragColor below?


Sure, thanks!




  #endif
  "void main()\n"
  "{\n"





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


[Piglit] [PATCH] tests: intel_blackhole_render: use GLSL ES 1.0 on ES profiles

2018-04-09 Thread Lionel Landwerlin
Not all of our platforms support GLSL ES 3.0 so extend the coverage by
lowering the GLSL requirements.

Signed-off-by: Lionel Landwerlin 
---
 tests/spec/intel_blackhole_render/blackhole_draw.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tests/spec/intel_blackhole_render/blackhole_draw.c 
b/tests/spec/intel_blackhole_render/blackhole_draw.c
index 32249c8a7..cbabffc0c 100644
--- a/tests/spec/intel_blackhole_render/blackhole_draw.c
+++ b/tests/spec/intel_blackhole_render/blackhole_draw.c
@@ -54,10 +54,11 @@ piglit_display(void)
prog = piglit_build_simple_program(
 #if defined(PIGLIT_USE_OPENGL)
"#version 330\n"
+   "in vec4 piglit_vertex;\n"
 #elif defined(PIGLIT_USE_OPENGL_ES2) || defined(PIGLIT_USE_OPENGL_ES3)
-   "#version 300 es\n"
+   "#version 100\n"
+   "attribute vec4 piglit_vertex;\n"
 #endif
-   "in vec4 piglit_vertex;\n"
"void main()\n"
"{\n"
"  gl_Position = piglit_vertex;\n"
@@ -66,8 +67,8 @@ piglit_display(void)
"#version 330\n"
"out vec4 color;\n"
 #elif defined(PIGLIT_USE_OPENGL_ES2) || defined(PIGLIT_USE_OPENGL_ES3)
-   "#version 300 es\n"
-   "out highp vec4 color;\n"
+   "#version 100\n"
+   "#define color gl_FragColor\n"
 #endif
"void main()\n"
"{\n"
-- 
2.17.0

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


[Piglit] [PATCH 2/3] tests: intel_blackhole_render: require extension in dispatch test

2018-04-06 Thread Lionel Landwerlin
Fixes: c8d89e733c52a6 ("tests: add INTEL_blackhole_render")
Signed-off-by: Lionel Landwerlin 
---
 tests/spec/intel_blackhole_render/blackhole_dispatch.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/spec/intel_blackhole_render/blackhole_dispatch.c 
b/tests/spec/intel_blackhole_render/blackhole_dispatch.c
index 27ad73375..222358afa 100644
--- a/tests/spec/intel_blackhole_render/blackhole_dispatch.c
+++ b/tests/spec/intel_blackhole_render/blackhole_dispatch.c
@@ -73,6 +73,7 @@ piglit_init(int argc, char **argv)
const float one = 1.0f;
 
piglit_require_extension("GL_ARB_compute_shader");
+   piglit_require_extension("GL_INTEL_blackhole_render");
 
data_buf = calloc(SIZE_X, sizeof(*data_buf));
glGenBuffers(1, &data_bo);
-- 
2.17.0

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


[Piglit] [PATCH 0/3] tests: intel blackhole render fixes

2018-04-06 Thread Lionel Landwerlin
Hi,

I've made a few mistake when sending the initial patch. I'm not quite
sure how I missed them :(

Thanks,

Lionel Landwerlin (3):
  tests: fix INTEL_blackhole_render test names
  tests: intel_blackhole_render: require extension in dispatch test
  tests: nv_image_formats: remove unintended new files

 tests/all.py   | 8 
 tests/spec/intel_blackhole_render/blackhole_dispatch.c | 1 +
 tests/spec/nv_image_formats/CMakeLists.gl.txt  | 8 
 3 files changed, 5 insertions(+), 12 deletions(-)
 delete mode 100644 tests/spec/nv_image_formats/CMakeLists.gl.txt

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


[Piglit] [PATCH 1/3] tests: fix INTEL_blackhole_render test names

2018-04-06 Thread Lionel Landwerlin
Fixes: c8d89e733c52a6 ("tests: add INTEL_blackhole_render")
Signed-off-by: Lionel Landwerlin 
---
 tests/all.py | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/all.py b/tests/all.py
index 39ad46926..26638cd82 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4978,10 +4978,10 @@ with profile.test_list.group_manager(
 with profile.test_list.group_manager(
 PiglitGLTest,
 grouptools.join('spec', 'INTEL_blackhole_render')) as g:
-g(['intel_conservative_rasterization-draw'])
-g(['intel_conservative_rasterization-dispatch'])
-g(['intel_conservative_rasterization-draw_gles2'])
-g(['intel_conservative_rasterization-draw_gles3'])
+g(['intel_blackhole-draw'])
+g(['intel_blackhole-dispatch'])
+g(['intel_blackhole-draw_gles2'])
+g(['intel_blackhole-draw_gles3'])
 
 # Group ARB_bindless_texture
 with profile.test_list.group_manager(
-- 
2.17.0

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


[Piglit] [PATCH 3/3] tests: nv_image_formats: remove unintended new files

2018-04-06 Thread Lionel Landwerlin
This file was added by mistake.

Fixes: c8d89e733c52a6 ("tests: add INTEL_blackhole_render")
Signed-off-by: Lionel Landwerlin 
---
 tests/spec/nv_image_formats/CMakeLists.gl.txt | 8 
 1 file changed, 8 deletions(-)
 delete mode 100644 tests/spec/nv_image_formats/CMakeLists.gl.txt

diff --git a/tests/spec/nv_image_formats/CMakeLists.gl.txt 
b/tests/spec/nv_image_formats/CMakeLists.gl.txt
deleted file mode 100644
index ef1b22d5e..0
--- a/tests/spec/nv_image_formats/CMakeLists.gl.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-link_libraries(
-   piglitutil_${piglit_target_api}
-   ${OPENGL_gl_LIBRARY}
-   )
-
-piglit_add_executable (nv_image_formats copy-image-formats.c)
-
-# vim: ft=cmake:
-- 
2.17.0

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


Re: [Piglit] [PATCH] tests: add INTEL_blackhole_render

2018-03-16 Thread Lionel Landwerlin

On 16/03/18 07:31, Alejandro Piñeiro wrote:

Is adding ${OPENGL_gl_LIBRARY} at link_libraries really needed at this
gles CMakeKist? As far as I have seen, most gles2/3 CMakeLists just adds
piglitutil_${piglit_target_api}.

Looks like I can drop it from the GL tests too and it still links... 
Does that make sense? :)


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


[Piglit] [PATCH] tests: add INTEL_blackhole_render

2018-03-15 Thread Lionel Landwerlin
Signed-off-by: Lionel Landwerlin 
---
 registry/gl.xml|   8 +-
 tests/all.py   |   9 ++
 tests/spec/CMakeLists.txt  |   1 +
 .../spec/intel_blackhole_render/CMakeLists.gl.txt  |  14 ++
 .../intel_blackhole_render/CMakeLists.gles2.txt|  13 ++
 .../intel_blackhole_render/CMakeLists.gles3.txt|  13 ++
 tests/spec/intel_blackhole_render/CMakeLists.txt   |   1 +
 .../intel_blackhole_render/blackhole_dispatch.c| 127 +
 tests/spec/intel_blackhole_render/blackhole_draw.c | 156 +
 tests/spec/nv_image_formats/CMakeLists.gl.txt  |   8 ++
 10 files changed, 349 insertions(+), 1 deletion(-)
 create mode 100644 tests/spec/intel_blackhole_render/CMakeLists.gl.txt
 create mode 100644 tests/spec/intel_blackhole_render/CMakeLists.gles2.txt
 create mode 100644 tests/spec/intel_blackhole_render/CMakeLists.gles3.txt
 create mode 100644 tests/spec/intel_blackhole_render/CMakeLists.txt
 create mode 100644 tests/spec/intel_blackhole_render/blackhole_dispatch.c
 create mode 100644 tests/spec/intel_blackhole_render/blackhole_draw.c
 create mode 100644 tests/spec/nv_image_formats/CMakeLists.gl.txt

diff --git a/registry/gl.xml b/registry/gl.xml
index 7b13ff907..3c371905d 100644
--- a/registry/gl.xml
+++ b/registry/gl.xml
@@ -4518,7 +4518,8 @@ typedef unsigned int GLhandleARB;
 
 
 
-
+
+
 
 
 
@@ -44054,6 +44055,11 @@ typedef unsigned int GLhandleARB;
 
 
 
+
+
+
+
+
 
 
 
diff --git a/tests/all.py b/tests/all.py
index 8c5877a63..c30a5dfdb 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4971,6 +4971,15 @@ with profile.test_list.group_manager(
 g(['intel_conservative_rasterization-innercoverage_gles3'])
 g(['intel_conservative_rasterization-tri_gles3'])
 
+# Group INTEL_blackhole_render
+with profile.test_list.group_manager(
+PiglitGLTest,
+grouptools.join('spec', 'INTEL_blackhole_render')) as g:
+g(['intel_conservative_rasterization-draw'])
+g(['intel_conservative_rasterization-dispatch'])
+g(['intel_conservative_rasterization-draw_gles2'])
+g(['intel_conservative_rasterization-draw_gles3'])
+
 # Group ARB_bindless_texture
 with profile.test_list.group_manager(
PiglitGLTest,
diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index e57e8d703..dc14beb4e 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -177,3 +177,4 @@ add_subdirectory (arb_post_depth_coverage)
 add_subdirectory (arb_fragment_shader_interlock)
 add_subdirectory (ext_occlusion_query_boolean)
 add_subdirectory (ext_disjoint_timer_query)
+add_subdirectory (intel_blackhole_render)
diff --git a/tests/spec/intel_blackhole_render/CMakeLists.gl.txt 
b/tests/spec/intel_blackhole_render/CMakeLists.gl.txt
new file mode 100644
index 0..379fc5f9a
--- /dev/null
+++ b/tests/spec/intel_blackhole_render/CMakeLists.gl.txt
@@ -0,0 +1,14 @@
+include_directories(
+   ${GLEXT_INCLUDE_DIR}
+   ${OPENGL_INCLUDE_PATH}
+)
+
+link_libraries (
+   piglitutil_${piglit_target_api}
+   ${OPENGL_gl_LIBRARY}
+)
+
+piglit_add_executable (intel_blackhole-dispatch blackhole_dispatch.c)
+piglit_add_executable (intel_blackhole-draw blackhole_draw.c)
+
+# vim: ft=cmake:
diff --git a/tests/spec/intel_blackhole_render/CMakeLists.gles2.txt 
b/tests/spec/intel_blackhole_render/CMakeLists.gles2.txt
new file mode 100644
index 0..076c559d5
--- /dev/null
+++ b/tests/spec/intel_blackhole_render/CMakeLists.gles2.txt
@@ -0,0 +1,13 @@
+include_directories(
+   ${GLEXT_INCLUDE_DIR}
+   ${OPENGL_INCLUDE_PATH}
+)
+
+link_libraries (
+   piglitutil_${piglit_target_api}
+   ${OPENGL_gl_LIBRARY}
+)
+
+piglit_add_executable (intel_blackhole-draw_gles2 blackhole_draw.c)
+
+# vim: ft=cmake:
diff --git a/tests/spec/intel_blackhole_render/CMakeLists.gles3.txt 
b/tests/spec/intel_blackhole_render/CMakeLists.gles3.txt
new file mode 100644
index 0..f0b912d99
--- /dev/null
+++ b/tests/spec/intel_blackhole_render/CMakeLists.gles3.txt
@@ -0,0 +1,13 @@
+include_directories(
+   ${GLEXT_INCLUDE_DIR}
+   ${OPENGL_INCLUDE_PATH}
+)
+
+link_libraries (
+   piglitutil_${piglit_target_api}
+   ${OPENGL_gl_LIBRARY}
+)
+
+piglit_add_executable (intel_blackhole-draw_gles3 blackhole_draw.c)
+
+# vim: ft=cmake:
diff --git a/tests/spec/intel_blackhole_render/CMakeLists.txt 
b/tests/spec/intel_blackhole_render/CMakeLists.txt
new file mode 100644
index 0..144a306f4
--- /dev/null
+++ b/tests/spec/intel_blackhole_render/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git a/tests/spec/intel_blackhole_render/blackhole_dispatch.c 
b/tests/spec/

Re: [Piglit] [PATCH] crucible: fix m32 build errors due to formatting for uint64 and size_t

2017-12-07 Thread Lionel Landwerlin

Reviewed-by: Lionel Landwerlin 

On 07/12/17 02:49, Clayton Craft wrote:

This fixes compile errors when building crucible for m32 targets, mainly
that %lu means something different on m32 than it does on m64.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104149
---
  src/framework/test/t_phase_setup.c | 12 +++-
  1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/framework/test/t_phase_setup.c 
b/src/framework/test/t_phase_setup.c
index 571c744..4a99d1e 100644
--- a/src/framework/test/t_phase_setup.c
+++ b/src/framework/test/t_phase_setup.c
@@ -19,6 +19,8 @@
  // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
DEALINGS
  // IN THE SOFTWARE.
  
+#define __STDC_FORMAT_MACROS

+#include 
  #include "test.h"
  #include "t_phase_setup.h"
  
@@ -309,25 +311,25 @@ static VkBool32 debug_cb(VkDebugReportFlagsEXT flags,

  void *pUserData)
  {
  if (flags & VK_DEBUG_REPORT_INFORMATION_BIT_EXT)
-logi("object %lu type 0x%x location %lu code %u layer \"%s\" msg %s",
+logi("object %"PRIu64" type 0x%x location %zu code %u layer \"%s\" msg 
%s",
   object, objectType, location, messageCode, pLayerPrefix, 
pMessage);
  
  if (flags & VK_DEBUG_REPORT_WARNING_BIT_EXT)

-logw("object %lu type 0x%x location %lu code %u layer \"%s\" msg %s",
+logw("object %"PRIu64" type 0x%x location %zu code %u layer \"%s\" msg 
%s",
   object, objectType, location, messageCode, pLayerPrefix, 
pMessage);
  
  if (flags & VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT)

-logw("object %lu type 0x%x location %lu code %u layer \"%s\" msg %s",
+logw("object %"PRIu64" type 0x%x location %zu code %u layer \"%s\" msg 
%s",
   object, objectType, location, messageCode, pLayerPrefix, 
pMessage);
  
  if (flags & VK_DEBUG_REPORT_ERROR_BIT_EXT)

-loge("object %lu type 0x%x location %lu code %u layer \"%s\" msg %s",
+loge("object %"PRIu64" type 0x%x location %zu code %u layer \"%s\" msg 
%s",
   object, objectType, location, messageCode, pLayerPrefix, 
pMessage);
  
  /* We don't want to spam the logs in case both debug and info bit set. */

  if (flags & VK_DEBUG_REPORT_DEBUG_BIT_EXT &&
 !flags & VK_DEBUG_REPORT_INFORMATION_BIT_EXT)
-logd("object %lu type 0x%x location %lu code %u layer \"%s\" msg %s",
+logd("object %"PRIu64" type 0x%x location %zu code %u layer \"%s\" msg 
%s",
   object, objectType, location, messageCode, pLayerPrefix, 
pMessage);
  
  return false;



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


Re: [Piglit] [PATCH] arb_get_program_binary: check correctly got_error

2017-05-30 Thread Lionel Landwerlin

Reviewed-by: Lionel Landwerlin 

On 29/05/17 16:18, Juan A. Suarez Romero wrote:

Seems it was checking if *not* error got, instead of the other way
around.

Suggested-by: Fabio Lagalla
Signed-off-by: Juan A. Suarez Romero 
---
  tests/spec/arb_get_program_binary/retrievable_hint.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/spec/arb_get_program_binary/retrievable_hint.c 
b/tests/spec/arb_get_program_binary/retrievable_hint.c
index 8283c5b..9263a89 100644
--- a/tests/spec/arb_get_program_binary/retrievable_hint.c
+++ b/tests/spec/arb_get_program_binary/retrievable_hint.c
@@ -79,7 +79,7 @@ piglit_init(int argc, char **argv)
 */
value = 0xDEADBEEF;
glGetProgramiv(prog, GL_PROGRAM_BINARY_RETRIEVABLE_HINT, &value);
-   got_error = piglit_check_gl_error(0);
+   got_error = !piglit_check_gl_error(0);
  
  	if (!got_error) {

if (value == 0xDEADBEEF) {



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


Re: [Piglit] [PATCH] arb_fragment_shader_interlock: fix MinGW build

2017-04-27 Thread Lionel Landwerlin

Reviewed-by: Lionel Landwerlin 

On 27/04/17 19:25, Brian Paul wrote:

uint isn't a standard type.  GLuint would be another possibility.
Untested.
---
  .../arb_fragment_shader_interlock/image-load-store.c | 16 
  1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/tests/spec/arb_fragment_shader_interlock/image-load-store.c 
b/tests/spec/arb_fragment_shader_interlock/image-load-store.c
index 390ffb2..597bcf7 100644
--- a/tests/spec/arb_fragment_shader_interlock/image-load-store.c
+++ b/tests/spec/arb_fragment_shader_interlock/image-load-store.c
@@ -218,9 +218,9 @@ piglit_display(void)
  {
int samples[4] = { 2, 4, 8, 16 };
bool pass = true;
-   uint i, j, k;
-   uint result1[4] = { 47, 35, 63, 255 };
-   uint result2[4] = { 47, 0, 63, 255 };
+   unsigned i, j, k;
+   const unsigned result1[4] = { 47, 35, 63, 255 };
+   const unsigned result2[4] = { 47, 0, 63, 255 };
int max_samples;
  
  	glViewport(0, 0, piglit_width, piglit_height);

@@ -256,12 +256,12 @@ piglit_display(void)
glGetTexImage(GL_TEXTURE_3D, 0, GL_RGBA, GL_FLOAT, tex_data);
for (j = 0; j < piglit_height; j++) {
for (k = 0; k < piglit_width; k++) {
-   uint l = ((piglit_width * piglit_height * 
samples[i]) +
+   unsigned l = ((piglit_width * piglit_height * 
samples[i]) +
(j * piglit_width) + k) * 4;
-   uint r = fabs(tex_data[l]) * 255;
-   uint g = fabs(tex_data[l + 1]) * 255;
-   uint b = fabs(tex_data[l + 2]) * 255;
-   uint a = fabs(tex_data[l + 3]) * 255;
+   unsigned r = fabs(tex_data[l]) * 255;
+   unsigned g = fabs(tex_data[l + 1]) * 255;
+   unsigned b = fabs(tex_data[l + 2]) * 255;
+   unsigned a = fabs(tex_data[l + 3]) * 255;
  
  if ((k < piglit_width / 2) && (r != result1[0] ||

  g != result1[1] || b != result1[2] || 
a != result1[3])) {



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


Re: [Piglit] [PATCH 2/3] arb_post_depth_coverage-multisampling: Add a multisampling test.

2017-04-12 Thread Lionel Landwerlin

Oops sorry, I thought I did too...

On 11/04/17 17:28, Manolova, Plamena wrote:

Hi Ilia,
This series got Reviewed-by: Lionel Landwerlin, but unfortunately I 
don't have write access to the repo to merge them.

Lionel would you mind doing that for me?

Thank you,
Pam

On Tue, Apr 11, 2017 at 5:24 PM, Ilia Mirkin <mailto:imir...@alum.mit.edu>> wrote:


What happened to these?

On Thu, Feb 2, 2017 at 9:34 AM, Plamena Manolova
mailto:plamena.manol...@intel.com>>
wrote:
> A simple multisampling test to check whether the values written
> to gl_SampleMaskIn are still correct after enabling the
> ARB_post_depth_coverage extension.
>
> Signed-off-by: Plamena Manolova mailto:plamena.manol...@intel.com>>
> ---
>  tests/all.py  |   1 +
>  .../spec/arb_post_depth_coverage/CMakeLists.gl.txt |   1 +
>  tests/spec/arb_post_depth_coverage/multisampling.c | 311
+
>  3 files changed, 313 insertions(+)
>  create mode 100644
tests/spec/arb_post_depth_coverage/multisampling.c
>
> diff --git a/tests/all.py b/tests/all.py
> index cef4773..95aa952 100644
> --- a/tests/all.py
> +++ b/tests/all.py
> @@ -4768,6 +4768,7 @@ with profile.test_list.group_manager(
>  PiglitGLTest,
>  grouptools.join('spec', 'arb_post_depth_coverage')) as g:
>  g(['arb_post_depth_coverage-basic'])
> +g(['arb_post_depth_coverage-multisampling'])
>
>  with profile.test_list.group_manager(
>  PiglitGLTest,
> diff --git
a/tests/spec/arb_post_depth_coverage/CMakeLists.gl.txt
b/tests/spec/arb_post_depth_coverage/CMakeLists.gl.txt
> index 1a71774..9c1e826 100644
> --- a/tests/spec/arb_post_depth_coverage/CMakeLists.gl.txt
> +++ b/tests/spec/arb_post_depth_coverage/CMakeLists.gl.txt
> @@ -9,3 +9,4 @@ link_libraries (
>  )
>
>  piglit_add_executable (arb_post_depth_coverage-basic basic.c)
> +piglit_add_executable (arb_post_depth_coverage-multisampling
multisampling.c)
> diff --git a/tests/spec/arb_post_depth_coverage/multisampling.c
b/tests/spec/arb_post_depth_coverage/multisampling.c
> new file mode 100644
> index 000..0c867da
> --- /dev/null
> +++ b/tests/spec/arb_post_depth_coverage/multisampling.c
> @@ -0,0 +1,311 @@
> +/*
> + * 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.
> + */
> +
> +#include "piglit-util-gl.h"
> +
> +/*
> + * A test to check whether the right values are written to
gl_SampleMaskIn
> + * when ARB_post_depth_coverage and multisampling are enabled.
Tests at
> + * 2, 4, 8, 16 sample rates.
> + */
> +
> +PIGLIT_GL_TEST_CONFIG_BEGIN
> +   config.supports_gl_compat_version = 43;
> +   config.supports_gl_core_version = 43;
> +   config.window_width = 160;
> +   config.window_height = 160;
> +   config.window_visual = PIGLIT_GL_VISUAL_RGB |
PIGLIT_GL_VISUAL_DEPTH |
> +   PIGLIT_GL_VISUAL_DOUBLE;
> +PIGLIT_GL_TEST_CONFIG_END
> +
> +static GLuint prog1, prog2, vao, ssbo, tex_color, tex_depth, fbo;
> +static GLint *sample_mask;
> +
> +static const char *vs_text =
> +   "#version 430\n"
> +   "in vec4 pos_in;\n"
&

Re: [Piglit] [PATCH 2/2] unittests: fix tests that check for tesselation

2017-02-24 Thread Lionel Landwerlin

Thanks!

I see an additional one in tests/spec/arb_internalformat_query2/common.c :)

Reviewed-by: Lionel Landwerlin 

On 24/02/17 01:52, Dylan Baker wrote:

This is a test fix for the practical fix in
e8fbd270b35b1bb927acc34383cbf9db95863a26.

Signed-off-by: Dylan Baker 
---
  unittests/generators/test_glsl.py | 16 
  1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/unittests/generators/test_glsl.py 
b/unittests/generators/test_glsl.py
index 66e3f66e1..5eec79484 100644
--- a/unittests/generators/test_glsl.py
+++ b/unittests/generators/test_glsl.py
@@ -300,18 +300,18 @@ class TestMinVersion_for_stage_with_ext(object):
  TCS (OpenGL)"""
  self._test('tesc', glsl.Version('410'), (glsl.Version('410'), None))
  self._test('tesc', glsl.Version('140'),
-   (glsl.Version('140'), 'GL_ARB_tesselation_shader'))
+   (glsl.Version('140'), 'GL_ARB_tessellation_shader'))
  self._test('tesc', glsl.Version('110'),
-   (glsl.Version('140'), 'GL_ARB_tesselation_shader'))
+   (glsl.Version('140'), 'GL_ARB_tessellation_shader'))
  
  def test_opengl_tese(self):

  """generated_tests.modules.glsl.MinVersion.for_stage_with_ext:
  TES (OpenGL)"""
  self._test('tese', glsl.Version('410'), (glsl.Version('410'), None))
  self._test('tese', glsl.Version('140'),
-   (glsl.Version('140'), 'GL_ARB_tesselation_shader'))
+   (glsl.Version('140'), 'GL_ARB_tessellation_shader'))
  self._test('tese', glsl.Version('110'),
-   (glsl.Version('140'), 'GL_ARB_tesselation_shader'))
+   (glsl.Version('140'), 'GL_ARB_tessellation_shader'))
  
  def test_opengl_comp(self):

  """generated_tests.modules.glsl.MinVersion.for_stage_with_ext:
@@ -352,9 +352,9 @@ class TestMinVersion_for_stage_with_ext(object):
  self._test('tesc', glsl.Version('320 es'),
 (glsl.Version('320 es'), None))
  self._test('tesc', glsl.Version('310 es'),
-   (glsl.Version('310 es'), 'GL_OES_tesselation_shader'))
+   (glsl.Version('310 es'), 'GL_OES_tessellation_shader'))
  self._test('tesc', glsl.Version('100'),
-   (glsl.Version('310 es'), 'GL_OES_tesselation_shader'))
+   (glsl.Version('310 es'), 'GL_OES_tessellation_shader'))
  
  def test_opengles_tese(self):

  """generated_tests.modules.glsl.MinVersion.for_stage_with_ext:
@@ -362,9 +362,9 @@ class TestMinVersion_for_stage_with_ext(object):
  self._test('tese', glsl.Version('320 es'),
 (glsl.Version('320 es'), None))
  self._test('tese', glsl.Version('310 es'),
-   (glsl.Version('310 es'), 'GL_OES_tesselation_shader'))
+   (glsl.Version('310 es'), 'GL_OES_tessellation_shader'))
  self._test('tese', glsl.Version('100'),
-   (glsl.Version('310 es'), 'GL_OES_tesselation_shader'))
+   (glsl.Version('310 es'), 'GL_OES_tessellation_shader'))
  
  def test_opengles_comp(self):

  """generated_tests.modules.glsl.MinVersion.for_stage_with_ext:



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


Re: [Piglit] [PATCH 1/2] unittests: Fix rename of gen_conversion -> gen_conversion_fp64

2017-02-24 Thread Lionel Landwerlin

Actually, that might explain Jason's failures :(

Reviewed-by: Lionel Landwerlin 

On 24/02/17 01:52, Dylan Baker wrote:

Signed-off-by: Dylan Baker 
---
  unittests/generators/test_generators.py | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/unittests/generators/test_generators.py 
b/unittests/generators/test_generators.py
index a3ea3e29e..5a129292e 100644
--- a/unittests/generators/test_generators.py
+++ b/unittests/generators/test_generators.py
@@ -48,7 +48,7 @@ import pytest
  'gen_cl_store_tests',
  'gen_const_builtin_equal_tests',
  'gen_constant_array_size_tests_fp64',
-'gen_conversion_fp64',
+'gen_conversion',
  'gen_extensions_defined',
  'gen_flat_interpolation_qualifier',
  'gen_inout_fp64',



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


Re: [Piglit] [PATCH] builtin_functions: Add more 64-bit integers

2017-02-24 Thread Lionel Landwerlin

I thought these would have been caught by gen_conversion.py :/

Reviewed-by: Lionel Landwerlin 

On 24/02/17 01:20, Jason Ekstrand wrote:

Seriously, 1000 is not the only 64-bit integer.  We should test
a few more of them.

These new integers trigger a bug in the GLSL IR int64 lowering code.

Cc: Ian Romanick 
---
  generated_tests/builtin_function.py | 24 ++--
  1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/generated_tests/builtin_function.py 
b/generated_tests/builtin_function.py
index 663d9d8..a5eafb2 100644
--- a/generated_tests/builtin_function.py
+++ b/generated_tests/builtin_function.py
@@ -1309,8 +1309,28 @@ def _make_vector_or_matrix_test_vectors(test_suite_dict):
[ 0.14,  0.18, -0.56],
[ 0.40, -0.77,  1.76]]),  # mat3x4
  ]
-int64s = [np.int64(x) for x in [0, -1000, 1000]]
-uint64s = [np.uint64(x) for x in [0,  10, 1000]]
+
+int64s = [np.int64(x) for x in [
+   0,
+   3,
+   -1192,
+   1048576,
+   4251475,
+   29852643761,
+   -4398046511104,
+   -3948976685146,
+   -135763469567146206]]
+uint64s = [np.uint64(x) for x in [
+   0,
+   3,
+   1192,
+   1048576,
+   4251475,
+   29852643761,
+   4398046511104,
+   3948976685146,
+   135763469567146206,
+   11654173250180970009]]
  
  int64vecs = [

  np.array([-10, -12], dtype=np.int64),



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


[Piglit] [PATCH] tests: INTEL_conservative_rasterization: add missing gles3 build file

2017-02-09 Thread Lionel Landwerlin
Completely missed this, the tests were just being skipped.

Signed-off-by: Lionel Landwerlin 
---
 .../spec/intel_conservative_rasterization/CMakeLists.gles3.txt | 10 ++
 1 file changed, 10 insertions(+)
 create mode 100644 
tests/spec/intel_conservative_rasterization/CMakeLists.gles3.txt

diff --git a/tests/spec/intel_conservative_rasterization/CMakeLists.gles3.txt 
b/tests/spec/intel_conservative_rasterization/CMakeLists.gles3.txt
new file mode 100644
index 0..71744403a
--- /dev/null
+++ b/tests/spec/intel_conservative_rasterization/CMakeLists.gles3.txt
@@ -0,0 +1,10 @@
+link_libraries(
+   piglitutil_${piglit_target_api}
+   )
+
+piglit_add_executable (intel_conservative_rasterization-depthcoverage_gles3 
depthcoverage.c)
+piglit_add_executable (intel_conservative_rasterization-innercoverage_gles3 
innercoverage.c)
+piglit_add_executable (intel_conservative_rasterization-invalid_gles3 
invalid.c)
+piglit_add_executable (intel_conservative_rasterization-tri_gles3 tri.c)
+
+# vim: ft=cmake:
-- 
2.11.0

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


Re: [Piglit] [PATCH 1/3] arb_post_depth_coverage-basic: Add a basic initial test.

2017-02-09 Thread Lionel Landwerlin

This series is :

Reviewed-by: Lionel Landwerlin 

On 02/02/17 14:31, Plamena Manolova wrote:

A basic test to check whether the values written to gl_SampleMaskIn
are still correct after enabling the ARB_post_depth_coverage
extension.

Signed-off-by: Plamena Manolova 
---
  tests/all.py   |   5 +
  tests/spec/CMakeLists.txt  |   1 +
  .../spec/arb_post_depth_coverage/CMakeLists.gl.txt |  11 +
  tests/spec/arb_post_depth_coverage/CMakeLists.txt  |   1 +
  tests/spec/arb_post_depth_coverage/basic.c | 241 +
  5 files changed, 259 insertions(+)
  create mode 100644 tests/spec/arb_post_depth_coverage/CMakeLists.gl.txt
  create mode 100644 tests/spec/arb_post_depth_coverage/CMakeLists.txt
  create mode 100644 tests/spec/arb_post_depth_coverage/basic.c

diff --git a/tests/all.py b/tests/all.py
index 74ffb42..cef4773 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4765,6 +4765,11 @@ with profile.test_list.group_manager(
  g(['arb_shader_image_load_store-unused'], 'unused')
  
  with profile.test_list.group_manager(

+PiglitGLTest,
+grouptools.join('spec', 'arb_post_depth_coverage')) as g:
+g(['arb_post_depth_coverage-basic'])
+
+with profile.test_list.group_manager(
  PiglitGLTest,
  grouptools.join('spec', 'arb_shader_image_size')) as g:
  g(['arb_shader_image_size-builtin'], 'builtin')
diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index 548515d..1f3164e 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -154,3 +154,4 @@ add_subdirectory (ext_window_rectangles)
  add_subdirectory (arb_shader_texture_image_samples)
  add_subdirectory (arb_texture_barrier)
  add_subdirectory (intel_conservative_rasterization)
+add_subdirectory (arb_post_depth_coverage)
diff --git a/tests/spec/arb_post_depth_coverage/CMakeLists.gl.txt 
b/tests/spec/arb_post_depth_coverage/CMakeLists.gl.txt
new file mode 100644
index 000..1a71774
--- /dev/null
+++ b/tests/spec/arb_post_depth_coverage/CMakeLists.gl.txt
@@ -0,0 +1,11 @@
+include_directories(
+   ${GLEXT_INCLUDE_DIR}
+   ${OPENGL_INCLUDE_PATH}
+)
+
+link_libraries (
+   piglitutil_${piglit_target_api}
+   ${OPENGL_gl_LIBRARY}
+)
+
+piglit_add_executable (arb_post_depth_coverage-basic basic.c)
diff --git a/tests/spec/arb_post_depth_coverage/CMakeLists.txt 
b/tests/spec/arb_post_depth_coverage/CMakeLists.txt
new file mode 100644
index 000..144a306
--- /dev/null
+++ b/tests/spec/arb_post_depth_coverage/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git a/tests/spec/arb_post_depth_coverage/basic.c 
b/tests/spec/arb_post_depth_coverage/basic.c
new file mode 100644
index 000..07f6ab1
--- /dev/null
+++ b/tests/spec/arb_post_depth_coverage/basic.c
@@ -0,0 +1,241 @@
+/*
+ * 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.
+ */
+
+/*
+ * A rudimentary test to check whether the correct values are being written
+ * to gl_SampleMaskIn when ARB_post_depth_coverage is enabled.
+ */
+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+   config.supports_gl_compat_version = 43;
+   config.supports_gl_core_version = 43;
+   config.window_width = 160;
+   config.window_height = 160;
+   config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DEPTH | 
PIGLIT_GL_VISUAL_DOUBLE;
+PIGLIT_GL_TEST_CONFIG_END
+
+static GLuint prog1, prog2, vao, ssbo;
+static GLint *sample_mask;
+
+static const char *vs_text =
+   "#version 430\n"
+   "in vec4 pos_in;\n"
+   "void main()\n"
+   "{\n"
+   "  gl_Position = pos_in;\n"
+   "}\n";
+
+static const char *fs_text1 =
+ 

Re: [Piglit] [PATCH 1/3] PNG files, write mode correction

2017-01-10 Thread Lionel Landwerlin

Oh thanks, sorry I had no idea :)

On 10/01/17 14:50, Olender, Sebastian D wrote:

I'm running this on windows

-Original Message-
From: Landwerlin, Lionel G
Sent: Tuesday, January 10, 2017 3:48 PM
To: Olender, Sebastian D ; 
piglit@lists.freedesktop.org
Subject: Re: [Piglit] [PATCH 1/3] PNG files, write mode correction

The man page of fopen says :

"This is strictly for compatibility with C89 and has no effect; the 'b'
is ignored on all POSIX conforming systems, including Linux."

I don't know where you're running this, but sure :)

Reviewed-by: Lionel Landwerlin 

On 10/01/17 14:38, Sebastian Olender wrote:

Signed-off-by: Sebastian Olender 
---
   tests/util/piglit-util-png.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/util/piglit-util-png.c
b/tests/util/piglit-util-png.c index 4835ed6..c63ec7b 100644
--- a/tests/util/piglit-util-png.c
+++ b/tests/util/piglit-util-png.c
@@ -87,7 +87,7 @@ piglit_write_png(const char *filename,
break;
}
   
-	fp = fopen(filename, "w");

+   fp = fopen(filename, "wb");
if (!fp)
abortf("failed to open `%s'", filename);
   




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


Re: [Piglit] [PATCH 2/3] arb_texture_view_rendering-formats: fix wrong array initialization

2017-01-10 Thread Lionel Landwerlin

Reviewed-by: Lionel Landwerlin 

On 10/01/17 14:38, Sebastian Olender wrote:

Signed-off-by: Sebastian Olender 
---
  tests/spec/arb_texture_view/rendering-formats.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/spec/arb_texture_view/rendering-formats.c 
b/tests/spec/arb_texture_view/rendering-formats.c
index 41b521a..44ab56b 100644
--- a/tests/spec/arb_texture_view/rendering-formats.c
+++ b/tests/spec/arb_texture_view/rendering-formats.c
@@ -1453,7 +1453,7 @@ create_test_clear_program(const struct format_info *base,
GLuint prog;
const char *sampler = "";
const char *conv = "";
-   unsigned expected[4] = {};
+   unsigned expected[4] = {0};
unsigned i;
unsigned base_num_components = get_num_components(base);
bool test_nan = false;



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


Re: [Piglit] [PATCH 1/3] PNG files, write mode correction

2017-01-10 Thread Lionel Landwerlin

The man page of fopen says :

"This is strictly for compatibility with C89 and has no effect; the 'b' 
is ignored on all POSIX conforming systems, including Linux."


I don't know where you're running this, but sure :)

Reviewed-by: Lionel Landwerlin 

On 10/01/17 14:38, Sebastian Olender wrote:

Signed-off-by: Sebastian Olender 
---
  tests/util/piglit-util-png.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/util/piglit-util-png.c b/tests/util/piglit-util-png.c
index 4835ed6..c63ec7b 100644
--- a/tests/util/piglit-util-png.c
+++ b/tests/util/piglit-util-png.c
@@ -87,7 +87,7 @@ piglit_write_png(const char *filename,
break;
}
  
-	fp = fopen(filename, "w");

+   fp = fopen(filename, "wb");
if (!fp)
abortf("failed to open `%s'", filename);
  



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


Re: [Piglit] [PATCH 3/3] arb_cull_distance: correction of result interpretation

2017-01-10 Thread Lionel Landwerlin

On 10/01/17 14:38, Sebastian Olender wrote:

Signed-off-by: Sebastian Olender 
---
  tests/spec/arb_cull_distance/exceed-limits.c | 8 
  1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/spec/arb_cull_distance/exceed-limits.c 
b/tests/spec/arb_cull_distance/exceed-limits.c
index 10fecb9..e68ad73 100644
--- a/tests/spec/arb_cull_distance/exceed-limits.c
+++ b/tests/spec/arb_cull_distance/exceed-limits.c
@@ -58,8 +58,8 @@ piglit_init(int argc, char **argv)
GLint max_clip_distances;
GLint max_cull_distances;
GLint max_combined_clip_and_cull_distances;
-   GLint clip_distances;
-   GLint cull_distances;
+   GLint clip_distances = 0;
+   GLint cull_distances = 0;
char *use_cull = "", *use_clip = "";
  
  	glGetIntegerv(GL_MAX_CLIP_DISTANCES, &max_clip_distances);

@@ -104,7 +104,7 @@ piglit_init(int argc, char **argv)


Hi Sebastian,

I think you missed that the purpose of this test is to verify that when 
exceeding the limit the compilation must fail.
The changes below seem incorrect to me. Initializing the values above is 
fine though.


Thanks

-
Lionel

  
  	glLinkProgram(prog);

if (!piglit_link_check_status(prog))
-   piglit_report_result(PIGLIT_PASS);
+   piglit_report_result(PIGLIT_FAIL);
  
-	piglit_report_result(PIGLIT_FAIL);

+   piglit_report_result(PIGLIT_PASS);
  }



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


Re: [Piglit] [PATCH] glsl-1.10: another test for min max optimisation pass

2017-01-05 Thread Lionel Landwerlin

Reviewed-by: Lionel Landwerlin 

On 05/01/17 23:20, Timothy Arceri wrote:

This simple test exposes a bug in the GLSL IR optimisation pass in
Mesa master.
---
  .../glsl-1.10/execution/fs-min-min-min.shader_test | 32 ++
  1 file changed, 32 insertions(+)
  create mode 100644 tests/spec/glsl-1.10/execution/fs-min-min-min.shader_test

diff --git a/tests/spec/glsl-1.10/execution/fs-min-min-min.shader_test 
b/tests/spec/glsl-1.10/execution/fs-min-min-min.shader_test
new file mode 100644
index 000..35ddeb9
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/fs-min-min-min.shader_test
@@ -0,0 +1,32 @@
+[require]
+GLSL >= 1.10
+
+[vertex shader passthrough]
+
+[fragment shader]
+
+uniform float u;
+uniform float u2;
+
+void main()
+{
+  float a = u;
+  float b = u2;
+
+  a = min(a, 0.35);
+  b = min(b, 0.35);
+
+  float c = min(a, b);
+
+  gl_FragColor = vec4(0.0, c, 0.0, 1.0);
+}
+
+[test]
+clear color 0.2 0.2 0.2 0.2
+clear
+
+uniform float u 0.75
+uniform float u2 0.75
+
+draw rect -1 -1 2 2
+probe all rgba 0.0 0.35 0.0 1.0



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


Re: [Piglit] [PATCH] glsl-1.10: test min max optimisation pass

2017-01-05 Thread Lionel Landwerlin

Reviewed-by: Lionel Landwerlin 

On 05/01/17 12:33, Timothy Arceri wrote:

This simple test exposes a bug in the GLSL IR optimisation pass in
Mesa master.
---
  .../glsl-1.10/execution/fs-max-max-max.shader_test | 32 ++
  1 file changed, 32 insertions(+)
  create mode 100644 tests/spec/glsl-1.10/execution/fs-max-max-max.shader_test

diff --git a/tests/spec/glsl-1.10/execution/fs-max-max-max.shader_test 
b/tests/spec/glsl-1.10/execution/fs-max-max-max.shader_test
new file mode 100644
index 000..47e0500
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/fs-max-max-max.shader_test
@@ -0,0 +1,32 @@
+[require]
+GLSL >= 1.10
+
+[vertex shader passthrough]
+
+[fragment shader]
+
+uniform float u;
+uniform float u2;
+
+void main()
+{
+  float a = u;
+  float b = u2;
+
+  a = max(a, 0.35);
+  b = max(b, 0.35);
+
+  float c = max(a, b);
+
+  gl_FragColor = vec4(0.0, c, 0.0, 1.0);
+}
+
+[test]
+clear color 0.2 0.2 0.2 0.2
+clear
+
+uniform float u 0.1
+uniform float u2 0.1
+
+draw rect -1 -1 2 2
+probe all rgba 0.0 0.35 0.0 1.0



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


Re: [Piglit] [PATCH 3/3] arb_post_depth_coverage-sample-shading: Test sample shading.

2016-12-20 Thread Lionel Landwerlin

Hi Pam,

With the small changed below, this is :

Reviewed-by: Lionel Landwerlin 

Cheers,

-
Lionel

On 22/11/16 22:04, Plamena Manolova wrote:

A multisampling test with sample shading enabled to check
whether the values written to gl_SampleMaskIn are still correct
after enabling the ARB_post_depth_coverage extension.

Signed-off-by: Plamena Manolova 
---
  tests/all.py   |   1 +
  .../spec/arb_post_depth_coverage/CMakeLists.gl.txt |   1 +
  .../spec/arb_post_depth_coverage/sample-shading.c  | 315 +
  3 files changed, 317 insertions(+)
  create mode 100644 tests/spec/arb_post_depth_coverage/sample-shading.c

diff --git a/tests/all.py b/tests/all.py
index e9d786a..50770c8 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4760,6 +4760,7 @@ with profile.test_list.group_manager(
  grouptools.join('spec', 'arb_post_depth_coverage')) as g:
  g(['arb_post_depth_coverage-basic'])
  g(['arb_post_depth_coverage-multisampling'])
+g(['arb_post_depth_coverage-sample-shading'])
  
  with profile.test_list.group_manager(

  PiglitGLTest,
diff --git a/tests/spec/arb_post_depth_coverage/CMakeLists.gl.txt 
b/tests/spec/arb_post_depth_coverage/CMakeLists.gl.txt
index 9c1e826..67f0c47 100644
--- a/tests/spec/arb_post_depth_coverage/CMakeLists.gl.txt
+++ b/tests/spec/arb_post_depth_coverage/CMakeLists.gl.txt
@@ -10,3 +10,4 @@ link_libraries (
  
  piglit_add_executable (arb_post_depth_coverage-basic basic.c)

  piglit_add_executable (arb_post_depth_coverage-multisampling multisampling.c)
+piglit_add_executable (arb_post_depth_coverage-sample-shading sample-shading.c)
diff --git a/tests/spec/arb_post_depth_coverage/sample-shading.c 
b/tests/spec/arb_post_depth_coverage/sample-shading.c
new file mode 100644
index 000..9e80cca
--- /dev/null
+++ b/tests/spec/arb_post_depth_coverage/sample-shading.c
@@ -0,0 +1,315 @@
+/*
+ * 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.
+ */


If you could just insert a small description here, that would be great.


+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+   config.supports_gl_compat_version = 45;
+   config.supports_gl_core_version = 45;


Unless you think otherwise, you can probably lower that requirement to 4.3.


+   config.window_width = 160;
+   config.window_height = 160;
+   config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DEPTH |
+   PIGLIT_GL_VISUAL_DOUBLE;
+PIGLIT_GL_TEST_CONFIG_END
+
+static GLuint prog1, prog2, vao, ssbo, tex_color, tex_depth, fbo;
+static GLint *sample_mask;
+
+static const char *vs_text =
+   "#version 430\n"
+   "in vec4 pos_in;\n"
+   "void main()\n"
+   "{\n"
+   "  gl_Position = pos_in;\n"
+   "}\n";
+
+static const char *fs_text1 =
+   "#version 430\n"
+   "out vec4 color;\n"
+   "void main()\n"
+   "{\n"
+   "  gl_FragDepth = 0.5f;\n"
+   "  color = vec4(0.0, 1.0, 0.0, 1.0);\n"
+   "}\n";
+
+static const char *fs_text2 =
+   "#version 430\n"
+   "#extension GL_ARB_post_depth_coverage: enable\n"
+   "#ifdef GL_ARB_post_depth_coverage\n"


Like patch one, I think you can drop the #ifdef here.


+   "out vec4 color;\n"
+   "layout(early_fragment_tests) in;\n"
+   "layout(post_depth_coverage) in;\n"
+   "layout(std430, binding = 0) buffer MaskOutput {\n"
+   "  int data[];\n"
+   "} mask_output;\n"
+   "layout(location = 1) uniform int width;\n"
+   "layout(location = 2) uniform int samples;\n&qu

Re: [Piglit] [PATCH 2/3] arb_post_depth_coverage-multisampling: Add a multisampling test.

2016-12-20 Thread Lionel Landwerlin

This test is failing on my Kabylake laptop. Please check the comments below.

Cheers,

-
Lionel

On 22/11/16 22:03, Plamena Manolova wrote:

A simple multisampling test to check whether the values written
to gl_SampleMaskIn are still correct after enabling the
ARB_post_depth_coverage extension.

Signed-off-by: Plamena Manolova 
---
  tests/all.py   |   1 +
  .../spec/arb_post_depth_coverage/CMakeLists.gl.txt |   1 +
  tests/spec/arb_post_depth_coverage/multisampling.c | 316 +
  3 files changed, 318 insertions(+)
  create mode 100644 tests/spec/arb_post_depth_coverage/multisampling.c

diff --git a/tests/all.py b/tests/all.py
index 355edee..e9d786a 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4759,6 +4759,7 @@ with profile.test_list.group_manager(
  PiglitGLTest,
  grouptools.join('spec', 'arb_post_depth_coverage')) as g:
  g(['arb_post_depth_coverage-basic'])
+g(['arb_post_depth_coverage-multisampling'])
  
  with profile.test_list.group_manager(

  PiglitGLTest,
diff --git a/tests/spec/arb_post_depth_coverage/CMakeLists.gl.txt 
b/tests/spec/arb_post_depth_coverage/CMakeLists.gl.txt
index 1a71774..9c1e826 100644
--- a/tests/spec/arb_post_depth_coverage/CMakeLists.gl.txt
+++ b/tests/spec/arb_post_depth_coverage/CMakeLists.gl.txt
@@ -9,3 +9,4 @@ link_libraries (
  )
  
  piglit_add_executable (arb_post_depth_coverage-basic basic.c)

+piglit_add_executable (arb_post_depth_coverage-multisampling multisampling.c)
diff --git a/tests/spec/arb_post_depth_coverage/multisampling.c 
b/tests/spec/arb_post_depth_coverage/multisampling.c
new file mode 100644
index 000..cd0aac5
--- /dev/null
+++ b/tests/spec/arb_post_depth_coverage/multisampling.c
@@ -0,0 +1,316 @@
+/*
+ * 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.
+ */


A small description of what is being tested would be great.


+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+   config.supports_gl_compat_version = 45;
+   config.supports_gl_core_version = 45;


As mentioned, this can be lowered to 4.3


+   config.window_width = 160;
+   config.window_height = 160;
+   config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DEPTH |
+   PIGLIT_GL_VISUAL_DOUBLE;
+PIGLIT_GL_TEST_CONFIG_END
+
+static GLuint prog1, prog2, vao, ssbo, tex_color, tex_depth, fbo;
+static GLint *sample_mask;
+
+static const char *vs_text =
+   "#version 430\n"
+   "in vec4 pos_in;\n"
+   "void main()\n"
+   "{\n"
+   "  gl_Position = pos_in;\n"
+   "}\n";
+
+static const char *fs_text1 =
+   "#version 430\n"
+   "out vec4 color;\n"
+   "void main()\n"
+   "{\n"
+   "  gl_FragDepth = 0.5f;\n"
+   "  color = vec4(0.0, 1.0, 0.0, 1.0);\n"
+   "}\n";
+
+static const char *fs_text2 =
+   "#version 430\n"
+   "#extension GL_ARB_post_depth_coverage: enable\n"
+   "#ifdef GL_ARB_post_depth_coverage\n"
+   "out vec4 color;\n"
+   "layout(early_fragment_tests) in;\n"
+   "layout(post_depth_coverage) in;\n"
+   "layout(std430, binding = 0) buffer MaskOutput {\n"
+   "  int data[];\n"
+   "} mask_output;\n"
+   "layout(location = 1) uniform int width;\n"
+   "layout(location = 2) uniform int samples;\n"
+   "void main()\n"
+   "{\n"
+   "  int mask_value = 1;\n"
+   "  int index = int(gl_FragCoord.y) * width + int(gl_FragCoord.x);\n"
+   "  for (int i = 1; i <= samples - 1; i++)\n"
+   "  mask_value |= 1 << i;\n"
+   "  if (gl_SampleMaskIn[0] == mask_value) {\n"
I think you need to change the test above, gl_SampleMaskIn[0] != 0 would 
be right.

+   "  mask_output.data[index] = 1;\n"
+   "  } else {\n"
+   "  mask_output.data[index] = 0;\n"
+   "  }\n"
+   "  color = vec4(1.0, 0.0, 0.0, 1.0);\n"

Re: [Piglit] [PATCH 1/3] arb_post_depth_coverage-basic: Add a basic initial test.

2016-12-20 Thread Lionel Landwerlin

Hi Pam,

Here are some tiny comments inline. With that updated this patch is :

Reviewed-by: Lionel Landwerlin 

Cheers,

-
Lionel

On 22/11/16 22:01, Plamena Manolova wrote:

A basic test to check whether the values written to gl_SampleMaskIn
are still correct after enabling the ARB_post_depth_coverage
extension.

Signed-off-by: Plamena Manolova 
---
  tests/all.py   |   5 +
  tests/spec/CMakeLists.txt  |   1 +
  .../spec/arb_post_depth_coverage/CMakeLists.gl.txt |  11 +
  tests/spec/arb_post_depth_coverage/CMakeLists.txt  |   1 +
  tests/spec/arb_post_depth_coverage/basic.c | 240 +
  5 files changed, 258 insertions(+)
  create mode 100644 tests/spec/arb_post_depth_coverage/CMakeLists.gl.txt
  create mode 100644 tests/spec/arb_post_depth_coverage/CMakeLists.txt
  create mode 100644 tests/spec/arb_post_depth_coverage/basic.c

diff --git a/tests/all.py b/tests/all.py
index 30df61c..355edee 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4756,6 +4756,11 @@ with profile.test_list.group_manager(
  g(['arb_shader_image_load_store-unused'], 'unused')
  
  with profile.test_list.group_manager(

+PiglitGLTest,
+grouptools.join('spec', 'arb_post_depth_coverage')) as g:
+g(['arb_post_depth_coverage-basic'])
+
+with profile.test_list.group_manager(
  PiglitGLTest,
  grouptools.join('spec', 'arb_shader_image_size')) as g:
  g(['arb_shader_image_size-builtin'], 'builtin')
diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index a057c02..4377196 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -152,3 +152,4 @@ add_subdirectory (arb_query_buffer_object)
  add_subdirectory (ext_window_rectangles)
  add_subdirectory (arb_shader_texture_image_samples)
  add_subdirectory (arb_texture_barrier)
+add_subdirectory (arb_post_depth_coverage)
diff --git a/tests/spec/arb_post_depth_coverage/CMakeLists.gl.txt 
b/tests/spec/arb_post_depth_coverage/CMakeLists.gl.txt
new file mode 100644
index 000..1a71774
--- /dev/null
+++ b/tests/spec/arb_post_depth_coverage/CMakeLists.gl.txt
@@ -0,0 +1,11 @@
+include_directories(
+   ${GLEXT_INCLUDE_DIR}
+   ${OPENGL_INCLUDE_PATH}
+)
+
+link_libraries (
+   piglitutil_${piglit_target_api}
+   ${OPENGL_gl_LIBRARY}
+)
+
+piglit_add_executable (arb_post_depth_coverage-basic basic.c)
diff --git a/tests/spec/arb_post_depth_coverage/CMakeLists.txt 
b/tests/spec/arb_post_depth_coverage/CMakeLists.txt
new file mode 100644
index 000..144a306
--- /dev/null
+++ b/tests/spec/arb_post_depth_coverage/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git a/tests/spec/arb_post_depth_coverage/basic.c 
b/tests/spec/arb_post_depth_coverage/basic.c
new file mode 100644
index 000..92942ee
--- /dev/null
+++ b/tests/spec/arb_post_depth_coverage/basic.c
@@ -0,0 +1,240 @@
+/*
+ * 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.
+ */


Most tests tend to include a quick description of what they're testing 
like :


https://cgit.freedesktop.org/piglit/tree/tests/spec/arb_viewport_array/clear.c#n24

It would be nice to have that.


+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+   config.supports_gl_compat_version = 45;
+   config.supports_gl_core_version = 45;


Looking at the function you use, I think you can lower the requirements 
to 4.3.



+   config.window_width = 160;
+   config.window_height = 160;
+   config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DEPTH | 
PIGLIT_GL_VISUAL_DOUBLE;
+PIGLIT_GL_TEST_CONFIG_END
+
+static GLuint prog1, prog2, vao, ssbo;
+static GLint *sample_mask;
+
+static const char *vs_text =
+   "#version 430\n&quo

[Piglit] [PATCH v3] Add GL_INTEL_conservative_rasterization tests

2016-12-08 Thread Lionel Landwerlin
This extension is a subset of GL_NV_conservative_raster, applying only
to polygons.

v2: Drop wrongly added files from Plamena's work (Lionel)

v3: Enable tests on GLES (Lionel)

Signed-off-by: Lionel Landwerlin 
---
 tests/all.py   |  12 ++
 tests/spec/CMakeLists.txt  |   1 +
 .../CMakeLists.gl.txt  |  16 ++
 .../CMakeLists.txt |   1 +
 .../depthcoverage.c|  75 +
 .../innercoverage.c| 173 +
 .../intel_conservative_rasterization/invalid.c | 114 ++
 tests/spec/intel_conservative_rasterization/tri.c  | 135 
 8 files changed, 527 insertions(+)
 create mode 100644 
tests/spec/intel_conservative_rasterization/CMakeLists.gl.txt
 create mode 100644 tests/spec/intel_conservative_rasterization/CMakeLists.txt
 create mode 100644 tests/spec/intel_conservative_rasterization/depthcoverage.c
 create mode 100644 tests/spec/intel_conservative_rasterization/innercoverage.c
 create mode 100644 tests/spec/intel_conservative_rasterization/invalid.c
 create mode 100644 tests/spec/intel_conservative_rasterization/tri.c

diff --git a/tests/all.py b/tests/all.py
index 03cf0c8..852ceae 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4898,5 +4898,17 @@ with profile.test_list.group_manager(
 g(['arb_compute_variable_group_size-local-size'], 'local-size')
 g(['arb_compute_variable_group_size-minmax'], 'minmax')

+# Group INTEL_conservative_rasterization
+with profile.test_list.group_manager(
+PiglitGLTest,
+grouptools.join('spec', 'INTEL_conservative_rasterization')) as g:
+g(['intel_conservative_rasterization-depthcoverage'])
+g(['intel_conservative_rasterization-innercoverage'])
+g(['intel_conservative_rasterization-invalid'])
+g(['intel_conservative_rasterization-tri'])
+g(['intel_conservative_rasterization-depthcoverage_gles3'])
+g(['intel_conservative_rasterization-innercoverage_gles3'])
+g(['intel_conservative_rasterization-tri_gles3'])
+
 if platform.system() is 'Windows':
 profile.filters.append(lambda p, _: not p.startswith('glx'))
diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index 4ac1a53..548515d 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -153,3 +153,4 @@ add_subdirectory (arb_query_buffer_object)
 add_subdirectory (ext_window_rectangles)
 add_subdirectory (arb_shader_texture_image_samples)
 add_subdirectory (arb_texture_barrier)
+add_subdirectory (intel_conservative_rasterization)
diff --git a/tests/spec/intel_conservative_rasterization/CMakeLists.gl.txt 
b/tests/spec/intel_conservative_rasterization/CMakeLists.gl.txt
new file mode 100644
index 000..6e0ab44
--- /dev/null
+++ b/tests/spec/intel_conservative_rasterization/CMakeLists.gl.txt
@@ -0,0 +1,16 @@
+include_directories(
+   ${GLEXT_INCLUDE_DIR}
+   ${OPENGL_INCLUDE_PATH}
+)
+
+link_libraries (
+   piglitutil_${piglit_target_api}
+   ${OPENGL_gl_LIBRARY}
+)
+
+piglit_add_executable (intel_conservative_rasterization-depthcoverage 
depthcoverage.c)
+piglit_add_executable (intel_conservative_rasterization-innercoverage 
innercoverage.c)
+piglit_add_executable (intel_conservative_rasterization-invalid invalid.c)
+piglit_add_executable (intel_conservative_rasterization-tri tri.c)
+
+# vim: ft=cmake:
diff --git a/tests/spec/intel_conservative_rasterization/CMakeLists.txt 
b/tests/spec/intel_conservative_rasterization/CMakeLists.txt
new file mode 100644
index 000..144a306
--- /dev/null
+++ b/tests/spec/intel_conservative_rasterization/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git a/tests/spec/intel_conservative_rasterization/depthcoverage.c 
b/tests/spec/intel_conservative_rasterization/depthcoverage.c
new file mode 100644
index 000..0d8eb24
--- /dev/null
+++ b/tests/spec/intel_conservative_rasterization/depthcoverage.c
@@ -0,0 +1,75 @@
+/*
+ * Copyright © 2016 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLU

[Piglit] [PATCH v2] Add GL_INTEL_conservative_rasterization tests

2016-12-02 Thread Lionel Landwerlin
This extension is a subset of GL_NV_conservative_raster, applying only
to polygons.

v2: Drop wrongly added files from Plamena's work (Lionel)

Signed-off-by: Lionel Landwerlin 
---
 tests/all.py   |   8 ++
 tests/spec/CMakeLists.txt  |   1 +
 .../CMakeLists.gl.txt  |  16 +++
 .../CMakeLists.txt |   1 +
 .../depthcoverage.c|  67 ++
 .../innercoverage.c| 147 +
 .../intel_conservative_rasterization/invalid.c | 106 +++
 tests/spec/intel_conservative_rasterization/tri.c  | 120 +
 8 files changed, 466 insertions(+)
 create mode 100644 
tests/spec/intel_conservative_rasterization/CMakeLists.gl.txt
 create mode 100644 tests/spec/intel_conservative_rasterization/CMakeLists.txt
 create mode 100644 tests/spec/intel_conservative_rasterization/depthcoverage.c
 create mode 100644 tests/spec/intel_conservative_rasterization/innercoverage.c
 create mode 100644 tests/spec/intel_conservative_rasterization/invalid.c
 create mode 100644 tests/spec/intel_conservative_rasterization/tri.c

diff --git a/tests/all.py b/tests/all.py
index 30df61c..c8e1cda 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4897,5 +4897,13 @@ with profile.test_list.group_manager(
 g(['arb_compute_variable_group_size-local-size'], 'local-size')
 g(['arb_compute_variable_group_size-minmax'], 'minmax')

+with profile.test_list.group_manager(
+PiglitGLTest,
+grouptools.join('spec', 'intel_conservative_rasterization')) as g:
+g(['intel_conservative_rasterization-depthcoverage'])
+g(['intel_conservative_rasterization-innercoverage'])
+g(['intel_conservative_rasterization-invalid'])
+g(['intel_conservative_rasterization-tri'])
+
 if platform.system() is 'Windows':
 profile.filters.append(lambda p, _: not p.startswith('glx'))
diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index 4ac1a53..548515d 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -153,3 +153,4 @@ add_subdirectory (arb_query_buffer_object)
 add_subdirectory (ext_window_rectangles)
 add_subdirectory (arb_shader_texture_image_samples)
 add_subdirectory (arb_texture_barrier)
+add_subdirectory (intel_conservative_rasterization)
diff --git a/tests/spec/intel_conservative_rasterization/CMakeLists.gl.txt 
b/tests/spec/intel_conservative_rasterization/CMakeLists.gl.txt
new file mode 100644
index 000..6e0ab44
--- /dev/null
+++ b/tests/spec/intel_conservative_rasterization/CMakeLists.gl.txt
@@ -0,0 +1,16 @@
+include_directories(
+   ${GLEXT_INCLUDE_DIR}
+   ${OPENGL_INCLUDE_PATH}
+)
+
+link_libraries (
+   piglitutil_${piglit_target_api}
+   ${OPENGL_gl_LIBRARY}
+)
+
+piglit_add_executable (intel_conservative_rasterization-depthcoverage 
depthcoverage.c)
+piglit_add_executable (intel_conservative_rasterization-innercoverage 
innercoverage.c)
+piglit_add_executable (intel_conservative_rasterization-invalid invalid.c)
+piglit_add_executable (intel_conservative_rasterization-tri tri.c)
+
+# vim: ft=cmake:
diff --git a/tests/spec/intel_conservative_rasterization/CMakeLists.txt 
b/tests/spec/intel_conservative_rasterization/CMakeLists.txt
new file mode 100644
index 000..144a306
--- /dev/null
+++ b/tests/spec/intel_conservative_rasterization/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git a/tests/spec/intel_conservative_rasterization/depthcoverage.c 
b/tests/spec/intel_conservative_rasterization/depthcoverage.c
new file mode 100644
index 000..e92083d
--- /dev/null
+++ b/tests/spec/intel_conservative_rasterization/depthcoverage.c
@@ -0,0 +1,67 @@
+/*
+ * Copyright © 2016 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 

[Piglit] [PATCH 0/2] INTEL_conservative_rasterization tests

2016-12-01 Thread Lionel Landwerlin
Hi,

Here are some new tests for the INTEL_conservative_rasterization
extension. This can be considered as a subset of
NV_conservative_raster.

Any feedback is more than welcome :)

Cheers,

Lionel Landwerlin (2):
  Add GL_INTEL_conservative_rasterization tests
  generated_tests: new compiler tests for
INTEL_conservative_rasterization

 generated_tests/CMakeLists.txt |   4 +
 .../gen_shader_intel_conservative_rasterization.py | 173 +++
 tests/all.py   |   5 +
 tests/spec/CMakeLists.txt  |   2 +
 .../spec/arb_post_depth_coverage/CMakeLists.gl.txt |  11 +
 tests/spec/arb_post_depth_coverage/CMakeLists.txt  |   1 +
 tests/spec/arb_post_depth_coverage/basic.c | 240 +
 .../CMakeLists.gl.txt  |  16 ++
 .../CMakeLists.txt |   1 +
 .../depthcoverage.c|  67 ++
 .../innercoverage.c| 147 +
 .../intel_conservative_rasterization/invalid.c | 106 +
 tests/spec/intel_conservative_rasterization/tri.c  | 120 +++
 13 files changed, 893 insertions(+)
 create mode 100644 
generated_tests/gen_shader_intel_conservative_rasterization.py
 create mode 100644 tests/spec/arb_post_depth_coverage/CMakeLists.gl.txt
 create mode 100644 tests/spec/arb_post_depth_coverage/CMakeLists.txt
 create mode 100644 tests/spec/arb_post_depth_coverage/basic.c
 create mode 100644 
tests/spec/intel_conservative_rasterization/CMakeLists.gl.txt
 create mode 100644 tests/spec/intel_conservative_rasterization/CMakeLists.txt
 create mode 100644 tests/spec/intel_conservative_rasterization/depthcoverage.c
 create mode 100644 tests/spec/intel_conservative_rasterization/innercoverage.c
 create mode 100644 tests/spec/intel_conservative_rasterization/invalid.c
 create mode 100644 tests/spec/intel_conservative_rasterization/tri.c

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


[Piglit] [PATCH 1/2] Add GL_INTEL_conservative_rasterization tests

2016-12-01 Thread Lionel Landwerlin
This extension is a subset of GL_NV_conservative_raster, applying only
to polygons.

Signed-off-by: Lionel Landwerlin 
---
 tests/all.py   |   5 +
 tests/spec/CMakeLists.txt  |   2 +
 .../spec/arb_post_depth_coverage/CMakeLists.gl.txt |  11 +
 tests/spec/arb_post_depth_coverage/CMakeLists.txt  |   1 +
 tests/spec/arb_post_depth_coverage/basic.c | 240 +
 .../CMakeLists.gl.txt  |  16 ++
 .../CMakeLists.txt |   1 +
 .../depthcoverage.c|  67 ++
 .../innercoverage.c| 147 +
 .../intel_conservative_rasterization/invalid.c | 106 +
 tests/spec/intel_conservative_rasterization/tri.c  | 120 +++
 11 files changed, 716 insertions(+)
 create mode 100644 tests/spec/arb_post_depth_coverage/CMakeLists.gl.txt
 create mode 100644 tests/spec/arb_post_depth_coverage/CMakeLists.txt
 create mode 100644 tests/spec/arb_post_depth_coverage/basic.c
 create mode 100644 
tests/spec/intel_conservative_rasterization/CMakeLists.gl.txt
 create mode 100644 tests/spec/intel_conservative_rasterization/CMakeLists.txt
 create mode 100644 tests/spec/intel_conservative_rasterization/depthcoverage.c
 create mode 100644 tests/spec/intel_conservative_rasterization/innercoverage.c
 create mode 100644 tests/spec/intel_conservative_rasterization/invalid.c
 create mode 100644 tests/spec/intel_conservative_rasterization/tri.c

diff --git a/tests/all.py b/tests/all.py
index 30df61c..355edee 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4756,6 +4756,11 @@ with profile.test_list.group_manager(
 g(['arb_shader_image_load_store-unused'], 'unused')
 
 with profile.test_list.group_manager(
+PiglitGLTest,
+grouptools.join('spec', 'arb_post_depth_coverage')) as g:
+g(['arb_post_depth_coverage-basic'])
+
+with profile.test_list.group_manager(
 PiglitGLTest,
 grouptools.join('spec', 'arb_shader_image_size')) as g:
 g(['arb_shader_image_size-builtin'], 'builtin')
diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index 4ac1a53..8bd0f9b 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -153,3 +153,5 @@ add_subdirectory (arb_query_buffer_object)
 add_subdirectory (ext_window_rectangles)
 add_subdirectory (arb_shader_texture_image_samples)
 add_subdirectory (arb_texture_barrier)
+add_subdirectory (arb_post_depth_coverage)
+add_subdirectory (intel_conservative_rasterization)
diff --git a/tests/spec/arb_post_depth_coverage/CMakeLists.gl.txt 
b/tests/spec/arb_post_depth_coverage/CMakeLists.gl.txt
new file mode 100644
index 000..1a71774
--- /dev/null
+++ b/tests/spec/arb_post_depth_coverage/CMakeLists.gl.txt
@@ -0,0 +1,11 @@
+include_directories(
+   ${GLEXT_INCLUDE_DIR}
+   ${OPENGL_INCLUDE_PATH}
+)
+
+link_libraries (
+   piglitutil_${piglit_target_api}
+   ${OPENGL_gl_LIBRARY}
+)
+
+piglit_add_executable (arb_post_depth_coverage-basic basic.c)
diff --git a/tests/spec/arb_post_depth_coverage/CMakeLists.txt 
b/tests/spec/arb_post_depth_coverage/CMakeLists.txt
new file mode 100644
index 000..144a306
--- /dev/null
+++ b/tests/spec/arb_post_depth_coverage/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git a/tests/spec/arb_post_depth_coverage/basic.c 
b/tests/spec/arb_post_depth_coverage/basic.c
new file mode 100644
index 000..92942ee
--- /dev/null
+++ b/tests/spec/arb_post_depth_coverage/basic.c
@@ -0,0 +1,240 @@
+/*
+ * 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.
+ */
+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+   config.supports_gl_compat_version =

[Piglit] [PATCH 2/2] generated_tests: new compiler tests for INTEL_conservative_rasterization

2016-12-01 Thread Lionel Landwerlin
Signed-off-by: Lionel Landwerlin 
---
 generated_tests/CMakeLists.txt |   4 +
 .../gen_shader_intel_conservative_rasterization.py | 173 +
 2 files changed, 177 insertions(+)
 create mode 100644 
generated_tests/gen_shader_intel_conservative_rasterization.py

diff --git a/generated_tests/CMakeLists.txt b/generated_tests/CMakeLists.txt
index c22ac20..7aee214 100644
--- a/generated_tests/CMakeLists.txt
+++ b/generated_tests/CMakeLists.txt
@@ -153,6 +153,9 @@ piglit_make_generated_tests(
templates/gen_conversion_fp64/shader_base.mako
)
 piglit_make_generated_tests(
+   shader_intel_conservative_rasterization.list
+   gen_shader_intel_conservative_rasterization.py)
+piglit_make_generated_tests(
shader_precision_tests.list
gen_shader_precision_tests.py
builtin_function.py
@@ -250,6 +253,7 @@ add_custom_target(gen-gl-tests
shader_framebuffer_fetch_tests.list
shader_image_load_store_tests.list
shader_image_nv_image_formats_tests.list
+   shader_intel_conservative_rasterization.list
variable_index_read_tests.list
gen_extensions_defined.list
vp-tex.list
diff --git a/generated_tests/gen_shader_intel_conservative_rasterization.py 
b/generated_tests/gen_shader_intel_conservative_rasterization.py
new file mode 100644
index 000..5a3a5e9
--- /dev/null
+++ b/generated_tests/gen_shader_intel_conservative_rasterization.py
@@ -0,0 +1,173 @@
+# coding=utf-8
+#
+# Copyright (C) 2016 Intel Corporation
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+"""Generate a set of tests to verify that layout qualifiers introduced
+ by INTEL_conservative_rasterization are properly parsed.
+
+ This also verifies the interaction with ARB_post_depth_coverage.
+
+ This program outputs, to stdout, the name of each file it generates.
+
+"""
+
+import os.path
+from textwrap import dedent
+
+from mako.template import Template
+
+from modules import utils
+
+def gen_header(status, gl_api, shader_stage):
+"""
+Generate a GLSL program header.
+
+Generate header code for INTEL_conservative_rasterization GLSL parser
+tests that are expected to give status as result.
+"""
+
+if shader_stage != 'frag':
+status = 'fail'
+print("%s - %s" % (shader_stage, status))
+
+if gl_api == "gles":
+glsl_version = ("3.20 es", "320 es")
+else:
+glsl_version = ("4.20", "420")
+
+return dedent("""
+/*
+ * [config]
+ * expect_result: {0}
+ * glsl_version: {1}
+ * require_extensions: GL_INTEL_conservative_rasterization
+ * [end config]
+ */
+#version {2}
+#extension GL_INTEL_conservative_rasterization : enable
+""".format(status, glsl_version[0], glsl_version[1]))
+
+
+def gen(name, src, tests):
+"""
+Expand a source template for the provided list of test definitions.
+
+Generate a GLSL parser test for each of the elements of the
+'tests' iterable, each of them should be a dictionary of
+definitions that will be used as environment to render the source
+template.
+
+The file name of each test will be the concatenation of the 'name'
+argument with the 'name' item from the respective test dictionary.
+"""
+template = Template(dedent(src))
+
+for t in product([{'name': name}], tests):
+filename = os.path.join('spec',
+'intel_conservative_rasterization',
+   

[Piglit] [PATCH] Add nv_image_formats tests

2016-11-11 Thread Lionel Landwerlin
Following the compiler tests added by edee46325935, we can also check that
no errors are raised with new formats through glBindImageTexture().

Signed-off-by: Lionel Landwerlin 
---
 tests/spec/CMakeLists.txt|   1 +
 tests/spec/nv_image_formats/CMakeLists.gles3.txt |   7 +
 tests/spec/nv_image_formats/CMakeLists.txt   |   1 +
 tests/spec/nv_image_formats/copy-image-formats.c | 287 +++
 4 files changed, 296 insertions(+)
 create mode 100644 tests/spec/nv_image_formats/CMakeLists.gles3.txt
 create mode 100644 tests/spec/nv_image_formats/CMakeLists.txt
 create mode 100644 tests/spec/nv_image_formats/copy-image-formats.c

diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index a057c02..4ac1a53 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -87,6 +87,7 @@ add_subdirectory (ext_texture_swizzle)
 add_subdirectory (ext_timer_query)
 add_subdirectory (ext_transform_feedback)
 add_subdirectory (nv_conditional_render)
+add_subdirectory (nv_image_formats)
 add_subdirectory (nv_texture_barrier)
 add_subdirectory (oes_compressed_etc1_rgb8_texture)
 add_subdirectory (oes_compressed_paletted_texture)
diff --git a/tests/spec/nv_image_formats/CMakeLists.gles3.txt 
b/tests/spec/nv_image_formats/CMakeLists.gles3.txt
new file mode 100644
index 000..b9750b2
--- /dev/null
+++ b/tests/spec/nv_image_formats/CMakeLists.gles3.txt
@@ -0,0 +1,7 @@
+link_libraries(
+   piglitutil_${piglit_target_api}
+   )
+
+piglit_add_executable (nv_image_formats-gles3 copy-image-formats.c)
+
+# vim: ft=cmake:
diff --git a/tests/spec/nv_image_formats/CMakeLists.txt 
b/tests/spec/nv_image_formats/CMakeLists.txt
new file mode 100644
index 000..144a306
--- /dev/null
+++ b/tests/spec/nv_image_formats/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git a/tests/spec/nv_image_formats/copy-image-formats.c 
b/tests/spec/nv_image_formats/copy-image-formats.c
new file mode 100644
index 000..132ec7b
--- /dev/null
+++ b/tests/spec/nv_image_formats/copy-image-formats.c
@@ -0,0 +1,287 @@
+/*
+ * Copyright (C) 2016 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/** @file copy-image-formats.c
+ *
+ * A simple test verifying we can make use of the additional OpenGL ES 3.1
+ * image formats provided by the GL_NV_image_formats extension. The
+ * normalized 16 bits format provided by this extension are subject to the
+ * condition that GL_EXT_texture_norm16 or equivalent is available.
+ */
+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+config.supports_gl_es_version = 31;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+#define WIDTH 16
+#define HEIGHT 16
+
+const struct image_format {
+   /** Format name as specified by GLSL. */
+   const char *name;
+
+   /** Format enum. */
+   GLenum format;
+
+   /** Pixel transfer format (e.g. as specified for glGetTexImage()). */
+   GLenum pixel_format;
+
+   /** Pixel transfer type (e.g. as specified for glGetTexImage()). */
+   GLenum pixel_type;
+} image_formats[] = {
+{ "rg32f", GL_RG32F, GL_RG, GL_FLOAT },
+{ "rg16f", GL_RG16F, GL_RG, GL_HALF_FLOAT },
+{ "r11f_g11f_b10f", GL_R11F_G11F_B10F, GL_RGB, 
GL_UNSIGNED_INT_10F_11F_11F_REV },
+{ "r16f", GL_R16F, GL_RED, GL_HALF_FLOAT },
+{ "rgb10_a2ui", GL_RGB10_A2UI, GL_RGBA_INTEGER, 
GL_UNSIGNED_INT_2_10_10_10_REV },
+{ "rg32ui", GL_RG32UI, GL_RG_INTEGER, GL_UNSIGNED_INT },
+{ "rg16ui", GL_RG16UI, GL_RG_INTEGER, GL_UNSIGNED_SHORT },
+{ "rg8ui", GL_RG8UI, GL_RG_INTEGER, GL_UNSIGNED_BYTE },
+{ "r16ui", GL_R16UI, GL_RED_INTEGER, GL_UNSIGNED_SHORT },
+{ "r8ui", GL_R8UI, GL_RED_INTEGER, GL_UNSIGNED_BYTE },
+{ "rg32i&

[Piglit] [PATCH v2 2/2] generated_tests: new compiler tests for NV_image_formats

2016-11-09 Thread Lionel Landwerlin
This tests that the compiler accepts the new layout formats introduced by
NV_image_formats and also it's correct interaction with the
EXT_texture_norm16 specification.

v2: Only disallow normalized formats when EXT_texture_norm16 is not
available (Ilia)

Signed-off-by: Lionel Landwerlin 
---
 generated_tests/CMakeLists.txt |   4 +
 .../gen_shader_image_nv_image_formats_tests.py | 239 +
 2 files changed, 243 insertions(+)
 create mode 100644 generated_tests/gen_shader_image_nv_image_formats_tests.py

diff --git a/generated_tests/CMakeLists.txt b/generated_tests/CMakeLists.txt
index ff43af5..fd38afe 100644
--- a/generated_tests/CMakeLists.txt
+++ b/generated_tests/CMakeLists.txt
@@ -163,6 +163,9 @@ piglit_make_generated_tests(
shader_image_load_store_tests.list
gen_shader_image_load_store_tests.py)
 piglit_make_generated_tests(
+   shader_image_nv_image_formats_tests.list
+   gen_shader_image_nv_image_formats_tests.py)
+piglit_make_generated_tests(
variable_index_read_tests.list
gen_variable_index_read_tests.py
templates/gen_variable_index_read_tests/vs.shader_test.mako
@@ -242,6 +245,7 @@ add_custom_target(gen-gl-tests
conversion_fp64.list
shader_precision_tests.list
shader_image_load_store_tests.list
+   shader_image_nv_image_formats_tests.list
variable_index_read_tests.list
gen_extensions_defined.list
vp-tex.list
diff --git a/generated_tests/gen_shader_image_nv_image_formats_tests.py 
b/generated_tests/gen_shader_image_nv_image_formats_tests.py
new file mode 100644
index 000..de6d244
--- /dev/null
+++ b/generated_tests/gen_shader_image_nv_image_formats_tests.py
@@ -0,0 +1,239 @@
+# coding=utf-8
+#
+# Copyright (C) 2016 Intel Corporation
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+from __future__ import print_function, division, absolute_import
+import os.path
+from mako.template import Template
+from textwrap import dedent
+
+from modules import utils
+
+
+def gen_header(status, norm16):
+"""
+Generate a GLSL program header.
+
+Generate header code for ARB_shader_image_load_store GLSL parser
+tests that are expected to give status as result.
+"""
+return dedent("""
+/*
+ * [config]
+ * expect_result: {0}
+ * glsl_version: 3.10 es
+ * require_extensions: GL_NV_image_formats {1}
+ * [end config]
+ */
+#version 310 es
+#extension GL_NV_image_formats : enable
+""".format(status, "GL_EXT_texture_norm16" if norm16 else 
"!GL_EXT_texture_norm16"))
+
+
+def gen(name, src, tests):
+"""
+Expand a source template for the provided list of test definitions.
+
+Generate a GLSL parser test for each of the elements of the
+'tests' iterable, each of them should be a dictionary of
+definitions that will be used as environment to render the source
+template.
+
+The file name of each test will be the concatenation of the 'name'
+argument with the 'name' item from the respective test dictionary.
+"""
+template = Template(dedent(src))
+
+for t in product([{'name': name}], tests):
+filename = os.path.join('spec',
+'nv_image_formats',
+'compiler',
+'{0}.{1}'.format(t['name'],
+ t['shader_stage']))
+print(filename)
+
+dirname = os.path.dirname(filename)
+uti

[Piglit] [PATCH v2 1/2] gen_extensions_defined.py: add NV_image_formats

2016-11-09 Thread Lionel Landwerlin
This extensions is written against OpenGL ES 3.1 and 3.10 of the OpenGL ES
Shading Language specification.

v2: Fix missing 'GL_' prefix (Ilia)

Signed-off-by: Lionel Landwerlin 
---
 generated_tests/gen_extensions_defined.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/generated_tests/gen_extensions_defined.py 
b/generated_tests/gen_extensions_defined.py
index d42e6ad..3b34443 100644
--- a/generated_tests/gen_extensions_defined.py
+++ b/generated_tests/gen_extensions_defined.py
@@ -127,6 +127,7 @@ EXTENSIONS = [
 ("GL_EXT_texture_buffer", "310 es"),
 ("GL_OES_texture_buffer", "310 es"),
 ("GL_EXT_clip_cull_distance", "300 es"),
+("GL_NV_image_formats", "310 es"),
 ]
 EXTENSIONS = [(n, glsl.Version(v)) for n, v in EXTENSIONS]

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


[Piglit] [PATCH 2/2] generated_tests: new compiler tests for NV_image_formats

2016-11-09 Thread Lionel Landwerlin
This tests that the compiler accepts the new layout formats introduced by
NV_image_formats and also it's correct interaction with the
EXT_texture_norm16 specification.

Signed-off-by: Lionel Landwerlin 
---
 generated_tests/CMakeLists.txt |   4 +
 .../gen_shader_image_nv_image_formats_tests.py | 230 +
 2 files changed, 234 insertions(+)
 create mode 100644 generated_tests/gen_shader_image_nv_image_formats_tests.py

diff --git a/generated_tests/CMakeLists.txt b/generated_tests/CMakeLists.txt
index ff43af5..fd38afe 100644
--- a/generated_tests/CMakeLists.txt
+++ b/generated_tests/CMakeLists.txt
@@ -163,6 +163,9 @@ piglit_make_generated_tests(
shader_image_load_store_tests.list
gen_shader_image_load_store_tests.py)
 piglit_make_generated_tests(
+   shader_image_nv_image_formats_tests.list
+   gen_shader_image_nv_image_formats_tests.py)
+piglit_make_generated_tests(
variable_index_read_tests.list
gen_variable_index_read_tests.py
templates/gen_variable_index_read_tests/vs.shader_test.mako
@@ -242,6 +245,7 @@ add_custom_target(gen-gl-tests
conversion_fp64.list
shader_precision_tests.list
shader_image_load_store_tests.list
+   shader_image_nv_image_formats_tests.list
variable_index_read_tests.list
gen_extensions_defined.list
vp-tex.list
diff --git a/generated_tests/gen_shader_image_nv_image_formats_tests.py 
b/generated_tests/gen_shader_image_nv_image_formats_tests.py
new file mode 100644
index 000..9b1861d
--- /dev/null
+++ b/generated_tests/gen_shader_image_nv_image_formats_tests.py
@@ -0,0 +1,230 @@
+# coding=utf-8
+#
+# Copyright (C) 2016 Intel Corporation
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+from __future__ import print_function, division, absolute_import
+import os.path
+from mako.template import Template
+from textwrap import dedent
+
+from modules import utils
+
+
+def gen_header(status, norm16):
+"""
+Generate a GLSL program header.
+
+Generate header code for ARB_shader_image_load_store GLSL parser
+tests that are expected to give status as result.
+"""
+return dedent("""
+/*
+ * [config]
+ * expect_result: {0}
+ * glsl_version: 3.10 es
+ * require_extensions: GL_NV_image_formats {1}
+ * [end config]
+ */
+#version 310 es
+#extension GL_NV_image_formats : enable
+""".format(status, "GL_EXT_texture_norm16" if norm16 else 
"!GL_EXT_texture_norm16"))
+
+
+def gen(name, src, tests):
+"""
+Expand a source template for the provided list of test definitions.
+
+Generate a GLSL parser test for each of the elements of the
+'tests' iterable, each of them should be a dictionary of
+definitions that will be used as environment to render the source
+template.
+
+The file name of each test will be the concatenation of the 'name'
+argument with the 'name' item from the respective test dictionary.
+"""
+template = Template(dedent(src))
+
+for t in product([{'name': name}], tests):
+filename = os.path.join('spec',
+'nv_image_formats',
+'compiler',
+'{0}.{1}'.format(t['name'],
+ t['shader_stage']))
+print(filename)
+
+dirname = os.path.dirname(filename)
+utils.safe_makedirs(dirname)
+
+with open(filename, 'w') as f:
+f.write(templ

[Piglit] [PATCH 0/2] Tests for NV_image_formats

2016-11-09 Thread Lionel Landwerlin
Hi all,

We do have some interest to have support for R8 images in GLES on
Intel hardware for ChromeOS [1] and it seems enabling the
NV_image_formats extension is the way to go.

I'm not quite sure how much this needs to be tested. Any direction
would be really helpful. For now, here are some basic tests to verify
that the compiler doesn't rejects new formats with the
NV_image_formats [2] extension.

Cheers,

[1]: https://bugs.freedesktop.org/show_bug.cgi?id=98480
[2]: https://www.khronos.org/registry/gles/extensions/NV/NV_image_formats.txt

Lionel Landwerlin (2):
  gen_extensions_defined.py: add NV_image_formats
  generated_tests: new compiler tests for NV_image_formats

 generated_tests/CMakeLists.txt |   4 +
 generated_tests/gen_extensions_defined.py  |   1 +
 .../gen_shader_image_nv_image_formats_tests.py | 230 +
 3 files changed, 235 insertions(+)
 create mode 100644 generated_tests/gen_shader_image_nv_image_formats_tests.py

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


[Piglit] [PATCH 1/2] gen_extensions_defined.py: add NV_image_formats

2016-11-09 Thread Lionel Landwerlin
This extensions is written against OpenGL ES 3.1 and 3.10 of the OpenGL ES
Shading Language specification.

Signed-off-by: Lionel Landwerlin 
---
 generated_tests/gen_extensions_defined.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/generated_tests/gen_extensions_defined.py 
b/generated_tests/gen_extensions_defined.py
index d42e6ad..42a8791 100644
--- a/generated_tests/gen_extensions_defined.py
+++ b/generated_tests/gen_extensions_defined.py
@@ -127,6 +127,7 @@ EXTENSIONS = [
 ("GL_EXT_texture_buffer", "310 es"),
 ("GL_OES_texture_buffer", "310 es"),
 ("GL_EXT_clip_cull_distance", "300 es"),
+("NV_image_formats", "310 es"),
 ]
 EXTENSIONS = [(n, glsl.Version(v)) for n, v in EXTENSIONS]
 
-- 
2.10.2

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