Re: [Piglit] [Mesa-dev] Rename "master" branch to "main"?

2021-03-26 Thread Jason Ekstrand
On Thu, Mar 25, 2021 at 9:41 AM Rob Clark  wrote:
>
> On Wed, Mar 24, 2021 at 9:15 PM Jason Ekstrand  wrote:
> >
> > On March 24, 2021 22:25:10 Rob Clark  wrote:
> >
> >> On Wed, Mar 24, 2021 at 3:52 PM Jordan Justen  
> >> wrote:
> >>>
> >>>
> >>> On 2021-03-23 09:38:59, Eric Anholt wrote:
> >>>>
> >>>> On Tue, Mar 23, 2021 at 7:02 AM Jason Ekstrand  
> >>>> wrote:
> >>>>>
> >>>>>
> >>>>> Trying to pick this discussion back up.  Daniel Stone thinks it's a
> >>>>> half hour of API bashing to retarget all the MRs so, if the fd.o
> >>>>> admins have some heads up, it should be tractable.  Should we do this
> >>>>> right after branching 21.1 along with the LTS branch?
> >>>>
> >>>>
> >>>> +1
> >>>
> >>>
> >>> Jason,
> >>>
> >>> I opened a related Mesa issue:
> >>> https://gitlab.freedesktop.org/mesa/mesa/-/issues/4501
> >>>
> >>> I made this change in crucible, and used a script to update the 7 MR
> >>> target branches:
> >>> https://gitlab.freedesktop.org/mesa/crucible/-/issues/5
> >>>
> >>> As mentioned in the Mesa issue, I think we should use piglit as
> >>> another test run before changing Mesa:
> >>> https://gitlab.freedesktop.org/mesa/piglit/-/issues/50
> >>>
> >>> Piglit currently has 60 open merge requests.
> >>
> >>
> >> I'm in favor of branch rename, but was in the camp of "hope gitlab
> >> comes up with a way to make this easy for us".. but as far as fallback
> >> plan, converting trees with fewer outstanding MRs first seems like a
> >> pretty good idea so solid +1 for that
> >
> >
> > If you read enough off the things, you'll see that Jordan wrote a python 
> > script that re-targets all the open MRs so that's not a manual process. 
> > It's not a GitLab-sanctioned solution but it's the next best thing. The one 
> > downside is that all the MRs will get their last updated timestamp reset 
> > but that seems like a pretty small price to pay.
> >
>
> yeah, I meant to convert a repo w/ more MRs than 7 but less than mesa
> using the script to beta test that, wasn't suggesting to do it by hand

Plan is to convert piglit next.  It's sitting at about 60 open MRs.

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


Re: [Piglit] [Mesa-dev] Rename "master" branch to "main"?

2021-03-26 Thread Jason Ekstrand

On March 24, 2021 22:25:10 Rob Clark  wrote:

On Wed, Mar 24, 2021 at 3:52 PM Jordan Justen  
wrote:


On 2021-03-23 09:38:59, Eric Anholt wrote:

On Tue, Mar 23, 2021 at 7:02 AM Jason Ekstrand  wrote:


Trying to pick this discussion back up.  Daniel Stone thinks it's a
half hour of API bashing to retarget all the MRs so, if the fd.o
admins have some heads up, it should be tractable.  Should we do this
right after branching 21.1 along with the LTS branch?


+1


Jason,

I opened a related Mesa issue:
https://gitlab.freedesktop.org/mesa/mesa/-/issues/4501

I made this change in crucible, and used a script to update the 7 MR
target branches:
https://gitlab.freedesktop.org/mesa/crucible/-/issues/5

As mentioned in the Mesa issue, I think we should use piglit as
another test run before changing Mesa:
https://gitlab.freedesktop.org/mesa/piglit/-/issues/50

Piglit currently has 60 open merge requests.


I'm in favor of branch rename, but was in the camp of "hope gitlab
comes up with a way to make this easy for us".. but as far as fallback
plan, converting trees with fewer outstanding MRs first seems like a
pretty good idea so solid +1 for that


If you read enough off the things, you'll see that Jordan wrote a python 
script that re-targets all the open MRs so that's not a manual process. 
It's not a GitLab-sanctioned solution but it's the next best thing. The one 
downside is that all the MRs will get their last updated timestamp reset 
but that seems like a pretty small price to pay.


Jordan, is there any way you can make the script sort by last updated 
before it re-targets the MRs so they at least stay in the same order? 
Updating them in MR # order wouldn't be bad either, I guess.


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


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

2019-02-14 Thread Jason Ekstrand
rb

On Thu, Feb 14, 2019 at 12:49 PM Lionel Landwerlin <
lionel.g.landwer...@intel.com> wrote:

> 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] [Announce] Swineherd: A piglit test runner written in C++

2019-01-03 Thread Jason Ekstrand
On Wed, Dec 19, 2018 at 3:57 PM Dylan Baker  wrote:

> Hi list,
>
> I've been off and on working on a new test runner for piglit written in
> C++14.
> Its been sitting on my gitlab publicly for a bit, and I've shared it with
> some
> people at Intel, but I thought I'd send out an announcement and see if I
> could
> get some more interest. It's called swineherd, and it lives here:
>
> https://gitlab.freedesktop.org/dbaker/swineherd
>
> Swineherd currently is pretty limited, it still needs a lot of work to be a
> replacement for the piglit runner, but it can run tests and get output,
> and does
> so much faster than the python runner.
>
> It currently can:
>  - read the gz compressed profile xml that piglit produces
>  - run tests
>  - get the output of tests
>  - write an uncompressed json file that piglit's summary tools can consume
>  - only builds and runs on Linux
>
> I have a few opened issues on the gitlab tracker for it, that I may or may
> not
> get around to doing all of.
>
> I currently don't plan this to support every single option piglit does,
> because
> my main concern with swineherd is performance, I want this runner to be as
> fast
> as possible. Among the things I don't want to implement:
>
>  - dmesg support. This forces serial test running and pauses between tests.
>  - reboot on failure support
>

Those two nerf piglit runtimes so badly that you're not going to gain
anything from a C++ runner.  I'm perfectly happy for us to carry python for
that for now.


>  - other things I haven't mentioned
>
> I'd be happy to take MRs for this, if you'd like to add things or fix
> things :)
>
> I'm also opened to merging this into piglit proper, once I feel like it's
> pretty
> stable and has enough features to be generally useful.
>
> Dylan
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] shaders: Verify that -int(some_bool) & value is handled correctly

2018-12-18 Thread Jason Ekstrand
On Tue, Dec 18, 2018 at 3:56 PM Ian Romanick  wrote:

> From: Ian Romanick 
>
> This reproduces bug #109075.  In that bug, '-int(XYZ) & anything' was
> optimized as though it were '-int(XYZ) & floatBitsToInt(1.0)'.
>
> Signed-off-by: Ian Romanick 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109075
> ---
>  ...glsl-fs-bitwise-and-Boolean-and-1.0.shader_test | 32
> ++
>  1 file changed, 32 insertions(+)
>  create mode 100644
> tests/shaders/glsl-fs-bitwise-and-Boolean-and-1.0.shader_test
>
> diff --git a/tests/shaders/glsl-fs-bitwise-and-Boolean-and-1.0.shader_test
> b/tests/shaders/glsl-fs-bitwise-and-Boolean-and-1.0.shader_test
> new file mode 100644
> index 0..e59656326
> --- /dev/null
> +++ b/tests/shaders/glsl-fs-bitwise-and-Boolean-and-1.0.shader_test
> @@ -0,0 +1,32 @@
> +[require]
> +GLSL >= 1.30
> +GL_ARB_shader_bit_encoding
> +
> +[vertex shader passthrough]
> +
> +[fragment shader]
> +#extension GL_ARB_shader_bit_encoding: enable
> +
> +out vec4 piglit_fragcolor;
> +
> +uniform int x = 37;
> +uniform int y = 46;
>

Wow.  I think this may be the best use I've ever seen of uniform
initializers. :-)

Seems to do the thing in the bug.

Reviewed-by: Jason Ekstrand 


> +
> +void main()
> +{
> +bool a = x == 37;// Must be true.
> +bool b = y == 46;// Must be true.
> +
> +/* This reproduces bug #109075.  In that bug, '-int(XYZ) & anything'
> was
> + * optimized as though it were '-int(XYZ) & floatBitsToInt(1.0)'.
> + */
> +piglit_fragcolor = vec4(intBitsToFloat(-int(a) & floatBitsToInt(0.5)),
> +   intBitsToFloat(-int(b) & floatBitsToInt(0.5)),
> +   0.0,
> +   1.0);
> +}
> +
> +[test]
> +draw rect -1 -1 2 2
> +probe all rgba 0.5 0.5 0.0 1.0
> +
> --
> 2.14.5
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] remove ext_image_dma_buf_import-intel_external_sampler_with_dma_only

2018-11-09 Thread Jason Ekstrand
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 };
> -   EGLImageKHR img = create_tex_based_egl_image(1, 1, src);
> -
> -   if (img == EGL_NO_IMAGE_KHR)
> -  return PIGLIT_FAIL;
> -
> -   glGenTextures(1, &tex);
> -   glBindTexture(GL_TEXTURE_EXTERNAL_OES, tex);
> -
> -   glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES,
> -  (GLeglImageOES)img);
> -
> -   if (piglit_check_gl_error(GL_INVALID_OPERATION))
> -  result = PIGLIT_PASS;
> -
> -   glDeleteTextures(1, &tex);
> -   eglDestroyImageKHR(eglGetCurrentDisplay(), img);
> -
> -   return result;
> -}
> -
> -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");
>

Any test that does this is bogus.  We tests specs, not Intel's
interpretation of specs.

Acked-by: Jason Ekstrand 


> -   piglit_report_result(PIGLIT_SKIP);
> -   }
> -}
> --
> 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


Re: [Piglit] [PATCH] builtin_packing: Add swizzles to the sources of packing functions

2018-10-11 Thread Jason Ekstrand
commit dd553bc67f8ab1513fd196b6ffb7c4a76723adfd
Author: Jason Ekstrand 
Date:   Wed Oct 3 12:14:20 2018 -0500

nir/alu_to_scalar: Use ssa_for_alu_src in hand-rolled expansions

The ssa_for_alu_src helper will correctly handle swizzles and other
source modifiers for you.  The expansions for unpack_half_2x16,
pack_uvec2_to_uint, and pack_uvec4_to_uint were all broken with regards
to swizzles.  The brokenness of unpack_half_2x16 was causing rendering
errors in Rise of the Tomb Raider on Intel ever since c11833ab24dcba26
which added an extra copy propagation to the optimization pipeline and
caused us to start seeing swizzles where we hadn't seen any before.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107926
Fixes: 9ce901058f3d "nir: Add lowering of nir_op_unpack_half_2x16."
Fixes: 9b8786eba955 "nir: Add lowering support for packing opcodes."
Tested-by: Alex Smith 
Tested-by: Józef Kucia 
Reviewed-by: Matt Turner 


On Wed, Oct 10, 2018 at 1:45 PM Ian Romanick  wrote:

> These changes look good, but I'm wondering why. :)  Did you find some
> bug, or ... ?
>
> On 10/04/2018 10:42 AM, Jason Ekstrand wrote:
> > ---
> >  .../fs_pack.shader_test.mako   | 14 +++---
> >  .../fs_unpack.shader_test.mako |  6 +++---
> >  .../vs_pack.shader_test.mako   | 14 +++---
> >  .../vs_unpack.shader_test.mako |  6 +++---
> >  4 files changed, 28 insertions(+), 12 deletions(-)
> >
> > diff --git
> a/generated_tests/templates/gen_builtin_packing_tests/fs_pack.shader_test.mako
> b/generated_tests/templates/gen_builtin_packing_tests/fs_pack.shader_test.mako
> > index 4c053bf89..86c63061e 100644
> > ---
> a/generated_tests/templates/gen_builtin_packing_tests/fs_pack.shader_test.mako
> > +++
> b/generated_tests/templates/gen_builtin_packing_tests/fs_pack.shader_test.mako
> > @@ -21,7 +21,7 @@ precision highp float;
> >  const vec4 red = vec4(1, 0, 0, 1);
> >  const vec4 green = vec4(0, 1, 0, 1);
> >
> > -uniform ${func.vector_type} func_input;
> > +uniform vec4 func_input;
> >
> >  % for i in range(func.num_valid_outputs):
> >  uniform ${func.result_precision} uint expect${i};
> > @@ -31,7 +31,11 @@ out vec4 frag_color;
> >
> >  void main()
> >  {
> > -${func.result_precision} uint actual = ${func.name}(func_input);
> > +% if func.vector_type == 'vec2':
> > +${func.result_precision} uint actual = ${func.name}(func_input.wx);
> > +% else:
> > +${func.result_precision} uint actual = ${func.name
> }(func_input.wxzy);
> > +% endif
> >
> >  if (false
> >  % for i in range(func.num_valid_outputs):
> > @@ -53,7 +57,11 @@ vertex/float/2
> >
> >  [test]
> >  % for io in func.inout_seq:
> > -uniform ${func.vector_type} func_input ${" ".join(io.input)}
> > +% if func.vector_type == 'vec2':
> > +uniform vec4 func_input ${io.input[1]} 0.0 0.0 ${io.input[0]}
> > +% else:
> > +uniform vec4 func_input ${io.input[1]} ${io.input[3]} ${io.input[2]}
> ${io.input[0]}
> > +% endif
> >  % for i in range(func.num_valid_outputs):
> >  uniform uint expect${i} ${io.valid_outputs[i]}
> >  % endfor
> > diff --git
> a/generated_tests/templates/gen_builtin_packing_tests/fs_unpack.shader_test.mako
> b/generated_tests/templates/gen_builtin_packing_tests/fs_unpack.shader_test.mako
> > index ee610bbfb..8e3f12a58 100644
> > ---
> a/generated_tests/templates/gen_builtin_packing_tests/fs_unpack.shader_test.mako
> > +++
> b/generated_tests/templates/gen_builtin_packing_tests/fs_unpack.shader_test.mako
> > @@ -21,7 +21,7 @@ precision highp float;
> >  const vec4 red = vec4(1, 0, 0, 1);
> >  const vec4 green = vec4(0, 1, 0, 1);
> >
> > -uniform highp uint func_input;
> > +uniform highp uvec4 func_input;
> >
> >  uniform bool exact;
> >
> > @@ -33,7 +33,7 @@ out vec4 frag_color;
> >
> >  void main()
> >  {
> > -${func.result_precision} ${func.vector_type} actual = ${func.name
> }(func_input);
> > +${func.result_precision} ${func.vector_type} actual = ${func.name
> }(func_input.y);
> >
> >  if (false
> >  % for i in range(func.num_valid_outputs):
> > @@ -56,7 +56,7 @@ vertex/float/2
> >
> >  [test]
> >  % for io in func.inout_seq:
> > -uniform uint func_input ${io.input}
> > +uniform uvec4 func_input 0 ${io.input} 0 0
> >  % if func.exact:
> >  uniform int exact 1
> >  % else:
> > diff --git
>

[Piglit] [PATCH] builtin_packing: Add swizzles to the sources of packing functions

2018-10-04 Thread Jason Ekstrand
---
 .../fs_pack.shader_test.mako   | 14 +++---
 .../fs_unpack.shader_test.mako |  6 +++---
 .../vs_pack.shader_test.mako   | 14 +++---
 .../vs_unpack.shader_test.mako |  6 +++---
 4 files changed, 28 insertions(+), 12 deletions(-)

diff --git 
a/generated_tests/templates/gen_builtin_packing_tests/fs_pack.shader_test.mako 
b/generated_tests/templates/gen_builtin_packing_tests/fs_pack.shader_test.mako
index 4c053bf89..86c63061e 100644
--- 
a/generated_tests/templates/gen_builtin_packing_tests/fs_pack.shader_test.mako
+++ 
b/generated_tests/templates/gen_builtin_packing_tests/fs_pack.shader_test.mako
@@ -21,7 +21,7 @@ precision highp float;
 const vec4 red = vec4(1, 0, 0, 1);
 const vec4 green = vec4(0, 1, 0, 1);
 
-uniform ${func.vector_type} func_input;
+uniform vec4 func_input;
 
 % for i in range(func.num_valid_outputs):
 uniform ${func.result_precision} uint expect${i};
@@ -31,7 +31,11 @@ out vec4 frag_color;
 
 void main()
 {
-${func.result_precision} uint actual = ${func.name}(func_input);
+% if func.vector_type == 'vec2':
+${func.result_precision} uint actual = ${func.name}(func_input.wx);
+% else:
+${func.result_precision} uint actual = ${func.name}(func_input.wxzy);
+% endif
 
 if (false
 % for i in range(func.num_valid_outputs):
@@ -53,7 +57,11 @@ vertex/float/2
 
 [test]
 % for io in func.inout_seq:
-uniform ${func.vector_type} func_input ${" ".join(io.input)}
+% if func.vector_type == 'vec2':
+uniform vec4 func_input ${io.input[1]} 0.0 0.0 ${io.input[0]}
+% else:
+uniform vec4 func_input ${io.input[1]} ${io.input[3]} ${io.input[2]} 
${io.input[0]}
+% endif
 % for i in range(func.num_valid_outputs):
 uniform uint expect${i} ${io.valid_outputs[i]}
 % endfor
diff --git 
a/generated_tests/templates/gen_builtin_packing_tests/fs_unpack.shader_test.mako
 
b/generated_tests/templates/gen_builtin_packing_tests/fs_unpack.shader_test.mako
index ee610bbfb..8e3f12a58 100644
--- 
a/generated_tests/templates/gen_builtin_packing_tests/fs_unpack.shader_test.mako
+++ 
b/generated_tests/templates/gen_builtin_packing_tests/fs_unpack.shader_test.mako
@@ -21,7 +21,7 @@ precision highp float;
 const vec4 red = vec4(1, 0, 0, 1);
 const vec4 green = vec4(0, 1, 0, 1);
 
-uniform highp uint func_input;
+uniform highp uvec4 func_input;
 
 uniform bool exact;
 
@@ -33,7 +33,7 @@ out vec4 frag_color;
 
 void main()
 {
-${func.result_precision} ${func.vector_type} actual = 
${func.name}(func_input);
+${func.result_precision} ${func.vector_type} actual = 
${func.name}(func_input.y);
 
 if (false
 % for i in range(func.num_valid_outputs):
@@ -56,7 +56,7 @@ vertex/float/2
 
 [test]
 % for io in func.inout_seq:
-uniform uint func_input ${io.input}
+uniform uvec4 func_input 0 ${io.input} 0 0
 % if func.exact:
 uniform int exact 1
 % else:
diff --git 
a/generated_tests/templates/gen_builtin_packing_tests/vs_pack.shader_test.mako 
b/generated_tests/templates/gen_builtin_packing_tests/vs_pack.shader_test.mako
index 5f37d7eaf..81c725846 100644
--- 
a/generated_tests/templates/gen_builtin_packing_tests/vs_pack.shader_test.mako
+++ 
b/generated_tests/templates/gen_builtin_packing_tests/vs_pack.shader_test.mako
@@ -11,7 +11,7 @@ ${func.requirements}
 const vec4 red = vec4(1, 0, 0, 1);
 const vec4 green = vec4(0, 1, 0, 1);
 
-uniform ${func.vector_type} func_input;
+uniform vec4 func_input;
 
 % for j in range(func.num_valid_outputs):
 uniform ${func.result_precision} uint expect${j};
@@ -23,7 +23,11 @@ out vec4 vert_color;
 void main()
 {
 gl_Position = vertex;
-${func.result_precision} uint actual = ${func.name}(func_input);
+% if func.vector_type == 'vec2':
+${func.result_precision} uint actual = ${func.name}(func_input.zy);
+% else:
+${func.result_precision} uint actual = ${func.name}(func_input.wyzx);
+% endif
 
 if (false
 % for j in range(func.num_valid_outputs):
@@ -58,7 +62,11 @@ vertex/float/2
 
 [test]
 % for io in func.inout_seq:
-uniform ${func.vector_type} func_input ${" ".join(io.input)}
+% if func.vector_type == 'vec2':
+uniform vec4 func_input 0.0 ${io.input[1]} ${io.input[0]} 0.0
+% else:
+uniform vec4 func_input ${io.input[3]} ${io.input[1]} ${io.input[2]} 
${io.input[0]}
+% endif
 % for j in range(func.num_valid_outputs):
 uniform uint expect${j} ${io.valid_outputs[j]}
 % endfor
diff --git 
a/generated_tests/templates/gen_builtin_packing_tests/vs_unpack.shader_test.mako
 
b/generated_tests/templates/gen_builtin_packing_tests/vs_unpack.shader_test.mako
index 5f2a39125..c14fd35a0 100644
--- 
a/generated_tests/templates/gen_builtin_packing_tests/vs_unpack.shader_test.mako
+++ 
b/generated_tests/templates/gen_builtin_packing_tests/vs_unpack.shader_test.mako
@@ -11,7 +11,7 @@ ${func.requirements}
 const vec4 red = vec4(1, 0, 0, 1);
 const vec4 green = vec4(0, 1, 0, 1);
 
-uniform highp uint func_input;
+uniform highp uvec4 func_input;
 
 uniform bool exact;
 

Re: [Piglit] [PATCH 2/2] arb_fragment_shader_interlock: Additional compile tests

2018-08-28 Thread Jason Ekstrand
Both patches are

Reviewed-by: Jason Ekstrand 

Please send a 3rd with switch statements. :-)  Or, you can rev this patch.
I don't care.

--Jason

On Tue, Aug 28, 2018 at 5:13 PM Ian Romanick  wrote:

> From: Ian Romanick 
>
> The negative tests in this group require some inference from various
> specs.  A spec bug has been submitted against the
> GL_ARB_fragment_shader_interlock spec.
>
> Currently none of the negative tests produce the expected result on
> Mesa.
>
> Signed-off-by: Ian Romanick 
> ---
>  .../beginInvocationInterlock-after-discard.frag| 27 +++
>  .../beginInvocationInterlock-after-return.frag | 51
> +
>  .../beginInvocationInterlock-inside-do-while.frag  | 49
> 
>  .../beginInvocationInterlock-inside-for.frag   | 50
> +
>  .../beginInvocationInterlock-inside-if.frag| 48
> 
>  ...vocationInterlock-inside-non-main-function.frag | 51
> +
>  .../beginInvocationInterlock-inside-while.frag | 49
> 
>  .../endInvocationInterlock-after-discard.frag  | 28 
>  .../endInvocationInterlock-after-return.frag   | 52
> ++
>  .../endInvocationInterlock-inside-do-while.frag| 49
> 
>  .../endInvocationInterlock-inside-for.frag | 50
> +
>  .../compiler/endInvocationInterlock-inside-if.frag | 48
> 
>  ...vocationInterlock-inside-non-main-function.frag | 51
> +
>  .../endInvocationInterlock-inside-while.frag   | 50
> +
>  14 files changed, 653 insertions(+)
>  create mode 100644
> tests/spec/arb_fragment_shader_interlock/compiler/beginInvocationInterlock-after-discard.frag
>  create mode 100644
> tests/spec/arb_fragment_shader_interlock/compiler/beginInvocationInterlock-after-return.frag
>  create mode 100644
> tests/spec/arb_fragment_shader_interlock/compiler/beginInvocationInterlock-inside-do-while.frag
>  create mode 100644
> tests/spec/arb_fragment_shader_interlock/compiler/beginInvocationInterlock-inside-for.frag
>  create mode 100644
> tests/spec/arb_fragment_shader_interlock/compiler/beginInvocationInterlock-inside-if.frag
>  create mode 100644
> tests/spec/arb_fragment_shader_interlock/compiler/beginInvocationInterlock-inside-non-main-function.frag
>  create mode 100644
> tests/spec/arb_fragment_shader_interlock/compiler/beginInvocationInterlock-inside-while.frag
>  create mode 100644
> tests/spec/arb_fragment_shader_interlock/compiler/endInvocationInterlock-after-discard.frag
>  create mode 100644
> tests/spec/arb_fragment_shader_interlock/compiler/endInvocationInterlock-after-return.frag
>  create mode 100644
> tests/spec/arb_fragment_shader_interlock/compiler/endInvocationInterlock-inside-do-while.frag
>  create mode 100644
> tests/spec/arb_fragment_shader_interlock/compiler/endInvocationInterlock-inside-for.frag
>  create mode 100644
> tests/spec/arb_fragment_shader_interlock/compiler/endInvocationInterlock-inside-if.frag
>  create mode 100644
> tests/spec/arb_fragment_shader_interlock/compiler/endInvocationInterlock-inside-non-main-function.frag
>  create mode 100644
> tests/spec/arb_fragment_shader_interlock/compiler/endInvocationInterlock-inside-while.frag
>
> diff --git
> a/tests/spec/arb_fragment_shader_interlock/compiler/beginInvocationInterlock-after-discard.frag
> b/tests/spec/arb_fragment_shader_interlock/compiler/beginInvocationInterlock-after-discard.frag
> new file mode 100644
> index 0..1c74fa49c
> --- /dev/null
> +++
> b/tests/spec/arb_fragment_shader_interlock/compiler/beginInvocationInterlock-after-discard.frag
> @@ -0,0 +1,27 @@
> +// [config]
> +// expect_result: pass
> +// glsl_version: 4.20
> +// require_extensions: GL_ARB_fragment_shader_interlock
> +// [end config]
> +
> +/* The GL_ARB_fragment_shader_interlock spec says:
> + *
> + *The beginInvocationInterlockARB() and endInvocationInterlockARB()
> may
> + *only be placed inside the function main() of a fragment shader and
> may
> + *not be called within any flow control.  These functions may not be
> + *called after a return statement in the function main(), but may be
> + *called after a discard statement.
> + */
> +#version 420
> +#extension GL_ARB_fragment_shader_interlock: require
> +
> +in float f;
> +
> +void main()
> +{
> +   if (f < 0.5)
> +   discard;
> +
> +   beginInvocationInterlockARB();
> +   endInvocationInterlockARB();
> +}
> diff --git
> a/tests/spec/arb_fragment_shader_interlock/compiler/beginInvocationInterlock-after-return.fra

[Piglit] [PATCH 2/3] Add a test with a large constant array in the shader

2018-08-25 Thread Jason Ekstrand
---
 Makefile.am   |   2 +
 data/32x32-smile.ref.png  | Bin 0 -> 315 bytes
 src/tests/func/shader/constants.c | 245 ++
 3 files changed, 247 insertions(+)
 create mode 100644 data/32x32-smile.ref.png
 create mode 100644 src/tests/func/shader/constants.c

diff --git a/Makefile.am b/Makefile.am
index 7c4a52b..a96da9d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -98,6 +98,7 @@ bin_crucible_SOURCES = \
src/tests/func/interleaved-cmd-buffers.c \
src/tests/func/miptree/miptree.c \
src/tests/func/push-constants/basic.c \
+   src/tests/func/shader/constants.c \
src/tests/func/shader/fragcoord.c \
src/tests/func/shader/pack_unpack.c \
src/tests/func/shader_ballot/ext_shader_ballot.c \
@@ -144,6 +145,7 @@ BUILT_SOURCES = \
src/tests/func/push-constants/basic-spirv.h \
src/tests/func/amd/gcn_shader-spirv.h \
src/tests/func/amd/shader_trinary_minmax-spirv.h \
+   src/tests/func/shader/constants-spirv.h \
src/tests/func/shader/fragcoord-spirv.h \
src/tests/func/shader/pack_unpack-spirv.h \
src/tests/func/shader_ballot/ext_shader_ballot-spirv.h \
diff --git a/data/32x32-smile.ref.png b/data/32x32-smile.ref.png
new file mode 100644
index 
..80c5bf359361c378478a46e857f00109a26f699b
GIT binary patch
literal 315
zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0X7ltGxWVyS%@P>{XE
z)7O>#5t}T#yr9InASIxXWQl7;iF1B#Zfaf$gL6@8Vo7R>LV0FMhJw4NZ$Nk>pEyv_
zR!p=F`|8V;JvsN*eqD7(Z<>J4_P5jeUQOKD^+RIG<&$;t6Rxc&=ni|)cRJ;31U>gTe~
HDWM4fB2#y|

literal 0
HcmV?d1

diff --git a/src/tests/func/shader/constants.c 
b/src/tests/func/shader/constants.c
new file mode 100644
index 000..56b7194
--- /dev/null
+++ b/src/tests/func/shader/constants.c
@@ -0,0 +1,245 @@
+// 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 "tapi/t.h"
+
+#include "constants-spirv.h"
+
+static void
+test(void)
+{
+VkShaderModule vs = qoCreateShaderModuleGLSL(t_device, VERTEX,
+layout(location = 0) in vec4 a_position;
+void main()
+{
+gl_Position = a_position;
+}
+);
+
+VkShaderModule fs = qoCreateShaderModuleGLSL(t_device, FRAGMENT,
+layout(set = 0, binding = 0) uniform block1 {
+vec4 colors[3];
+} u;
+
+layout(location = 0) out vec4 f_color;
+
+const int table[32][32] = {
+{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
+{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
+{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
+{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0,
+  0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
+{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 2, 2, 2, 2,
+  2, 2, 2, 2, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
+{ 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 2, 2, 2, 2, 2, 2,
+  2, 2, 2, 2, 2, 2, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1 },
+{ 1, 1, 1, 1, 1, 1, 1, 0, 2, 2, 2, 2, 2, 2, 2, 2,
+  2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1 },
+{ 1, 1, 1, 1, 1, 1, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+  2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1 },
+{ 1, 1, 1, 1, 1, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+  2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1 },
+{ 1, 1, 1, 1, 1, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+  2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1 },
+{ 1, 1, 1, 1, 0, 2, 2, 2, 2, 2, 0, 0, 0, 2, 2, 2,
+  2, 2, 2, 0, 0, 0, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1 },
+{ 1, 1

[Piglit] [PATCH 3/3] Add a test for bug 104809

2018-08-25 Thread Jason Ekstrand
---
 Makefile.am|   3 +
 src/framework/test/t_dump.c|   2 +-
 src/framework/test/t_result.c  |   6 +-
 src/tests/bug/104809.c | 160 +
 src/tests/self/concurrent-output.c |   4 +-
 5 files changed, 169 insertions(+), 6 deletions(-)
 create mode 100644 src/tests/bug/104809.c

diff --git a/Makefile.am b/Makefile.am
index a96da9d..dc24a99 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -31,6 +31,7 @@ CPPFLAGS = \
 
 common_CFLAGS = -Wall -O0 -g3 \
-Werror=format \
+   -Werror=format-security \
-Werror=incompatible-pointer-types \
-Werror=int-conversion \
$(libpng_CFLAGS) \
@@ -72,6 +73,7 @@ bin_crucible_SOURCES = \
src/framework/test/test_def.c \
src/qonos/qonos.c \
src/qonos/qonos_pipeline.c \
+   src/tests/bug/104809.c \
src/tests/example/basic.c \
src/tests/example/images.c \
src/tests/example/messages.c \
@@ -127,6 +129,7 @@ bin_crucible_SOURCES = \
 BUILT_SOURCES = \
src/qonos/qonos_pipeline-spirv.h \
src/util/simple_pipeline-spirv.h \
+   src/tests/bug/104809-spirv.h \
src/tests/func/4-vertex-buffers-spirv.h \
src/tests/func/depthstencil/basic-spirv.h \
src/tests/func/depthstencil/arrayed-clear-spirv.h \
diff --git a/src/framework/test/t_dump.c b/src/framework/test/t_dump.c
index 04f55c3..edfb3fa 100644
--- a/src/framework/test/t_dump.c
+++ b/src/framework/test/t_dump.c
@@ -71,7 +71,7 @@ t_dump_image_fv(cru_image_t *image, const char *format, 
va_list va)
 return;
 
 string_t filename = STRING_INIT;
-string_appendf(&filename, t_name);
+string_append_cstr(&filename, t_name);
 string_append_char(&filename, '.');
 string_vappendf(&filename, format, va);
 
diff --git a/src/framework/test/t_result.c b/src/framework/test/t_result.c
index 80ab731..209d6b2 100644
--- a/src/framework/test/t_result.c
+++ b/src/framework/test/t_result.c
@@ -78,7 +78,7 @@ __t_skipfv(const char *file, int line, const char *format, 
va_list va)
 string_vappendf(&s, format, va);
 }
 
-logi(string_data(&s));
+logi("%s", string_data(&s));
 string_finish(&s);
 
 __t_skip_silent();
@@ -127,7 +127,7 @@ __t_failfv(const char *file, int line, const char *format, 
va_list va)
 string_vappendf(&s, format, va);
 }
 
-loge(string_data(&s));
+loge("%s", string_data(&s));
 string_finish(&s);
 
 __t_fail_silent();
@@ -179,7 +179,7 @@ __t_assertfv(const char *file, int line, bool cond, const 
char *cond_string,
 string_t s = STRING_INIT;
 string_appendf(&s, "%s:%d: ", file, line);
 string_vappendf(&s, format, va);
-loge(string_data(&s));
+loge("%s", string_data(&s));
 string_finish(&s);
 }
 
diff --git a/src/tests/bug/104809.c b/src/tests/bug/104809.c
new file mode 100644
index 000..162b421
--- /dev/null
+++ b/src/tests/bug/104809.c
@@ -0,0 +1,160 @@
+// Copyright 2015 Intel Corporation
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice (including the next
+// paragraph) shall be included in all copies or substantial portions of the
+// Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+
+#include "tapi/t.h"
+#include "util/misc.h"
+
+/* This is a test for https://bugs.freedesktop.org/show_bug.cgi?id=104809
+ *
+ * At the root of the hang was the fact that we had a hole in our vertex
+ * element state array.  Because the Intel Vulkan driver compacts down the
+ * inputs to only those used by the shader, you need to have a location
+ * which is used by the shader but not provided by the vertex input state
+ * in order to trigger the hang.  This test provides a simple pipeline
+ * which does just that.
+ */
+
+#include "104809-spirv.h"
+
+static void
+test(void)
+{
+VkShaderModule vs = qoCreateShaderModuleGLSL(t_device, VERTEX,
+layout(location = 0) in vec4 a_position;
+layout(location = 1) in vec4 a_junk;
+layout(location = 2) in vec4 a_zero;
+void main()
+{
+  

[Piglit] [PATCH 1/3] Add a default t_render_pass

2018-08-25 Thread Jason Ekstrand
We already had one, it just didn't have any load/store ops and it wasn't
exposed to the t_ API.
---
 include/tapi/t_data.h|  2 ++
 src/framework/test/t_data.c  | 11 
 src/framework/test/t_phase_setup.c   | 18 
 src/framework/test/test.h|  1 +
 src/tests/func/4-vertex-buffers.c| 27 ++
 src/tests/func/bind-points.c | 27 ++
 src/tests/func/cmd-buffer/secondary.c| 27 ++
 src/tests/func/depthstencil/basic.c  | 36 ++--
 src/tests/func/desc/dynamic.c| 31 +++-
 src/tests/func/draw-indexed.c| 29 ++-
 src/tests/func/first.c   | 32 +++--
 src/tests/func/gs/basic.c| 27 ++
 src/tests/func/push-constants/basic.c| 27 ++
 src/tests/func/shader/fragcoord.c| 29 ++-
 src/tests/func/ssbo/interleave.c | 27 ++
 src/tests/stress/lots-of-surface-state.c | 27 ++
 16 files changed, 55 insertions(+), 323 deletions(-)

diff --git a/include/tapi/t_data.h b/include/tapi/t_data.h
index 9610670..ebadae3 100644
--- a/include/tapi/t_data.h
+++ b/include/tapi/t_data.h
@@ -48,6 +48,7 @@ typedef struct cru_image cru_image_t;
 #define t_color_image_view (*__t_color_image_view())
 #define t_depthstencil_image (*__t_depthstencil_image())
 #define t_depthstencil_image_view (*__t_depthstencil_image_view())
+#define t_render_pass (*__t_render_pass())
 #define t_framebuffer (*__t_framebuffer())
 #define t_pipeline_cache (*__t_pipeline_cache())
 #define t_width (*__t_width())
@@ -71,6 +72,7 @@ const VkImage *__t_color_image(void);
 const VkImageView *__t_color_image_view(void);
 const VkImage *__t_depthstencil_image(void);
 const VkImageView *__t_depthstencil_image_view(void);
+const VkRenderPass *__t_render_pass(void);
 const VkFramebuffer *__t_framebuffer(void);
 const VkPipelineCache *__t_pipeline_cache(void);
 const uint32_t *__t_height(void);
diff --git a/src/framework/test/t_data.c b/src/framework/test/t_data.c
index 3a3568c..c9f5a41 100644
--- a/src/framework/test/t_data.c
+++ b/src/framework/test/t_data.c
@@ -148,6 +148,17 @@ __t_depthstencil_image_view(void)
 return &t->vk.depthstencil_image_view;
 }
 
+const VkRenderPass *
+__t_render_pass(void)
+{
+ASSERT_TEST_IN_MAJOR_PHASE;
+GET_CURRENT_TEST(t);
+
+t_assert(!t->def->no_image);
+
+return &t->vk.render_pass;
+}
+
 const VkFramebuffer *
 __t_framebuffer(void)
 {
diff --git a/src/framework/test/t_phase_setup.c 
b/src/framework/test/t_phase_setup.c
index 199fea1..fe271c9 100644
--- a/src/framework/test/t_phase_setup.c
+++ b/src/framework/test/t_phase_setup.c
@@ -137,6 +137,8 @@ t_setup_framebuffer(void)
 {
 QO_ATTACHMENT_DESCRIPTION_DEFAULTS,
 .format = VK_FORMAT_R8G8B8A8_UNORM,
+.loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR,
+.storeOp = VK_ATTACHMENT_STORE_OP_STORE,
 },
 },
 .subpassCount = 1,
@@ -147,13 +149,13 @@ t_setup_framebuffer(void)
 .pColorAttachments = (VkAttachmentReference[]) {
 {
 .attachment = 0,
-.layout = VK_IMAGE_LAYOUT_GENERAL,
+.layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
 },
 },
 }
 });
 
-VkRenderPass pass = color_pass;
+t->vk.render_pass = color_pass;
 
 if (t->def->depthstencil_format != VK_FORMAT_UNDEFINED) {
 VkFormatProperties depth_format_props;
@@ -236,10 +238,14 @@ t_setup_framebuffer(void)
 {
 QO_ATTACHMENT_DESCRIPTION_DEFAULTS,
 .format = VK_FORMAT_R8G8B8A8_UNORM,
+.loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR,
+.storeOp = VK_ATTACHMENT_STORE_OP_STORE,
 },
 {
 QO_ATTACHMENT_DESCRIPTION_DEFAULTS,
 .format = t->def->depthstencil_format,
+.loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR,
+.storeOp = VK_ATTACHMENT_STORE_OP_STORE,
 },
 },
 .subpassCount = 1,
@@ -250,21 +256,21 @@ t_setup_framebuffer(void)
 .pColorAttachments = (VkAttachmentReference[]) {
 {
 .attachment = 0,
-.layout = VK_IMAGE_LAYOUT_GENERAL,
+.layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
 },
 },
 .pDepthStencilAttachment = &(VkAttachmentReference) {
 .attachment = 1,
-.layout = VK_IMAGE_LAYOUT_GENERAL,
+.layout = 
VK_IMAGE_LAYOUT_DEPTH_STENCI

[Piglit] [PATCH 1/3] Add a default t_render_pass

2018-08-25 Thread Jason Ekstrand
We already had one, it just didn't have any load/store ops and it wasn't
exposed to the t_ API.
---
 include/tapi/t_data.h|  2 ++
 src/framework/test/t_data.c  | 11 
 src/framework/test/t_phase_setup.c   | 18 
 src/framework/test/test.h|  1 +
 src/tests/func/4-vertex-buffers.c| 27 ++
 src/tests/func/bind-points.c | 27 ++
 src/tests/func/cmd-buffer/secondary.c| 27 ++
 src/tests/func/depthstencil/basic.c  | 36 ++--
 src/tests/func/desc/dynamic.c| 31 +++-
 src/tests/func/draw-indexed.c| 29 ++-
 src/tests/func/first.c   | 32 +++--
 src/tests/func/gs/basic.c| 27 ++
 src/tests/func/push-constants/basic.c| 27 ++
 src/tests/func/shader/fragcoord.c| 29 ++-
 src/tests/func/ssbo/interleave.c | 27 ++
 src/tests/stress/lots-of-surface-state.c | 27 ++
 16 files changed, 55 insertions(+), 323 deletions(-)

diff --git a/include/tapi/t_data.h b/include/tapi/t_data.h
index 9610670..ebadae3 100644
--- a/include/tapi/t_data.h
+++ b/include/tapi/t_data.h
@@ -48,6 +48,7 @@ typedef struct cru_image cru_image_t;
 #define t_color_image_view (*__t_color_image_view())
 #define t_depthstencil_image (*__t_depthstencil_image())
 #define t_depthstencil_image_view (*__t_depthstencil_image_view())
+#define t_render_pass (*__t_render_pass())
 #define t_framebuffer (*__t_framebuffer())
 #define t_pipeline_cache (*__t_pipeline_cache())
 #define t_width (*__t_width())
@@ -71,6 +72,7 @@ const VkImage *__t_color_image(void);
 const VkImageView *__t_color_image_view(void);
 const VkImage *__t_depthstencil_image(void);
 const VkImageView *__t_depthstencil_image_view(void);
+const VkRenderPass *__t_render_pass(void);
 const VkFramebuffer *__t_framebuffer(void);
 const VkPipelineCache *__t_pipeline_cache(void);
 const uint32_t *__t_height(void);
diff --git a/src/framework/test/t_data.c b/src/framework/test/t_data.c
index 3a3568c..c9f5a41 100644
--- a/src/framework/test/t_data.c
+++ b/src/framework/test/t_data.c
@@ -148,6 +148,17 @@ __t_depthstencil_image_view(void)
 return &t->vk.depthstencil_image_view;
 }
 
+const VkRenderPass *
+__t_render_pass(void)
+{
+ASSERT_TEST_IN_MAJOR_PHASE;
+GET_CURRENT_TEST(t);
+
+t_assert(!t->def->no_image);
+
+return &t->vk.render_pass;
+}
+
 const VkFramebuffer *
 __t_framebuffer(void)
 {
diff --git a/src/framework/test/t_phase_setup.c 
b/src/framework/test/t_phase_setup.c
index 199fea1..fe271c9 100644
--- a/src/framework/test/t_phase_setup.c
+++ b/src/framework/test/t_phase_setup.c
@@ -137,6 +137,8 @@ t_setup_framebuffer(void)
 {
 QO_ATTACHMENT_DESCRIPTION_DEFAULTS,
 .format = VK_FORMAT_R8G8B8A8_UNORM,
+.loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR,
+.storeOp = VK_ATTACHMENT_STORE_OP_STORE,
 },
 },
 .subpassCount = 1,
@@ -147,13 +149,13 @@ t_setup_framebuffer(void)
 .pColorAttachments = (VkAttachmentReference[]) {
 {
 .attachment = 0,
-.layout = VK_IMAGE_LAYOUT_GENERAL,
+.layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
 },
 },
 }
 });
 
-VkRenderPass pass = color_pass;
+t->vk.render_pass = color_pass;
 
 if (t->def->depthstencil_format != VK_FORMAT_UNDEFINED) {
 VkFormatProperties depth_format_props;
@@ -236,10 +238,14 @@ t_setup_framebuffer(void)
 {
 QO_ATTACHMENT_DESCRIPTION_DEFAULTS,
 .format = VK_FORMAT_R8G8B8A8_UNORM,
+.loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR,
+.storeOp = VK_ATTACHMENT_STORE_OP_STORE,
 },
 {
 QO_ATTACHMENT_DESCRIPTION_DEFAULTS,
 .format = t->def->depthstencil_format,
+.loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR,
+.storeOp = VK_ATTACHMENT_STORE_OP_STORE,
 },
 },
 .subpassCount = 1,
@@ -250,21 +256,21 @@ t_setup_framebuffer(void)
 .pColorAttachments = (VkAttachmentReference[]) {
 {
 .attachment = 0,
-.layout = VK_IMAGE_LAYOUT_GENERAL,
+.layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
 },
 },
 .pDepthStencilAttachment = &(VkAttachmentReference) {
 .attachment = 1,
-.layout = VK_IMAGE_LAYOUT_GENERAL,
+.layout = 
VK_IMAGE_LAYOUT_DEPTH_STENCI

[Piglit] [PATCH] tfp: Also test with GL_TEXTURE_RECTANGLE

2018-07-10 Thread Jason Ekstrand
---
 tests/glx/glx-tfp.c | 102 +++-
 1 file changed, 62 insertions(+), 40 deletions(-)

diff --git a/tests/glx/glx-tfp.c b/tests/glx/glx-tfp.c
index 26408741a..46e317adc 100644
--- a/tests/glx/glx-tfp.c
+++ b/tests/glx/glx-tfp.c
@@ -48,9 +48,12 @@ GLfloat tex_data[4][4] = {
 };
 
 #define WIN_WIDTH  256
-#define WIN_HEIGHT 128
+#define WIN_HEIGHT 256
+#define PIXMAP_WIDTH   2
+#define PIXMAP_HEIGHT  2
 
-static GLXPixmap rgb_pixmap, rgba_pixmap;
+static GLXPixmap rgb_2d_pixmap, rgba_2d_pixmap;
+static GLXPixmap rgb_rect_pixmap, rgba_rect_pixmap;
 static Display *dpy;
 static Window win;
 int piglit_width = WIN_WIDTH;
@@ -95,7 +98,7 @@ check_results(GLboolean has_alpha, int x, int y, int w, int h)
 }
 
 static void
-draw_pixmap(GLXPixmap pixmap, int x, int y, int w, int h)
+draw_pixmap(GLXPixmap pixmap, GLenum target, int x, int y, int w, int h)
 {
GLuint texname;
GLfloat tex_coords[] = {
@@ -106,6 +109,13 @@ draw_pixmap(GLXPixmap pixmap, int x, int y, int w, int h)
};
GLfloat vertex_coords[4][2];
 
+   if (target == GL_TEXTURE_RECTANGLE) {
+   for (int i = 0; i < 4; i++) {
+   tex_coords[i * 2 + 0] *= PIXMAP_WIDTH;
+   tex_coords[i * 2 + 1] *= PIXMAP_HEIGHT;
+   }
+   }
+
vertex_coords[0][0] = x;
vertex_coords[0][1] = y;
vertex_coords[1][0] = x + w;
@@ -117,13 +127,13 @@ draw_pixmap(GLXPixmap pixmap, int x, int y, int w, int h)
 
/* Create the texture. */
glGenTextures(1, &texname);
-   glBindTexture(GL_TEXTURE_2D, texname);
-   glEnable(GL_TEXTURE_2D);
+   glBindTexture(target, texname);
+   glEnable(target);
 
-   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
-   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
-   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
+   glTexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+   glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+   glTexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP);
+   glTexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP);
 
/* Set the texture combiner to give {r*a, g*a, b*a, a} so we can see
 * the effect of the alpha channel in terms of color.
@@ -154,29 +164,35 @@ draw_pixmap(GLXPixmap pixmap, int x, int y, int w, int h)
glDeleteTextures(1, &texname);
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
-   glDisable(GL_TEXTURE_2D);
+   glDisable(target);
 }
 
 static enum piglit_result
 draw(Display *dpy)
 {
GLboolean pass = GL_TRUE;
-   int draw_w = piglit_width / 4;
-   int draw_h = piglit_height / 2;
-   int rgb_x = piglit_width / 8;
-   int rgb_y = piglit_height / 4;
-   int rgba_x = piglit_width * 5 / 8;
-   int rgba_y = piglit_height / 4;
+   int unit_x = piglit_width / 8;
+   int unit_y = piglit_width / 8;
+   int draw_w = 2 * unit_x;
+   int draw_h = 2 * unit_y;
 
/* Clear background to gray */
glClearColor(0.5, 0.5, 0.5, 1.0);
glClear(GL_COLOR_BUFFER_BIT);
 
-   draw_pixmap(rgb_pixmap, rgb_x, rgb_y, draw_w, draw_h);
-   draw_pixmap(rgba_pixmap, rgba_x, rgba_y, draw_w, draw_h);
+   draw_pixmap(rgb_2d_pixmap, GL_TEXTURE_2D,
+   unit_x, unit_y, draw_w, draw_h);
+   draw_pixmap(rgba_2d_pixmap, GL_TEXTURE_2D,
+   5 * unit_x, unit_y, draw_w, draw_h);
+   draw_pixmap(rgb_rect_pixmap, GL_TEXTURE_RECTANGLE,
+   unit_x, 5 * unit_y, draw_w, draw_h);
+   draw_pixmap(rgba_rect_pixmap, GL_TEXTURE_RECTANGLE,
+   5 * unit_x, 5 * unit_y, draw_w, draw_h);
 
-   pass &= check_results(GL_FALSE, rgb_x, rgb_y, draw_w, draw_h);
-   pass &= check_results(GL_TRUE, rgba_x, rgba_y, draw_w, draw_h);
+   pass &= check_results(GL_FALSE, unit_x, unit_y, draw_w, draw_h);
+   pass &= check_results(GL_TRUE, 5 * unit_x, unit_y, draw_w, draw_h);
+   pass &= check_results(GL_FALSE, unit_x, 5 * unit_y, draw_w, draw_h);
+   pass &= check_results(GL_TRUE, 5 * unit_x, 5 * unit_y, draw_w, draw_h);
 
glXSwapBuffers(dpy, win);
 
@@ -201,7 +217,7 @@ set_pixel(Display *dpy, Picture picture, int x, int y, 
GLfloat *color)
  * Creates a Pixmap and GLXPixmap with tex_data as the contents.
  */
 static GLXPixmap
-create_pixmap(GLenum format)
+create_pixmap(GLenum format, GLenum target)
 {
static const int rgb_fb_config_attribs[] = {
GLX_RENDER_TYPE, GLX_RGBA_BIT,
@@ -223,17 +239,7 @@ create_pixmap(GLenum format)
GLX_BIND_TO_TEXTURE_RGBA_EXT, 1,
None
};
-   static const int rgb_pixmap_attribs[] = {
-   GLX_TEXTURE_TARGET_EXT, GLX_TEXTURE_2D_EXT,
-   GL

Re: [Piglit] [PATCH] arb_provoking_vertex: Test flat shading with clipped geometry

2018-06-13 Thread Jason Ekstrand
Thanks for writing a test!

On Wed, Jun 13, 2018 at 3:54 AM,  wrote:

> From: Danylo Piliaiev 
>
> Clipper can mess up provoking vertex.
> Ref: https://bugs.freedesktop.org/show_bug.cgi?id=103047
>
> Signed-off-by: Danylo Piliaiev 
> ---
>  tests/opengl.py|  1 +
>  tests/spec/arb_provoking_vertex/CMakeLists.gl.txt  |  1 +
>  .../clipped-geometry-flatshading.c | 78
> ++
>  3 files changed, 80 insertions(+)
>  create mode 100644 tests/spec/arb_provoking_vertex/clipped-geometry-
> flatshading.c
>
> diff --git a/tests/opengl.py b/tests/opengl.py
> index 3109a5e..313b22b 100644
> --- a/tests/opengl.py
> +++ b/tests/opengl.py
> @@ -2205,6 +2205,7 @@ with profile.test_list.group_manager(
>  g(['arb-provoking-vertex-control'], run_concurrent=False)
>  g(['arb-provoking-vertex-initial'], run_concurrent=False)
>  g(['arb-provoking-vertex-render'], run_concurrent=False)
> +g(['arb-provoking-vertex-clipped-geometry-flatshading'],
> run_concurrent=False)
>  g(['arb-quads-follow-provoking-vertex'], run_concurrent=False)
>  g(['arb-xfb-before-flatshading'], run_concurrent=False)
>
> diff --git a/tests/spec/arb_provoking_vertex/CMakeLists.gl.txt
> b/tests/spec/arb_provoking_vertex/CMakeLists.gl.txt
> index 6dd15bb..3acffc6 100644
> --- a/tests/spec/arb_provoking_vertex/CMakeLists.gl.txt
> +++ b/tests/spec/arb_provoking_vertex/CMakeLists.gl.txt
> @@ -11,6 +11,7 @@ link_libraries (
>  piglit_add_executable (arb-provoking-vertex-control
> provoking-vertex-control.c)
>  piglit_add_executable (arb-provoking-vertex-initial
> provoking-vertex-initial.c)
>  piglit_add_executable (arb-provoking-vertex-render render.c)
> +piglit_add_executable (arb-provoking-vertex-clipped-geometry-flatshading
> clipped-geometry-flatshading.c)
>  piglit_add_executable (arb-quads-follow-provoking-vertex
> quads-follow-provoking-vertex.c)
>  piglit_add_executable (arb-xfb-before-flatshading
> xfb-before-flatshading.c)
>
> diff --git a/tests/spec/arb_provoking_vertex/clipped-geometry-flatshading.c
> b/tests/spec/arb_provoking_vertex/clipped-geometry-flatshading.c
> new file mode 100644
> index 000..97af48b
> --- /dev/null
> +++ b/tests/spec/arb_provoking_vertex/clipped-geometry-flatshading.c
> @@ -0,0 +1,78 @@
> +/*
> + * Copyright © 2018 Danylo Piliaiev
> + *
> + * 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.
> + */
> +
> +/**
> + * Test that provoking vertex works as expected when part of the geometry
> + * is clipped when flat shading is enabled.
> + *
> + * https://bugs.freedesktop.org/show_bug.cgi?id=103047
> + */
> +
> +#include "piglit-util-gl.h"
> +
> +PIGLIT_GL_TEST_CONFIG_BEGIN
> +   config.supports_gl_compat_version = 10;
> +   config.khr_no_error_support = PIGLIT_NO_ERRORS;
> +PIGLIT_GL_TEST_CONFIG_END
> +
> +void
> +piglit_init(int argc, char **argv)
> +{
> +   piglit_require_extension("GL_EXT_provoking_vertex");
> +   piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
> +
> +   glShadeModel(GL_FLAT);
> +}
> +
> +enum piglit_result
> +piglit_display(void)
> +{
> +   static const float red[3] = {1, 0, 0};
> +   static const float green[3] = {0, 1, 0};
> +
> +   bool pass = true;
> +
> +   glClear(GL_COLOR_BUFFER_BIT);
> +   glProvokingVertexEXT(GL_LAST_VERTEX_CONVENTION_EXT);
> +
> +   const int y1 = piglit_height / 3;
> +
> +   glBegin(GL_TRIANGLE_STRIP);
> +   glColor3fv(green);
> +   glVertex3i(piglit_width + 1, y1, 0);
> +   glColor3fv(green);
> +   glVertex3i(piglit_width + 2, y1, 0);
> +   glColor3fv(green);
> +   glVertex3i(piglit_width + 3, y1, 0);
> +   glColor3fv(green);
> +   glVertex3i(piglit_width / 2, y1 * 2, 0);
>

When I was experimenting with this yesterday, I fo

[Piglit] [PATCH] framework: Add a PIGLIT_TEST_TIMEOUT environment variable

2018-06-08 Thread Jason Ekstrand
This commit adds a new PIGLIT_TESTS_TIMEOUT environment variable which
overrides the pre-test timeout specified by the test runner.
---

This is almost certainly not the right solution but it gets the discussion
started.  A couple of known issues:

 - No documentation
 - It overrides.  Maybe it should be a max timeout?
 - Maybe we want a flag instead of an environment variable?
 - Maybe Jason has no clue what he's doing inside the piglit framework and
   someone else should write the patch?

Comments welcome!

--Jason


 framework/test/base.py | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/framework/test/base.py b/framework/test/base.py
index f187c0210..43bbacd51 100644
--- a/framework/test/base.py
+++ b/framework/test/base.py
@@ -118,6 +118,8 @@ __all__ = [
 # PIGLIT_NO_TIMEOUT to anything that bool() will resolve as True
 _SUPPRESS_TIMEOUT = bool(os.environ.get('PIGLIT_NO_TIMEOUT', False))
 
+# Default timeout
+_USER_TEST_TIMEOUT = int(os.environ.get('PIGLIT_TEST_TIMEOUT', 0))
 
 class TestIsSkip(exceptions.PiglitException):
 """Exception raised in is_skip() if the test is a skip."""
@@ -343,7 +345,11 @@ class Test(object):
 
 self.result.pid.append(proc.pid)
 if not _SUPPRESS_TIMEOUT:
-out, err = proc.communicate(timeout=self.timeout)
+if _USER_TEST_TIMEOUT:
+timeout = _USER_TEST_TIMEOUT
+else:
+timeout = self.timeout
+out, err = proc.communicate(timeout=timeout)
 else:
 out, err = proc.communicate()
 returncode = proc.returncode
-- 
2.17.1

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


[Piglit] [PATCH 4/5] util/gl: Add a helper for probing a rect of varying data

2018-06-07 Thread Jason Ekstrand
All the other helpers can only assert that a given rectangle is the
given solid color; this one takes an array of pixel data.
---
 tests/util/piglit-util-gl.c | 8 
 tests/util/piglit-util-gl.h | 2 ++
 2 files changed, 10 insertions(+)

diff --git a/tests/util/piglit-util-gl.c b/tests/util/piglit-util-gl.c
index a19eef5f0..06715ed6b 100644
--- a/tests/util/piglit-util-gl.c
+++ b/tests/util/piglit-util-gl.c
@@ -1467,6 +1467,14 @@ piglit_probe_rect_rgba(int x, int y, int w, int h, const 
float *expected)
return probe_rect(x, y, w, h, 4, expected, 0, 0, false);
 }
 
+int piglit_probe_rect_rgba_varying(int x, int y, int w, int h,
+  const float* expected, size_t stride)
+{
+   assert(stride % sizeof(float) == 0);
+   return probe_rect(x, y, w, h, 4, expected,
+ 4, stride / sizeof(float), false);
+}
+
 int
 piglit_probe_rect_rgba_int(int x, int y, int w, int h, const int *expected)
 {
diff --git a/tests/util/piglit-util-gl.h b/tests/util/piglit-util-gl.h
index 7b1cee564..ccad1adab 100644
--- a/tests/util/piglit-util-gl.h
+++ b/tests/util/piglit-util-gl.h
@@ -150,6 +150,8 @@ int piglit_probe_rect_r_ubyte(int x, int y, int w, int h, 
GLubyte expected);
 int piglit_probe_rect_rgb(int x, int y, int w, int h, const float* expected);
 int piglit_probe_rect_rgb_silent(int x, int y, int w, int h, const float 
*expected);
 int piglit_probe_rect_rgba(int x, int y, int w, int h, const float* expected);
+int piglit_probe_rect_rgba_varying(int x, int y, int w, int h,
+  const float* expected, size_t stride);
 int piglit_probe_rect_rgba_int(int x, int y, int w, int h, const int* 
expected);
 int piglit_probe_rect_rgba_uint(int x, int y, int w, int h, const unsigned 
int* expected);
 bool piglit_probe_rect_two_rgb(int x, int y, int w, int h,
-- 
2.17.1

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


[Piglit] [PATCH 3/5] util/gl: Use probe_rect instead of hand-rolling

2018-06-07 Thread Jason Ekstrand
---
 tests/util/piglit-util-gl.c | 83 ++---
 1 file changed, 3 insertions(+), 80 deletions(-)

diff --git a/tests/util/piglit-util-gl.c b/tests/util/piglit-util-gl.c
index 54fb3d0c4..a19eef5f0 100644
--- a/tests/util/piglit-util-gl.c
+++ b/tests/util/piglit-util-gl.c
@@ -1346,30 +1346,7 @@ probe_rect(int x, int y, int w, int h, int 
num_components,
 int
 piglit_probe_rect_rgb_silent(int x, int y, int w, int h, const float *expected)
 {
-   int i, j;
-   GLfloat *probe;
-   GLfloat *pixels;
-
-   if (can_probe_ubyte())
-   return probe_rect_ubyte(x, y, w, h, 3, expected, 0, 0, true);
-
-   pixels = read_pixels_float(x, y, w, h, GL_RGB, NULL);
-
-   for (j = 0; j < h; j++) {
-   for (i = 0; i < w; i++) {
-   probe = &pixels[(j*w+i)*3];
-
-   if (compare_pixels_float(probe, expected,
-piglit_tolerance, 3))
-   continue;
-
-   free(pixels);
-   return 0;
-   }
-   }
-
-   free(pixels);
-   return 1;
+   return probe_rect(x, y, w, h, 3, expected, 0, 0, true);
 }
 
 /* More efficient variant if you don't know need floats and GBA channels. */
@@ -1406,34 +1383,7 @@ piglit_probe_rect_r_ubyte(int x, int y, int w, int h, 
GLubyte expected)
 int
 piglit_probe_rect_rgb(int x, int y, int w, int h, const float *expected)
 {
-   int i, j;
-   GLfloat *probe;
-   GLfloat *pixels;
-
-   if (can_probe_ubyte())
-   return probe_rect_ubyte(x, y, w, h, 3, expected, 0, 0, false);
-
-   pixels = read_pixels_float(x, y, w, h, GL_RGBA, NULL);
-
-   for (j = 0; j < h; j++) {
-   for (i = 0; i < w; i++) {
-   probe = &pixels[(j*w+i)*4];
-
-   if (compare_pixels_float(probe, expected,
-piglit_tolerance, 3))
-   continue;
-
-   print_bad_pixel_float(x + i, y + j, 3,
- expected,
- probe);
-
-   free(pixels);
-   return 0;
-   }
-   }
-
-   free(pixels);
-   return 1;
+   return probe_rect(x, y, w, h, 3, expected, 0, 0, false);
 }
 
 int
@@ -1514,34 +1464,7 @@ piglit_probe_rect_halves_equal_rgba(int x, int y, int w, 
int h)
 int
 piglit_probe_rect_rgba(int x, int y, int w, int h, const float *expected)
 {
-   int i, j;
-   GLfloat *probe;
-   GLfloat *pixels;
-
-   if (can_probe_ubyte())
-   return probe_rect_ubyte(x, y, w, h, 4, expected, 0, 0, false);
-
-   pixels = read_pixels_float(x, y, w, h, GL_RGBA, NULL);
-
-   for (j = 0; j < h; j++) {
-   for (i = 0; i < w; i++) {
-   probe = &pixels[(j*w+i)*4];
-
-   if (compare_pixels_float(probe, expected,
-piglit_tolerance, 4))
-   continue;
-
-   print_bad_pixel_float(x + i, y + j, 4,
- expected,
- probe);
-
-   free(pixels);
-   return 0;
-   }
-   }
-
-   free(pixels);
-   return 1;
+   return probe_rect(x, y, w, h, 4, expected, 0, 0, false);
 }
 
 int
-- 
2.17.1

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


[Piglit] [PATCH 5/5] textureGather: Use piglit_probe_rect_rgba_varying

2018-06-07 Thread Jason Ekstrand
Instead of doing 900 piglit_proble_pixel_rgba calls (one for each pixel)
which each call glReadPixels, use the new helper which only invokes
glReadPixels once.
---
 tests/texturing/shaders/textureGather.c | 11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/tests/texturing/shaders/textureGather.c 
b/tests/texturing/shaders/textureGather.c
index bd369d129..fd3d101c8 100644
--- a/tests/texturing/shaders/textureGather.c
+++ b/tests/texturing/shaders/textureGather.c
@@ -52,7 +52,6 @@ float *expected;
 enum piglit_result
 piglit_display(void)
 {
-   int i, j;
bool pass = true;
 
glViewport(0, 0, texture_width, texture_height);
@@ -73,11 +72,11 @@ piglit_display(void)
else
glDrawArrays(GL_POINTS, 0, texture_width * texture_height);
 
-   for (j = 1; j < texture_height - 1; j++)
-   for (i = 1; i < texture_width - 1; i++) {
-   float *pe = &expected[4 * (j * texture_width + i)];
-   pass = piglit_probe_pixel_rgba(i, j, pe) && pass;
-   }
+   pass = piglit_probe_rect_rgba_varying(1, 1,
+ texture_width - 2,
+ texture_height - 2,
+ expected + (texture_width + 1) * 
4,
+ texture_width * 4 * 
sizeof(float));
 
piglit_present_results();
 
-- 
2.17.1

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


[Piglit] [PATCH 1/5] util: Refactor probe_rect_ubyte to allow varying data

2018-06-07 Thread Jason Ekstrand
---
 tests/util/piglit-util-gl.c | 19 ++-
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/tests/util/piglit-util-gl.c b/tests/util/piglit-util-gl.c
index 11e7d4b1d..39b6e58e9 100644
--- a/tests/util/piglit-util-gl.c
+++ b/tests/util/piglit-util-gl.c
@@ -1249,7 +1249,8 @@ array_float_to_ubyte_roundup(int n, const float *f, 
GLubyte *b)
 
 static bool
 probe_rect_ubyte(int x, int y, int w, int h, int num_components,
-   const float *fexpected, bool silent)
+const float *fexpected, size_t x_pitch, size_t y_pitch,
+bool silent)
 {
int i, j;
GLubyte *probe;
@@ -1259,7 +1260,8 @@ probe_rect_ubyte(int x, int y, int w, int h, int 
num_components,
 
array_float_to_ubyte_roundup(num_components, piglit_tolerance,
 tolerance);
-   array_float_to_ubyte(num_components, fexpected, expected);
+   if (x_pitch == 0 && y_pitch == 0)
+   array_float_to_ubyte(num_components, fexpected, expected);
 
/* RGBA readbacks are likely to be faster */
pixels = malloc(w*h*4);
@@ -1269,6 +1271,13 @@ probe_rect_ubyte(int x, int y, int w, int h, int 
num_components,
for (i = 0; i < w; i++) {
probe = &pixels[(j*w+i)*4];
 
+   if (x_pitch != 0 || y_pitch != 0) {
+   const float *pexp = fexpected + i * x_pitch +
+   j * y_pitch;
+   array_float_to_ubyte(num_components,
+pexp, expected);
+   }
+
if (compare_pixels_ubyte(probe, expected, tolerance,
 num_components))
continue;
@@ -1295,7 +1304,7 @@ piglit_probe_rect_rgb_silent(int x, int y, int w, int h, 
const float *expected)
GLfloat *pixels;
 
if (can_probe_ubyte())
-   return probe_rect_ubyte(x, y, w, h, 3, expected, true);
+   return probe_rect_ubyte(x, y, w, h, 3, expected, 0, 0, true);
 
pixels = read_pixels_float(x, y, w, h, GL_RGB, NULL);
 
@@ -1355,7 +1364,7 @@ piglit_probe_rect_rgb(int x, int y, int w, int h, const 
float *expected)
GLfloat *pixels;
 
if (can_probe_ubyte())
-   return probe_rect_ubyte(x, y, w, h, 3, expected, false);
+   return probe_rect_ubyte(x, y, w, h, 3, expected, 0, 0, false);
 
pixels = read_pixels_float(x, y, w, h, GL_RGBA, NULL);
 
@@ -1463,7 +1472,7 @@ piglit_probe_rect_rgba(int x, int y, int w, int h, const 
float *expected)
GLfloat *pixels;
 
if (can_probe_ubyte())
-   return probe_rect_ubyte(x, y, w, h, 4, expected, false);
+   return probe_rect_ubyte(x, y, w, h, 4, expected, 0, 0, false);
 
pixels = read_pixels_float(x, y, w, h, GL_RGBA, NULL);
 
-- 
2.17.1

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


[Piglit] [PATCH 2/5] util/gl: Add more probe helplers

2018-06-07 Thread Jason Ekstrand
---
 tests/util/piglit-util-gl.c | 47 +
 1 file changed, 47 insertions(+)

diff --git a/tests/util/piglit-util-gl.c b/tests/util/piglit-util-gl.c
index 39b6e58e9..54fb3d0c4 100644
--- a/tests/util/piglit-util-gl.c
+++ b/tests/util/piglit-util-gl.c
@@ -1296,6 +1296,53 @@ probe_rect_ubyte(int x, int y, int w, int h, int 
num_components,
return true;
 }
 
+static bool
+probe_rect_float(int x, int y, int w, int h, int num_components,
+const float *fexpected, size_t x_pitch, size_t y_pitch,
+bool silent)
+{
+   float *pixels = read_pixels_float(x, y, w, h, GL_RGBA, NULL);
+
+   for (int j = 0; j < h; j++) {
+   for (int i = 0; i < w; i++) {
+   float *probe = &pixels[(j*w+i)*4];
+   const float *pexp = fexpected + i * x_pitch +
+   j * y_pitch;
+
+   if (compare_pixels_float(probe, pexp,
+piglit_tolerance,
+num_components))
+   continue;
+
+   if (!silent) {
+   print_bad_pixel_float(x + i, y + j,
+ num_components,
+ fexpected, probe);
+   }
+   free(pixels);
+   return false;
+   }
+   }
+
+   free(pixels);
+   return true;
+}
+
+static bool
+probe_rect(int x, int y, int w, int h, int num_components,
+  const float *fexpected, size_t x_pitch, size_t y_pitch,
+  bool silent)
+{
+   if (can_probe_ubyte()) {
+   return probe_rect_ubyte(x, y, w, h, num_components, fexpected,
+   x_pitch, y_pitch, silent);
+   } else {
+   return probe_rect_float(x, y, w, h, num_components, fexpected,
+   x_pitch, y_pitch, silent);
+   }
+}
+
+
 int
 piglit_probe_rect_rgb_silent(int x, int y, int w, int h, const float *expected)
 {
-- 
2.17.1

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


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

2018-06-07 Thread Jason Ekstrand
Reviewed-by: Jason Ekstrand 

Thanks for writing this!

On Thu, Jun 7, 2018 at 11:58 AM, Lionel Landwerlin <
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.
>
> 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,
> + 

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

2018-06-07 Thread Jason Ekstrand
On Thu, Jun 7, 2018 at 7:16 AM, Lionel Landwerlin <
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 
> 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, ra

[Piglit] [PATCH 7/8] README: Rework lists of test scripts

2018-06-07 Thread Jason Ekstrand
The extra indentation does not make markdown happy.  Instead, use a
proper list and make the test script names bold.
---
 README.md | 111 ++
 1 file changed, 37 insertions(+), 74 deletions(-)

diff --git a/README.md b/README.md
index b60770338..dac9ba26b 100644
--- a/README.md
+++ b/README.md
@@ -314,89 +314,52 @@ The following test sets are currently available:
 
 ### 4.1 OpenGL Tests
 
-sanity.py
-This suite contains minimal OpenGL sanity tests. These tests must
-pass, otherwise the other tests will not generate reliable results.
-
-all.py
-This suite contains all OpenGL tests.
-
-quick.py
-Run all tests, but cut down significantly on their runtime
+  - **sanity.py** This suite contains minimal OpenGL sanity tests. These tests
+must pass, otherwise the other tests will not generate reliable results.
+  - **all.py** This suite contains all OpenGL tests.
+  - **quick.py** Run all tests, but cut down significantly on their runtime
 (and thus on the number of problems they can find).
-
-gpu.py
-   A further reduced set of tests from quick.py, this runs tests only
-   for hardware functionality and not tests for the software stack.
-
-llvmpipe.py
-   A reduced set of tests from gpu.py removing tests that are problematic
-   using llvmpipe
-
-cpu.py
-   This profile runs tests that don't touch the gpu, in other words all of
-   the tests in quick.py that are not run by gpu.py
-
-glslparser.py
-   A subset of all.py which runs only glslparser tests
-
-shader.py
-   A subset of all.py which runs only shader tests
-
-no_error.py
-   A modified version of the test list run as khr_no_error variants
+  - **gpu.py** A further reduced set of tests from quick.py, this runs tests
+only for hardware functionality and not tests for the software stack.
+  - **llvmpipe.py** A reduced set of tests from gpu.py removing tests that are
+problematic using llvmpipe
+  - **cpu.py** This profile runs tests that don't touch the gpu, in other words
+all of the tests in quick.py that are not run by gpu.py
+  - **glslparser.py** A subset of all.py which runs only glslparser tests
+  - **shader.py** A subset of all.py which runs only shader tests
+  - **no_error.py** A modified version of the test list run as khr_no_error
+variants
 
 
 ### 4.2 OpenCL Tests
 
-cl.py
-This suite contains all OpenCL tests.
-
-quick_cl.py
-   This runs all of the tests from cl.py as well as tests from opencv
-   and oclconform.
+  - **cl.py** This suite contains all OpenCL tests.
+  - **quick_cl.py** This runs all of the tests from cl.py as well as tests from
+opencv and oclconform.
 
 
 ### 4.3 External Integration
 
-xts.py
-   Support for running the X Test Suite using piglit.
-
-igt.py
-   Support for running Intel-gpu-tools test suite using piglit.
-
-deqp_egl.py
-   Support for running dEQP's EGL profile with piglit.
-
-deqp_gles2.py
-   Support for running dEQP's gles2 profile with piglit.
-
-deqp_gles3.py
-   Support for running dEQP's gles3 profile with piglit.
-
-deqp_gles31.py
-   Support for running dEQP's gles3.1 profile with piglit.
-
-deqp_vk.py
-   Support for running the official Khronos Vulkan CTS profile with piglit.
-
-khr_gl.py
-   Support for running the open source Khronos OpenGL CTS tests with 
piglit.
-
-khr_gl45.py
-   Support for running the open source Khronos OpenGL 4.5 CTS tests with 
piglit.
-
-cts_gl.py
-   Support for running the closed source Khronos OpenGL CTS tests with 
piglit.
-
-cts_gl45.py
-   Support for running the closed source Khronos OpenGL 4.5 CTS tests with 
piglit.
-
-cts_gles.py
-   Support for running the closed source Khronos GLES CTS tests with 
piglit.
-
-oglconform.py
-   Support for running sub-test of the Intel oglconform test suite with 
piglit.
+  - **xts.py** Support for running the X Test Suite using piglit.
+  - **igt.py** Support for running Intel-gpu-tools test suite using piglit.
+  - **deqp_egl.py** Support for running dEQP's EGL profile with piglit.
+  - **deqp_gles2.py** Support for running dEQP's gles2 profile with piglit.
+  - **deqp_gles3.py** Support for running dEQP's gles3 profile with piglit.
+  - **deqp_gles31.py** Support for running dEQP's gles3.1 profile with piglit.
+  - **deqp_vk.py** Support for running the official Khronos Vulkan CTS profile
+with piglit.
+  - **khr_gl.py** Support for running the open source Khronos OpenGL CTS tests
+with piglit.
+  - **khr_gl45.py** Support for running the open source Khronos OpenGL 4.5 CTS
+tests with piglit.
+  - **cts_gl.py** Support for running the closed source Khronos OpenGL CTS
+tests with piglit.
+  - **cts_gl45.py** Support for running the closed source Khronos OpenGL 4.5
+CTS tests with piglit.
+  - **cts_gles.py** Support for running the closed source Khronos GLES CTS
+tests with piglit.
+  - **oglconform.py** Sup

[Piglit] [PATCH 4/8] README: Remove some unneeded indentation

2018-06-07 Thread Jason Ekstrand
Extra indentation results in code blocks
---
 README.md | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index eee613095..f363211e2 100644
--- a/README.md
+++ b/README.md
@@ -225,12 +225,12 @@ To create some nice formatted test summaries, run
 $ ./piglit summary html summary/sanity results/sanity
 
 Hint: You can combine multiple test results into a single summary.
-  During development, you can use this to watch for regressions:
+During development, you can use this to watch for regressions:
 
 $ ./piglit summary html summary/compare results/baseline results/current
 
-  You can combine as many testruns as you want this way (in theory;
-  the HTML layout becomes awkward when the number of testruns increases)
+You can combine as many testruns as you want this way (in theory;
+the HTML layout becomes awkward when the number of testruns increases)
 
 Have a look at the results with a browser:
 
-- 
2.17.1

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


[Piglit] [PATCH 6/8] README: Rework the list of test statuses

2018-06-07 Thread Jason Ekstrand
---
 README.md | 19 +++
 1 file changed, 7 insertions(+), 12 deletions(-)

diff --git a/README.md b/README.md
index 9aebbb47d..b60770338 100644
--- a/README.md
+++ b/README.md
@@ -237,19 +237,14 @@ Have a look at the results with a browser:
 
 The summary shows the 'status' of a test:
 
- pass   This test has completed successfully.
+  - **pass:**   This test has completed successfully.
+  - **warn:**   The test completed successfully, but something unexpected 
happened.
+Look at the details for more information.
+  - **fail:**   The test failed.
+  - **crash:**  The test binary exited with a non-zero exit code.
+  - **skip:**   The test was skipped.
+  - **timeout:**  The test ran longer than its allotted time and was forcibly 
killed.
 
- warn   The test completed successfully, but something unexpected happened.
-Look at the details for more information.
-
- fail   The test failed.
-
- crash  The test binary exited with a non-zero exit code.
-
- skip   The test was skipped.
-
- timeout  The test ran longer than its allotted time and was forcibly killed.
- 
 
 There are also dmesg-* statuses. These have the same meaning as above, but are
 triggered by dmesg related messages.
-- 
2.17.1

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


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

2018-06-07 Thread Jason Ekstrand
---
 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
-- 
2.17.1

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


[Piglit] [PATCH 5/8] README: Rework environment variables docs

2018-06-07 Thread Jason Ekstrand
---
 README.md | 56 +--
 1 file changed, 30 insertions(+), 26 deletions(-)

diff --git a/README.md b/README.md
index f363211e2..9aebbb47d 100644
--- a/README.md
+++ b/README.md
@@ -79,8 +79,7 @@ Now configure the build system:
 This will start cmake's configuration tool, just follow the onscreen
 instructions. The default settings should be fine, but I recommend you:
  - Press 'c' once (this will also check for dependencies) and then
- - Set `CMAKE_BUILD_TYPE` to `Debug`
-Now you can press 'c' again and then 'g' to generate the build system.
+ - Set `CMAKE_BUILD_TYPE` to `Debug` Now you can press 'c' again and then 'g' 
to generate the build system.
 Now build everything:
 
 $ make
@@ -261,30 +260,35 @@ triggered by dmesg related messages.
 There are a number of environment variables that control the way piglit
 behaves.
 
- PIGLIT_COMPRESSION
-  Overrides the compression method used. The same values that piglit.conf
-  allows for core:compression.
-
- PIGLIT_PLATFORM
-  Overrides the platform run on. These allow the same values as ``piglit
-  run -p``. This values is honored by the tests themselves, and can be used
-  when running a single test.
-
- PIGLIT_FORCE_GLSLPARSER_DESKTOP
-  Force glslparser tests to be run with the desktop (non-gles) version of
-  glslparsertest. This can be used to test ES_COMPATABILITY extensions
-  for OpenGL
-
- PIGLIT_NO_FAST_SKIP
-   Piglit has a mechanism run in the python layer for skipping tests with
-   unmet OpenGL or window system dependencies without starting a new
-   process (which is expensive). Sometimes this system doesn't work or is
-   undesirable, setting this environment variable to True will disable this
-   system.
-
- PIGLIT_NO_TIMEOUT
-   When this variable is true in python then any timeouts given by tests
-   will be ignored, and they will run until completion or they are killed.
+  - `PIGLIT_COMPRESSION`
+
+Overrides the compression method used. The same values that piglit.conf
+allows for core:compression.
+
+  - `PIGLIT_PLATFORM`
+
+Overrides the platform run on. These allow the same values as `piglit run 
-p`.
+This values is honored by the tests themselves, and can be used when 
running
+a single test.
+
+  - `PIGLIT_FORCE_GLSLPARSER_DESKTOP`
+
+Force glslparser tests to be run with the desktop (non-gles) version of
+glslparsertest. This can be used to test ESX_compatability extensions
+for OpenGL
+
+  - `PIGLIT_NO_FAST_SKIP`
+
+Piglit has a mechanism run in the python layer for skipping tests with
+unmet OpenGL or window system dependencies without starting a new
+process (which is expensive). Sometimes this system doesn't work or is
+undesirable, setting this environment variable to True will disable this
+system.
+
+  - `PIGLIT_NO_TIMEOUT`
+
+When this variable is true in python then any timeouts given by tests
+will be ignored, and they will run until completion or they are killed.
 
 
 ### 3.2 Note
-- 
2.17.1

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


[Piglit] [PATCH 3/8] README: Use proper markdown code quoting

2018-06-07 Thread Jason Ekstrand
---
 README.md | 107 +-
 1 file changed, 58 insertions(+), 49 deletions(-)

diff --git a/README.md b/README.md
index 9f50d2ec9..eee613095 100644
--- a/README.md
+++ b/README.md
@@ -74,34 +74,36 @@ For testing the python framework using "py.test 
unittests/framework"
 
 Now configure the build system:
 
-  $ ccmake .
+$ ccmake .
 
 This will start cmake's configuration tool, just follow the onscreen
 instructions. The default settings should be fine, but I recommend you:
  - Press 'c' once (this will also check for dependencies) and then
- - Set "CMAKE_BUILD_TYPE" to "Debug"
+ - Set `CMAKE_BUILD_TYPE` to `Debug`
 Now you can press 'c' again and then 'g' to generate the build system.
 Now build everything:
 
-  $ make
+$ make
 
 
 ### 2.1 Cross Compiling
 
 On Linux, if cross-compiling a 32-bit build on a 64-bit host, first make sure
 you didn't have CMakeCache.txt file left from 64-bit build (it would retain old
-flags), then you must invoke cmake with options "-DCMAKE_SYSTEM_PROCESSOR=x86
--DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32".
+flags), then you must invoke cmake with options
+`-DCMAKE_SYSTEM_PROCESSOR=x86 -DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32`.
 
 
 ### 2.2 Ubuntu
 
 Install development packages.
-  $ sudo apt-get install cmake g++ mesa-common-dev libgl1-mesa-dev 
python-numpy python-mako freeglut3-dev x11proto-gl-dev libxrender-dev 
libwaffle-dev
+
+$ sudo apt-get install cmake g++ mesa-common-dev libgl1-mesa-dev 
python-numpy python-mako freeglut3-dev x11proto-gl-dev libxrender-dev 
libwaffle-dev
 
 Configure and build.
-  $ cmake .
-  $ make
+
+$ cmake .
+$ make
 
 
 ### 2.3 Mac OS X
@@ -114,8 +116,9 @@ Install Xcode.
 http://developer.apple.com/xcode
 
 Configure and build.
-  $ cmake .
-  $ make
+
+$ cmake .
+$ make
 
 
 ### 2.4 Cygwin
@@ -131,8 +134,9 @@ Install development packages.
   - libglut-devel
 
 Configure and build.
-  $ cmake .
-  $ make
+
+$ cmake .
+$ make
 
 
 ### 2.5 Windows
@@ -152,13 +156,15 @@ https://mingw-w64.org/
 
 Download OpenGL Core API and Extension Header Files.
 http://www.opengl.org/registry/#headers
-Pass -DGLEXT_INCLUDE_DIR=/path/to/headers
+Pass `-DGLEXT_INCLUDE_DIR=/path/to/headers`
 
 Install python mako.
-> pip install mako
+
+pip install mako
 
 Install NumPy.
-> pip install numpy
+
+pip install numpy
 
 
  2.5.1 GLUT
@@ -166,8 +172,8 @@ Install NumPy.
 Download freeglut for Mingw.
 http://www.transmissionzero.co.uk/software/freeglut-devel/
 
-> cmake -H. -Bbuild -G "Ninja" -DGLEXT_INCLUDE_DIR=\path\to\glext 
-DGLUT_INCLUDE_DIR=\path\to\freeglut\include 
-DGLUT_glut_LIBRARY=\path\to\freeglut\lib\x64\libfreeglut.a 
-DGLEXT_INCLUDE_DIR=\path\to\glext
-> ninja -C build
+cmake -H. -Bbuild -G "Ninja" -DGLEXT_INCLUDE_DIR=\path\to\glext 
-DGLUT_INCLUDE_DIR=\path\to\freeglut\include 
-DGLUT_glut_LIBRARY=\path\to\freeglut\lib\x64\libfreeglut.a 
-DGLEXT_INCLUDE_DIR=\path\to\glext
+ninja -C build
 
 
  2.5.2 Waffle
@@ -178,7 +184,7 @@ http://www.waffle-gl.org/
 Open the Command Prompt.
 CD to piglit directory.
 
-> cmake -H. -Bbuild -G "Ninja" -DGLEXT_INCLUDE_DIR=\path\to\glext 
-DPIGLIT_USE_WAFFLE=TRUE -DWAFFLE_INCLUDE_DIRS=\path\to\waffle\include\waffle 
WAFFLE_LDFLAGS=\path\to\waffle\lib\libwaffle-1.a
+cmake -H. -Bbuild -G "Ninja" -DGLEXT_INCLUDE_DIR=\path\to\glext 
-DPIGLIT_USE_WAFFLE=TRUE -DWAFFLE_INCLUDE_DIRS=\path\to\waffle\include\waffle 
WAFFLE_LDFLAGS=\path\to\waffle\lib\libwaffle-1.a
 
 
 3. How to run tests
@@ -186,7 +192,7 @@ CD to piglit directory.
 
 Make sure that everything is set up correctly:
 
-  $ ./piglit run sanity results/sanity
+$ ./piglit run sanity results/sanity
 
 You may include '.py' on the profile, or you may exclude it (sanity vs 
sanity.py),
 both are equally valid.
@@ -196,37 +202,39 @@ which may be useful for shell tab completion.
 
 You may provide multiple profiles to be run at the same time:
   
-  $ ./piglit run quick_cl gpu deqp_gles3 results/gl-cl-combined
+$ ./piglit run quick_cl gpu deqp_gles3 results/gl-cl-combined
 
 Use
 
-  $ ./piglit run
-  or
-  $ ./piglit run -h
+$ ./piglit run
+
+or
+
+$ ./piglit run -h
 
 To learn more about the command's syntax.
 
 Have a look into the tests/ directory to see what test profiles are available:
 
-  $ ls tests/*.py
+$ ls tests/*.py
 
 See also section 4.
 
 To create some nice formatted test summaries, run
 
-  $ ./piglit summary html summary/sanity results/sanity
+$ ./piglit summary html summary/sanity results/sanity
 
 Hint: You can combine multiple test results into a single summary.
   During development, you can use this to watch for regressions:
 
-  $ ./piglit summary html summary/compare results/baseline results/current
+$ ./piglit summary html summary/compare results/baseline results/current
 
   You can combine as many testruns as you want this way (in theory;
   the HTML layout becomes awkward when the number of t

[Piglit] [PATCH 2/8] README: Use proper markdown for the different heading levels

2018-06-07 Thread Jason Ekstrand
---
 README.md | 50 +++---
 1 file changed, 19 insertions(+), 31 deletions(-)

diff --git a/README.md b/README.md
index 66c6bca95..9f50d2ec9 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,7 @@
 
 Piglit
---
+==
+
 1. About
 2. Setup
 3. How to run tests
@@ -85,8 +86,7 @@ Now build everything:
   $ make
 
 
-2.1 Cross Compiling

+### 2.1 Cross Compiling
 
 On Linux, if cross-compiling a 32-bit build on a 64-bit host, first make sure
 you didn't have CMakeCache.txt file left from 64-bit build (it would retain old
@@ -94,8 +94,7 @@ flags), then you must invoke cmake with options 
"-DCMAKE_SYSTEM_PROCESSOR=x86
 -DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32".
 
 
-2.2 Ubuntu
---
+### 2.2 Ubuntu
 
 Install development packages.
   $ sudo apt-get install cmake g++ mesa-common-dev libgl1-mesa-dev 
python-numpy python-mako freeglut3-dev x11proto-gl-dev libxrender-dev 
libwaffle-dev
@@ -105,8 +104,7 @@ Configure and build.
   $ make
 
 
-2.3 Mac OS X
-
+### 2.3 Mac OS X
 
 Install CMake. 
 http://cmake.org/cmake/resources/software.html
@@ -120,8 +118,7 @@ Configure and build.
   $ make
 
 
-2.4 Cygwin
---
+### 2.4 Cygwin
 
 Install development packages.
   - cmake
@@ -138,8 +135,7 @@ Configure and build.
   $ make
 
 
-2.5 Windows

+### 2.5 Windows
 
 Install Python 3.
 http://www.python.org/download
@@ -165,8 +161,7 @@ Install NumPy.
 > pip install numpy
 
 
-2.5.1 GLUT
---
+ 2.5.1 GLUT
 
 Download freeglut for Mingw.
 http://www.transmissionzero.co.uk/software/freeglut-devel/
@@ -175,8 +170,7 @@ http://www.transmissionzero.co.uk/software/freeglut-devel/
 > ninja -C build
 
 
-2.5.2 Waffle
-
+ 2.5.2 Waffle
 
 Download and build waffle for MinGW.
 http://www.waffle-gl.org/
@@ -253,8 +247,8 @@ The summary shows the 'status' of a test:
 There are also dmesg-* statuses. These have the same meaning as above, but are
 triggered by dmesg related messages.
 
-3.1 Environment Variables
--
+
+### 3.1 Environment Variables
 
 There are a number of environment variables that control the way piglit
 behaves.
@@ -284,8 +278,8 @@ behaves.
When this variable is true in python then any timeouts given by tests
will be ignored, and they will run until completion or they are killed.
 
-3.2 Note
-
+
+### 3.2 Note
 
 The way 'piglit run' and 'piglit summary' count tests are different, 'piglit
 run' counts the number of Test derived instance in the profile(s) selected,
@@ -294,8 +288,7 @@ result if there are no subtests. This means that the number 
shown by 'piglit
 run' will be less than or equal to the number calculated by 'piglit summary'.
 
 
-3.3 Shell Completions
--
+### 3.3 Shell Completions
 
 Piglit has completions for bash, located in completions/bash/piglit. Once this
 file is sourced into bash `piglit` and `./piglit` will have tab completion
@@ -311,8 +304,7 @@ Test sets are specified as Python scripts in the tests 
directory.
 The following test sets are currently available:
 
 
-4.1 OpenGL Tests 
-
+### 4.1 OpenGL Tests
 
 sanity.py
 This suite contains minimal OpenGL sanity tests. These tests must
@@ -347,8 +339,7 @@ no_error.py
A modified version of the test list run as khr_no_error variants
 
 
-4.2 OpenCL Tests
-
+### 4.2 OpenCL Tests
 
 cl.py
 This suite contains all OpenCL tests.
@@ -358,8 +349,7 @@ quick_cl.py
and oclconform.
 
 
-4.3 External Integration
-
+### 4.3 External Integration
 
 xts.py
Support for running the X Test Suite using piglit.
@@ -468,8 +458,7 @@ Most integration is done through the use of piglit.conf, or 
through environment
 variables, with piglit.conf being the preferred method.
 
 
-6.1 dEQP
-
+### 6.1 dEQP
 
 Piglit provides a generic layer for dEQP based test suites, and specific
 integration for several suites.
@@ -511,8 +500,7 @@ dEQP profiles generally contain all of the tests from the 
previous profile, so
 gles31 covers gles3 and gles2.
 
 
-6.2 Khronos CTS

+### 6.2 Khronos CTS
 
 Add the following to your piglit.conf file:
 
-- 
2.17.1

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


[Piglit] [PATCH 8/8] README: Rework documentation for test classes

2018-06-07 Thread Jason Ekstrand
---
 README.md | 56 +++
 1 file changed, 28 insertions(+), 28 deletions(-)

diff --git a/README.md b/README.md
index dac9ba26b..7259ba574 100644
--- a/README.md
+++ b/README.md
@@ -376,45 +376,45 @@ All new tests must be added to the appropriate profile, 
all.py profile for
 OpenGL and cl.py for OpenCL. There are a few basic test classes supported by 
the
 python framework:
 
- PiglitBaseTest
-   A shared base class for all native piglit tests.
+  - `PiglitBaseTest`
+A shared base class for all native piglit tests.
 
-   It starts each test as a subprocess, captures stdout and stderr, and waits
-   for the test to return.
-   
-   It provides test timeouts by setting the instances 'timeout' attribute to an
-   integer > 0 which is the number of seconds the test should run.
+It starts each test as a subprocess, captures stdout and stderr, and waits
+for the test to return.
 
-   It interprets output by reading stdout and looking for 'PIGLIT: ' in the
-   output, and then reading any trailing characters as well formed json
-   returning the test result.
+It provides test timeouts by setting the instances 'timeout' attribute to 
an
+integer > 0 which is the number of seconds the test should run.
 
-   This is a base class and should not be used directly, but provides an
-   explanation of the behavior of the following classes.
+It interprets output by reading stdout and looking for 'PIGLIT: ' in the
+output, and then reading any trailing characters as well formed json
+returning the test result.
 
- PiglitGLTest
-   A test class for native piglit OpenGL tests.
+This is a base class and should not be used directly, but provides an
+explanation of the behavior of the following classes.
 
-   In addition to the properties of PiglitBaseTest it provides a mechanism for
-   detecting test window resizes and rerunning tests as well as keyword
-   arguments for platform requirements.
+  - `PiglitGLTest`
+A test class for native piglit OpenGL tests.
 
- PiglitCLTest
-   A test class for native piglit OpenCL tests.
+In addition to the properties of PiglitBaseTest it provides a mechanism for
+detecting test window resizes and rerunning tests as well as keyword
+arguments for platform requirements.
 
-   It currently provides no special features.
+  - `PiglitCLTest`
+A test class for native piglit OpenCL tests.
 
- GLSLParserTest
-   A class for testing a glsl parser.
+It currently provides no special features.
 
-   It is generally unnecessary to call this class directly as it uses a helper
-   function to search directories for tests.
+  - `GLSLParserTest`
+A class for testing a glsl parser.
 
- ShaderTest
-   A class for testing using OpenGL shaders.
+It is generally unnecessary to call this class directly as it uses a helper
+function to search directories for tests.
 
-   It is generally unnecessary to call this class directly as it uses a helper
-   function to search directories for tests.
+  - `ShaderTest`
+A class for testing using OpenGL shaders.
+
+It is generally unnecessary to call this class directly as it uses a helper
+function to search directories for tests.
 
 
 6. Integration
-- 
2.17.1

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


Re: [Piglit] GitLab migration of Piglit

2018-06-05 Thread Jason Ekstrand
Given the discussion below, I think we'll make piglit a sub-project of
mesa.  Those who need commit access to piglit but not mesa can be added
directly to the piglit project.

Unless someone objects strongly, I'll plan to migrate piglit on Thursday
along with all the other mesa repos.

On Mon, Jun 4, 2018 at 3:29 PM, Eric Anholt  wrote:

> Jason Ekstrand  writes:
>
> > All,
> >
> > Sorry for the mess of GitLab e-mails but there are a lot of questions to
> > ask as this process moves forward.  Today, we're discussing piglit.  I've
> > included both the mesa and piglit list in the hopes that people will
> > actually see this e-mail.
> >
> > Honestly, I expect the migration of piglit to have much less impact on
> most
> > people's daily lives than moving the mesa repo.
> >
> > The biggest question I have is whether we actually want to continue to
> have
> > a separate "piglit" group.  With GitLab, we can already give someone
> > developer access to piglit without giving them developer access to mesa.
> > Mostly, this is a question of whether we consider piglit to be it's own
> > project on freedesktop or a sub-project of mesa.  I don't know the answer
> > to that question.
>
> So far, having it be a separate group has just been a pain in getting
> people to contribute to piglit, when we mistakenly forget to add mesa
> devs to it.  I don't think we need it to be a separate committer group.
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] GitLab migration of Piglit

2018-06-04 Thread Jason Ekstrand
All,

Sorry for the mess of GitLab e-mails but there are a lot of questions to
ask as this process moves forward.  Today, we're discussing piglit.  I've
included both the mesa and piglit list in the hopes that people will
actually see this e-mail.

Honestly, I expect the migration of piglit to have much less impact on most
people's daily lives than moving the mesa repo.

The biggest question I have is whether we actually want to continue to have
a separate "piglit" group.  With GitLab, we can already give someone
developer access to piglit without giving them developer access to mesa.
Mostly, this is a question of whether we consider piglit to be it's own
project on freedesktop or a sub-project of mesa.  I don't know the answer
to that question.

Thoughts?

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


Re: [Piglit] [PATCH] func.sync.semaphore-fd: put _EXT in priority enums

2018-02-28 Thread Jason Ekstrand
I just pushed an equivalent of this.  Also, I pushed a patch to add Vulkan
headers to crucible so that it builds off the latest and not off whatever's
on your system.

On Wed, Feb 28, 2018 at 10:28 AM, Tapani Pälli 
wrote:

>
>
> On 28.02.2018 20:26, Tapani Pälli wrote:
>
>> Signed-off-by: Tapani Pälli 
>> ---
>>
>> Mark, this should fix Crucible for you. I don't understand why headers
>> shipped by Fedora (version 65) do not have _EXT in these enums (?)
>>
>
> and this meaning vulkan header version 65, not Fedora version :)
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 3/3] func.sync.semaphore-fd: new opaque-fd-no-sync test

2018-02-27 Thread Jason Ekstrand
Looks good to me.  All three are

Reviewed-by: Jason Ekstrand 

On Tue, Feb 27, 2018 at 12:10 AM, Tapani Pälli 
wrote:

> Patch adds a new test that is expected to fail, new option and
> some minor refactor done to check_memory_contents to allow this.
>
> Signed-off-by: Tapani Pälli 
> ---
>  src/tests/func/sync/semaphore-fd.c | 105 ++
> +--
>  1 file changed, 101 insertions(+), 4 deletions(-)
>
> diff --git a/src/tests/func/sync/semaphore-fd.c b/src/tests/func/sync/
> semaphore-fd.c
> index ea54369..385edde 100644
> --- a/src/tests/func/sync/semaphore-fd.c
> +++ b/src/tests/func/sync/semaphore-fd.c
> @@ -563,7 +563,7 @@ init_memory_contents(struct test_context *ctx,
>  static void
>  check_memory_contents(struct test_context *ctx,
>uint32_t *data, VkDeviceMemory memory,
> -  bool multi_ctx)
> +  bool multi_ctx, bool expect_failure)
>  {
>  /* First, do the computation on the CPU */
>  cpu_process_data(data);
> @@ -589,6 +589,13 @@ check_memory_contents(struct test_context *ctx,
>  .size = sizeof(struct buffer_layout),
>  });
>
> +/* If expecting a failure, do a simple memcmp. */
> +if (expect_failure) {
> +t_assert(memcmp(data, map->data, sizeof(map->data)) != 0);
> +vkUnmapMemory(ctx->device, tmp_mem);
> +return;
> +}
> +
>  t_assert(map->atomic == NUM_HASH_ITERATIONS);
>  for (unsigned i = 0; i < NUM_HASH_ITERATIONS; i++) {
>  unsigned ctx_iter = multi_ctx ? (i >> 1) : i;
> @@ -635,7 +642,7 @@ test_sanity(void)
>  }
>  }
>
> -check_memory_contents(&ctx, cpu_data, mem, false);
> +check_memory_contents(&ctx, cpu_data, mem, false, false);
>  }
>
>  test_define {
> @@ -813,7 +820,7 @@ test_opaque_fd(void)
>
>  logi("All compute batches queued\n");
>
> -check_memory_contents(&ctx1, cpu_data, mem1, true);
> +check_memory_contents(&ctx1, cpu_data, mem1, true, false);
>  }
>
>  test_define {
> @@ -822,6 +829,96 @@ test_define {
>  .no_image = true,
>  };
>
> +static void
> +test_opaque_fd_no_sync(void)
> +{
> +t_require_ext("VK_KHR_external_memory");
> +t_require_ext("VK_KHR_external_memory_capabilities");
> +t_require_ext("VK_KHR_external_memory_fd");
> +t_require_ext("VK_EXT_global_priority");
> +
> +struct test_context ctx1, ctx2;
> +init_context(&ctx1, 1.0, VK_QUEUE_GLOBAL_PRIORITY_MEDIUM);
> +init_context(&ctx2, 0.0, VK_QUEUE_GLOBAL_PRIORITY_LOW);
> +
> +#define GET_FUNCTION_PTR(name, device) \
> +PFN_vk##name name = (PFN_vk##name)vkGetDeviceProcAddr(device,
> "vk"#name)
> +GET_FUNCTION_PTR(GetMemoryFdKHR, ctx1.device);
> +#undef GET_FUNCTION_PTR
> +
> +VkMemoryRequirements buffer_reqs =
> +qoGetBufferMemoryRequirements(ctx1.device, ctx1.buffer);
> +
> +VkDeviceMemory mem1 =
> +qoAllocMemoryFromRequirements(ctx1.device, &buffer_reqs,
> +.properties = VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
> +.pNext = &(VkExportMemoryAllocateInfoKHR) {
> +.sType = VK_STRUCTURE_TYPE_EXPORT_
> MEMORY_ALLOCATE_INFO_KHR,
> +.handleTypes = VK_EXTERNAL_MEMORY_HANDLE_
> TYPE_OPAQUE_FD_BIT_KHR,
> +});
> +
> +int fd;
> +VkResult result = GetMemoryFdKHR(ctx1.device,
> +&(VkMemoryGetFdInfoKHR) {
> +.sType = VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR,
> +.memory = mem1,
> +.handleType = VK_EXTERNAL_MEMORY_HANDLE_
> TYPE_OPAQUE_FD_BIT_KHR,
> +}, &fd);
> +t_assert(result == VK_SUCCESS);
> +t_assert(fd >= 0);
> +
> +VkDeviceMemory mem2 =
> +qoAllocMemoryFromRequirements(ctx2.device, &buffer_reqs,
> +.properties = VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
> +.pNext = &(VkImportMemoryFdInfoKHR) {
> +.sType = VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR,
> +.handleType = VK_EXTERNAL_MEMORY_HANDLE_
> TYPE_OPAQUE_FD_BIT_KHR,
> +.fd = fd,
> +});
> +
> +qoBindBufferMemory(ctx1.device, ctx1.buffer, mem1, 0);
> +qoBindBufferMemory(ctx2.device, ctx2.buffer, mem2, 0);
> +
> +uint32_t cpu_data[LOCAL_WORKGROUP_SIZE * 2];
> +init_memory_contents(&ctx1, cpu_data, mem1);
> +
> +VkCommandBuffer cmd_buffer1 = create_command_buffer(&ctx1, 0);
> +VkCommandBuffer cmd_buffer2 = create_command_buffer(&ctx2, 1);
> +
> +logi("

Re: [Piglit] [PATCH 2/3] func.sync.semaphore-fd: use queue priorities if supported

2018-02-27 Thread Jason Ekstrand
On Tue, Feb 27, 2018 at 12:10 AM, Tapani Pälli 
wrote:

> Patch adds VK_EXT_global_priority support. This should not affect
> test results.
>
> Signed-off-by: Tapani Pälli 
> ---
>  src/tests/func/sync/semaphore-fd.c | 23 ---
>  1 file changed, 16 insertions(+), 7 deletions(-)
>
> diff --git a/src/tests/func/sync/semaphore-fd.c b/src/tests/func/sync/
> semaphore-fd.c
> index 63cb84d..ea54369 100644
> --- a/src/tests/func/sync/semaphore-fd.c
> +++ b/src/tests/func/sync/semaphore-fd.c
> @@ -43,23 +43,32 @@ struct buffer_layout {
>  };
>
>  static void
> -init_context(struct test_context *ctx, float priority)
> +init_context(struct test_context *ctx, float priority,
> + VkQueueGlobalPriorityEXT g_priority)
>  {
> const char *extension_names[] = {
>"VK_KHR_external_memory",
>"VK_KHR_external_memory_fd",
>"VK_KHR_external_semaphore",
>"VK_KHR_external_semaphore_fd",
> +  "VK_EXT_global_priority",
> };
>
> +bool use_global_priority =
> +t_has_ext("VK_EXT_global_priority");
> +
>  VkResult result = vkCreateDevice(t_physical_dev,
>  &(VkDeviceCreateInfo) {
>  .sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO,
> -.enabledExtensionCount = 4,
> +.enabledExtensionCount = use_global_priority ? 5 : 4,
>  .ppEnabledExtensionNames = extension_names,
>  .queueCreateInfoCount = 1,
>  .pQueueCreateInfos = &(VkDeviceQueueCreateInfo) {
>  .sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO,
> +.pNext = use_global_priority ? &(
> VkDeviceQueueGlobalPriorityCreateInfoEXT) {
> +.sType = VK_STRUCTURE_TYPE_DEVICE_
> QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT,
> +.globalPriority = g_priority,
> +} : NULL,
>

This is a crazy use of ternaries together with compound literals.  I think
it might be best to declare the QueueGlobalPriority structure above and
make things a little less in-line.


>  .queueFamilyIndex = 0,
>  .queueCount = 1,
>  .pQueuePriorities = (float[]) { priority },
> @@ -601,7 +610,7 @@ static void
>  test_sanity(void)
>  {
>  struct test_context ctx;
> -init_context(&ctx, 1.0);
> +init_context(&ctx, 1.0, VK_QUEUE_GLOBAL_PRIORITY_MEDIUM);
>
>  VkMemoryRequirements buffer_reqs =
>  qoGetBufferMemoryRequirements(ctx.device, ctx.buffer);
> @@ -674,8 +683,8 @@ test_opaque_fd(void)
>  require_handle_type(VK_EXTERNAL_SEMAPHORE_HANDLE_
> TYPE_OPAQUE_FD_BIT_KHR);
>
>  struct test_context ctx1, ctx2;
> -init_context(&ctx1, 1.0);
> -init_context(&ctx2, 0.0);
> +init_context(&ctx1, 1.0, VK_QUEUE_GLOBAL_PRIORITY_MEDIUM);
> +init_context(&ctx2, 0.0, VK_QUEUE_GLOBAL_PRIORITY_LOW);
>
>  #define GET_FUNCTION_PTR(name, device) \
>  PFN_vk##name name = (PFN_vk##name)vkGetDeviceProcAddr(device,
> "vk"#name)
> @@ -826,8 +835,8 @@ test_sync_fd(void)
>  require_handle_type(VK_EXTERNAL_SEMAPHORE_HANDLE_
> TYPE_SYNC_FD_BIT_KHR);
>
>  struct test_context ctx1, ctx2;
> -init_context(&ctx1, 1.0);
> -init_context(&ctx2, 0.0);
> +init_context(&ctx1, 1.0, VK_QUEUE_GLOBAL_PRIORITY_MEDIUM);
> +init_context(&ctx2, 0.0, VK_QUEUE_GLOBAL_PRIORITY_LOW);
>
>  #define GET_FUNCTION_PTR(name, device) \
>  PFN_vk##name name = (PFN_vk##name)vkGetDeviceProcAddr(device,
> "vk"#name)
> --
> 2.14.3
>
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] require VK_KHR_external_semaphore_fd in func.sync.semaphore-fd.sync-fd

2018-01-24 Thread Jason Ekstrand
On Wed, Jan 24, 2018 at 6:53 AM, Tapani Pälli 
wrote:

> This fixes test for me after Mesa commit 1f79d986af which will
> make device expose entrypoints only for enabled extensions.
>
> Signed-off-by: Tapani Pälli 
> ---
>  src/tests/func/sync/semaphore-fd.c | 6 ++
>  1 file changed, 6 insertions(+)
>
> diff --git a/src/tests/func/sync/semaphore-fd.c b/src/tests/func/sync/
> semaphore-fd.c
> index 69e56c2..a977a05 100644
> --- a/src/tests/func/sync/semaphore-fd.c
> +++ b/src/tests/func/sync/semaphore-fd.c
> @@ -45,9 +45,15 @@ struct buffer_layout {
>  static void
>  init_context(struct test_context *ctx, float priority)
>  {
> +   const char *extension_names[] = {
> +  "VK_KHR_external_semaphore_fd",
>

To be technically correct, we should enable all three external memory
extensions and all three external fence extensions.  With that,

Reviewed-by: Jason Ekstrand 


> +   };
> +
>  VkResult result = vkCreateDevice(t_physical_dev,
>  &(VkDeviceCreateInfo) {
>  .sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO,
> +.enabledExtensionCount = 1,
> +.ppEnabledExtensionNames = extension_names,
>  .queueCreateInfoCount = 1,
>  .pQueueCreateInfos = &(VkDeviceQueueCreateInfo) {
>  .sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO,
> --
> 2.13.6
>
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] Question regarding Crucible TODO item

2018-01-22 Thread Jason Ekstrand
On Thu, Jan 18, 2018 at 11:45 AM, Fabian Bieler 
wrote:

> Hello!
>
> The Crucible TODO.txt file contains:
> - Add a --diff option to crucible-run that dumps image diffs for failed
> tests.
>   (Requires multiple command buffers).
>
> I do not understand how an optional image diff dump would require
> multiple command buffers. Couldn't the diff be generated on the CPU?
>

It could, yes.  I'm not really sure where that TODO came from or what
Chad's rational was.  What I do know is that it's OLD.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 1/4] util: add an option to run an existing test with a compatibility profile

2017-10-31 Thread Jason Ekstrand
FYI, the new test fails on i965 with this:

Failed to compile vertex shader: 0:1(10): error: GLSL 1.40 is not
supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, and 3.00
ES


Is this expected?  I'm guessing it is since we don't support compat.

On Mon, Oct 23, 2017 at 5:31 AM, Marek Olšák  wrote:

> On Sat, Oct 21, 2017 at 7:57 PM, Ilia Mirkin  wrote:
> > On Sat, Oct 21, 2017 at 8:55 AM, Marek Olšák  wrote:
> >> From: Marek Olšák 
> >>
> >> and run one TBO test with it.
> >> ---
> >>  tests/all.py | 1 +
> >>  tests/util/piglit-framework-gl.c | 9 +
> >>  2 files changed, 10 insertions(+)
> >>
> >> diff --git a/tests/all.py b/tests/all.py
> >> index ff2ff1f..e25a5f6 100644
> >> --- a/tests/all.py
> >> +++ b/tests/all.py
> >> @@ -2581,20 +2581,21 @@ with profile.test_list.group_manager(
> >>  g(['arb_texture_buffer_object-unused-name'], 'unused-name')
> >>  g(['arb_texture_buffer_object-render-no-bo'], 'render-no-bo')
> >>
> >>  with profile.test_list.group_manager(
> >>  PiglitGLTest,
> >>  grouptools.join('spec', 'ARB_texture_buffer_range')) as g:
> >>  g(['arb_texture_buffer_range-dlist'], 'dlist')
> >>  g(['arb_texture_buffer_range-errors'], 'errors')
> >>  g(['arb_texture_buffer_range-ranges'], 'ranges')
> >>  g(['arb_texture_buffer_range-ranges-2'], 'ranges-2')
> >> +g(['arb_texture_buffer_range-ranges-2', '-compat'], 'ranges-2
> compat')
> >>
> >>  with profile.test_list.group_manager(
> >>  PiglitGLTest,
> >>  grouptools.join('spec', 'ARB_texture_rectangle')) as g:
> >>  g(['1-1-linear-texture'])
> >>  g(['texrect-many'], run_concurrent=False)
> >>  g(['getteximage-targets', 'RECT'])
> >>  g(['texrect_simple_arb_texrect'], run_concurrent=False)
> >>  g(['arb_texrect-texture-base-level-error'], run_concurrent=False)
> >>  g(['fbo-blit', 'rect'], run_concurrent=False)
> >> diff --git a/tests/util/piglit-framework-gl.c
> b/tests/util/piglit-framework-gl.c
> >> index a8e02d2..29e0e3a 100644
> >> --- a/tests/util/piglit-framework-gl.c
> >> +++ b/tests/util/piglit-framework-gl.c
> >> @@ -170,20 +170,29 @@ process_args(int *argc, char *argv[], unsigned
> *force_samples,
> >> "khr_no_error_support unknown "
> >> "skipping test!\n");
> >> piglit_report_result(PIGLIT_SKIP);
> >> } else if (config->khr_no_error_support ==
> >>PIGLIT_HAS_ERRORS) {
> >> piglit_report_result(PIGLIT_SKIP);
> >> } else {
> >> assert(config->khr_no_error_support ==
> >>PIGLIT_NO_ERRORS);
> >> }
> >> +   } else if (!strcmp(argv[j], "-compat")) {
> >> +   if (config->supports_gl_es_version) {
> >> +   fprintf(stderr,
> >> +   "-compat isn't allowed with ES
> tests!\n");
> >> +   piglit_report_result(PIGLIT_FAIL);
> >> +   }
> >> +   config->supports_gl_compat_version = 10;
> >> +   config->supports_gl_core_version = 0;
> >> +   puts("The compatibility profile forced.");
> >
> > Right now if a test specifies both gl_core and gl_compat, I believe
> > gl_core gets picked (not 100% sure). How about making -compat just set
> > gl_core to 0 and leave gl_compat alone?
>
> I think that won't work, gl_compat_version needs to be non-zero.
>
> Marek
> ___
> 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] glx-tfp: Use a nice orange color instead of red

2017-10-19 Thread Jason Ekstrand
The orange is not a 0/1 color.  If the driver messes up and gives the
client sRGB decode on the texture, the test will now fail.
---
 tests/glx/glx-tfp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/glx/glx-tfp.c b/tests/glx/glx-tfp.c
index c27c89a..2640874 100644
--- a/tests/glx/glx-tfp.c
+++ b/tests/glx/glx-tfp.c
@@ -41,8 +41,8 @@
 #include "X11/extensions/Xrender.h"
 
 GLfloat tex_data[4][4] = {
-   { 1.0, 0.0, 0.0, 1.0 },
-   { 1.0, 0.0, 0.0, 0.5 },
+   { 1.0, 0.5, 0.0, 1.0 },
+   { 1.0, 0.5, 0.0, 0.5 },
{ 0.0, 1.0, 0.0, 1.0 },
{ 0.0, 1.0, 0.0, 0.5 },
 };
-- 
2.5.0.400.gff86faf

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


Re: [Piglit] [Crucible] [PATCH 1/2] build: Do not overwrite user variables

2017-09-13 Thread Jason Ekstrand
Reviewed-by: Jason Ekstrand 

On Sat, Sep 9, 2017 at 12:15 PM, Józef Kucia  wrote:

> Allows passing CPPFLAGS, CFLAGS and CXXFLAGS to configure.
> ---
>
> I am not sure if this is the best place to submit patches for Crucible.
>
> ---
>  Makefile.am | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/Makefile.am b/Makefile.am
> index 656ee22..0478868 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -21,7 +21,7 @@
>
>  export CRUCIBLE_TOP := $(srcdir)
>
> -CPPFLAGS = \
> +AM_CPPFLAGS = \
> $(MESA_CPPFLAGS) \
> -D_DEFAULT_SOURCE \
> -D_GNU_SOURCE \
> @@ -37,13 +37,13 @@ common_CFLAGS = -Wall -O0 -g3 \
> $(LIBXML2_CFLAGS) \
> $(NULL)
>
> -CFLAGS = -std=gnu11 \
> +AM_CFLAGS = -std=gnu11 \
>  $(common_CFLAGS) \
> -Werror=implicit-function-declaration \
> -Werror=implicit-int \
> -Werror=missing-prototypes
>
> -CXXFLAGS = -std=c++11 $(common_CFLAGS)
> +AM_CXXFLAGS = -std=c++11 $(common_CFLAGS)
>
>  noinst_PROGRAMS = \
> bin/crucible
> --
> 2.13.5
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


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

2017-02-23 Thread Jason Ekstrand
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),
-- 
2.5.0.400.gff86faf

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


Re: [Piglit] [PATCH v2 2/2] generated_tests: Fix require_extensions for constant_array_size

2017-02-23 Thread Jason Ekstrand
Tested-by: Jason Ekstrand 

On Thu, Feb 23, 2017 at 4:29 PM, Dylan Baker  wrote:

> The extension requires a GL_ prefix, which the template didn't have.
>
> v2: - Actually fix things
>
> Signed-off-by: Dylan Baker 
> ---
>  generated_tests/gen_constant_array_size_tests.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/generated_tests/gen_constant_array_size_tests.py
> b/generated_tests/gen_constant_array_size_tests.py
> index 9c1a9a882..7c87d98da 100644
> --- a/generated_tests/gen_constant_array_size_tests.py
> +++ b/generated_tests/gen_constant_array_size_tests.py
> @@ -191,8 +191,8 @@ class ParserTest(object):
>  float(self.glsl_version()) / 100)
>  req_extensions = list(self.additional_extensions())
>  if req_extensions:
> -parser_test += ' * require_extensions: {0}\n'.format(
> -' '.join(req_extensions))
> +parser_test += ' * require_extensions: {}\n'.format(
> +' '.join('GL_{}'.format(r) for r in req_extensions))
>  parser_test += ' * [end config]\n'
>  parser_test += ' *\n'
>  parser_test += ' * Check that the following test vectors are
> constant'\
> --
> 2.11.1
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


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

2016-11-17 Thread Jason Ekstrand
On Nov 17, 2016 10:56 AM, "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 | 237
+
>  5 files changed, 255 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 16c46e8..9f47da5 100644
> --- a/tests/all.py
> +++ b/tests/all.py
> @@ -4755,6 +4755,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..d230e6c
> --- /dev/null
> +++ b/tests/spec/arb_post_depth_coverage/basic.c
> @@ -0,0 +1,237 @@
> +/*
> + * 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 = 45;
> +   config.supports_gl_core_version = 45;

Do we really need to require 4.5?  The extension doesn't have any required
version.

> +   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 =
> +   "#version 430\n"
> +   "out vec4 color;\n"
> +   "void main()\n"
> +   "{\n

Re: [Piglit] [PATCH] multisample_blit_scaled: Change 8X MSAA sample mapping

2016-08-11 Thread Jason Ekstrand
LGTM R-B

On Aug 11, 2016 12:30 PM, "Anuj Phogat"  wrote:

> This is required following a change in 8X multisample positions
> in i965 driver.
>
> Signed-off-by: Anuj Phogat 
> ---
>  .../ext_framebuffer_multisample_blit_scaled/blit-scaled.cpp| 10
> +-
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git 
> a/tests/spec/ext_framebuffer_multisample_blit_scaled/blit-scaled.cpp
> b/tests/spec/ext_framebuffer_multisample_blit_scaled/blit-scaled.cpp
> index 927615d..90e96ef 100644
> --- a/tests/spec/ext_framebuffer_multisample_blit_scaled/blit-scaled.cpp
> +++ b/tests/spec/ext_framebuffer_multisample_blit_scaled/blit-scaled.cpp
> @@ -162,13 +162,13 @@ compile_shader(GLenum target)
>  *
>  * 8X MSAA sample index layout8x MSAA sample number layout
>  *   -  -
> -*   | 0 | 1 |  | 5 | 2 |
> +*   | 0 | 1 |  | 3 | 7 |
>  *   -  -
> -*   | 2 | 3 |  | 4 | 6 |
> +*   | 2 | 3 |  | 5 | 0 |
>  *   -  -
> -*   | 4 | 5 |  | 0 | 3 |
> +*   | 4 | 5 |  | 1 | 2 |
>  *   -  -
> -*   | 6 | 7 |  | 7 | 1 |
> +*   | 6 | 7 |  | 4 | 6 |
>  *   -  -
>  *
>  * 16X MSAA sample index layout  16x MSAA sample number layout
> @@ -190,7 +190,7 @@ compile_shader(GLenum target)
> sample_number =  "int(2 * fract(coord.x) + 4 *
> fract(coord.y))";
> break;
> case 8:
> -   sample_map = "  const int sample_map[8] = int[8](5 , 2, 4,
> 6, 0, 3, 7, 1);\n";
> +   sample_map = "  const int sample_map[8] = int[8](3, 7, 5,
> 0, 1, 2, 4, 6);\n";
> sample_number = "sample_map[int(2 * fract(coord.x) + 8 *
> fract(coord.y))]";
> break;
> case 16:
> --
> 2.5.5
>
> ___
> 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 2/2] multisample/formats: Check for spec-complient integer resolves

2016-05-04 Thread Jason Ekstrand
The i965 driver has historically done integer multisample resolves with a
sort of integer averaging operation.  The spec used to not really say
anything at all about integer formats when discussing multisampling.  Since
the tests were written, the spec has been substantially clerified.  The new
rule is that integer MSAA resolves are supposed to pick a single arbitrary
sample for each texel rather than trying to combine them in any way.

Signed-off-by: Jason Ekstrand 
---
 tests/spec/ext_framebuffer_multisample/formats.cpp | 196 -
 1 file changed, 155 insertions(+), 41 deletions(-)

diff --git a/tests/spec/ext_framebuffer_multisample/formats.cpp 
b/tests/spec/ext_framebuffer_multisample/formats.cpp
index 4b1feba..1024b45 100644
--- a/tests/spec/ext_framebuffer_multisample/formats.cpp
+++ b/tests/spec/ext_framebuffer_multisample/formats.cpp
@@ -70,6 +70,44 @@ ColorGradientSunburst *test_pattern_vec4;
 ColorGradientSunburst *test_pattern_ivec4;
 ColorGradientSunburst *test_pattern_uvec4;
 
+struct int_resolve_check_s {
+   GLuint prog;
+   GLint u_resolve;
+   GLint u_msaa;
+   GLint u_samples;
+} int_resolve_check;
+
+const char int_resolve_check_vs[] =
+   "#version 130\n"
+   "in vec4 piglit_vertex;\n"
+   "void main() {\n"
+   "   gl_Position = piglit_vertex;\n"
+   "}\n";
+
+/* The OpenGL ES 3.2 and OpenGL 4.4 specs both state:
+ *
+ * "If the source for- mats are integer types or stencil values, a
+ * single sample’s value is selected for each pixel."
+ *
+ * This shader checks exactly that condition, namely that the result of the
+ * resolve is exactly one of the sample values in the original image.
+ */
+const char int_resolve_check_fs[] =
+   "#version 130\n"
+   "#extension GL_ARB_texture_multisample: require\n"
+   "uniform isampler2DMS msaa;\n"
+   "uniform isampler2D resolve;\n"
+   "uniform int samples;\n"
+   "void main() {\n"
+   "   gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\n"
+   "   const vec4 green = vec4(0.0, 1.0, 0.0, 1.0);\n"
+   "   ivec2 pos = ivec2(gl_FragCoord.xy);\n"
+   "   ivec4 res = texelFetch(resolve, pos, 0);\n"
+   "   for (int s = 0; s < samples; s++) {\n"
+   "   if (res == texelFetch(msaa, pos, s))\n"
+   "   gl_FragColor = green;\n"
+   "   }\n"
+   "}\n";
 
 /**
  * This class encapsulates the code necessary to draw the test pattern
@@ -80,7 +118,7 @@ ColorGradientSunburst *test_pattern_uvec4;
 class PatternRenderer
 {
 public:
-   bool try_setup(GLenum internalformat);
+   bool try_setup(GLenum internalformat, bool is_integer);
void set_piglit_tolerance();
void set_color_clamping_mode();
void draw();
@@ -140,11 +178,18 @@ public:
  * incomplete.
  */
 bool
-PatternRenderer::try_setup(GLenum internalformat)
+PatternRenderer::try_setup(GLenum internalformat, bool is_integer)
 {
FboConfig config_downsampled(0, pattern_width, pattern_height);
config_downsampled.color_internalformat = internalformat;
 
+   if (is_integer) {
+   config_downsampled.color_format = GL_RGBA_INTEGER;
+   config_downsampled.num_rb_attachments = 0;
+   config_downsampled.num_tex_attachments = 1;
+   config_downsampled.use_rect = false;
+   }
+
FboConfig config_msaa = config_downsampled;
config_msaa.num_samples = num_samples;
 
@@ -497,7 +542,9 @@ test_format(const struct format_desc *format)
 * supported, we might have received a GL error.  In either
 * case just skip to the next format.
 */
-   bool setup_success = test_renderer.try_setup(format->internalformat);
+   bool is_integer = (test_sets[test_index].basetype == GL_INT);
+   bool setup_success = test_renderer.try_setup(format->internalformat,
+is_integer);
if (glGetError() != GL_NO_ERROR) {
printf("Error setting up test renderbuffers\n");
return PIGLIT_SKIP;
@@ -511,7 +558,8 @@ test_format(const struct format_desc *format)
 * This shouldn't fail.
 */
setup_success = ref_renderer.try_setup(test_renderer.is_srgb ?
-  GL_SRGB8_ALPHA8 : GL_RGBA);
+  GL_SRGB8_ALPHA8 : GL_RGBA,
+  false);
if (!piglit_check_gl_error(GL_NO_ERROR)) {
printf("Error setting up reference renderbuffers\n");
return PIGLIT_FAIL;
@@ -521,50 +569,99 @@ test_format(const struct format_desc *format)
retu

[Piglit] [PATCH 1/2] util/fbo: Add support for textures with target GL_TEXTURE_2D

2016-05-04 Thread Jason Ekstrand
We used to always use GL_TEXTURE_RECTANGLE which we may not actually want.

Signed-off-by: Jason Ekstrand 
---
 tests/util/piglit-fbo.cpp | 14 +++---
 tests/util/piglit-fbo.h   |  8 
 2 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/tests/util/piglit-fbo.cpp b/tests/util/piglit-fbo.cpp
index 1c4cd6c..df403d7 100644
--- a/tests/util/piglit-fbo.cpp
+++ b/tests/util/piglit-fbo.cpp
@@ -38,6 +38,7 @@ FboConfig::FboConfig(int num_samples, int width, int height)
  width(width),
  height(height),
  layers(0),
+ use_rect(num_samples == 0),
  attachment_layer(0),
  combine_depth_stencil(true),
  color_format(GL_RGBA),
@@ -94,12 +95,11 @@ Fbo::attach_color_renderbuffer(const FboConfig &config, int 
index)
 void
 Fbo::attach_color_texture(const FboConfig &config, int index)
 {
-   glBindTexture(GL_TEXTURE_RECTANGLE, color_tex[index]);
-   glTexParameteri(GL_TEXTURE_RECTANGLE, GL_TEXTURE_MIN_FILTER,
-   GL_NEAREST);
-   glTexParameteri(GL_TEXTURE_RECTANGLE, GL_TEXTURE_MAG_FILTER,
-   GL_NEAREST);
-   glTexImage2D(GL_TEXTURE_RECTANGLE,
+   GLenum target = config.use_rect ? GL_TEXTURE_RECTANGLE : GL_TEXTURE_2D;
+   glBindTexture(target, color_tex[index]);
+   glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+   glTexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+   glTexImage2D(target,
 0 /* level */,
 config.color_internalformat,
 config.width,
@@ -110,7 +110,7 @@ Fbo::attach_color_texture(const FboConfig &config, int 
index)
 NULL /* data */);
glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER,
   config.tex_attachment[index],
-  GL_TEXTURE_RECTANGLE,
+  target,
   color_tex[index],
   0 /* level */);
 }
diff --git a/tests/util/piglit-fbo.h b/tests/util/piglit-fbo.h
index 8f956a4..e7e45a8 100644
--- a/tests/util/piglit-fbo.h
+++ b/tests/util/piglit-fbo.h
@@ -60,6 +60,14 @@ namespace piglit_util_fbo {
unsigned layers;
 
/**
+* If true, GL_TEXTURE_RECTANGLE is used when creating and
+* binding textures
+*
+* Default value is true if num_samples == 0.
+*/
+   bool use_rect;
+
+   /**
 * Specifies the layer of the texture that should be attached
 * to the framebuffer.  This must be less than the value of
 * ::layers (unless ::layers is zero).
-- 
2.5.0.400.gff86faf

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


Re: [Piglit] [PATCH 2/2] arb_gpu_shader5: Remove out of spec ldexp() test case.

2016-04-13 Thread Jason Ekstrand
both are

Reviewed-by: Jason Ekstrand 

On Wed, Apr 13, 2016 at 12:07 PM, Matt Turner  wrote:

> Unfortunately, the GLSL spec says that exponent values outside of [-126,
> 128] are undefined or may be flushed to zero.
> ---
>  .../execution/built-in-functions/fs-ldexp.shader_test  | 10
> --
>  1 file changed, 10 deletions(-)
>
> diff --git
> a/tests/spec/arb_gpu_shader5/execution/built-in-functions/fs-ldexp.shader_test
> b/tests/spec/arb_gpu_shader5/execution/built-in-functions/fs-ldexp.shader_test
> index 785eee5..989c1da 100644
> ---
> a/tests/spec/arb_gpu_shader5/execution/built-in-functions/fs-ldexp.shader_test
> +++
> b/tests/spec/arb_gpu_shader5/execution/built-in-functions/fs-ldexp.shader_test
> @@ -82,14 +82,4 @@ uniform ivec4 given_exponent -127 -127 -127 -127
>  draw arrays GL_TRIANGLE_FAN 0 4
>  probe all rgba 0.0 1.0 0.0 1.0
>
> -uniform vec4 expected_float 0.0 -0.0 0.0 -0.0
> -uniform vec4 given_float 1.1754944e-38 -1.1754944e-38 3.40282347e38
> -3.40282347e38
> -# For the FLT_MAX case -255 comes from (-127 + -127 + -1).
> -#   ldexp(FLT_MAX, -127)   = 0x1.fep+0 (1.99881)
> -#   ldexp(FLT_MAX, -127 - 127) = 0x1p-126 (epsilon above FLT_MIN)
> -#   ldexp(FLT_MAX, -127 - 127 - 1) = 0.0
> -uniform ivec4 given_exponent -1 -1 -255 -255
> -draw arrays GL_TRIANGLE_FAN 0 4
> -probe all rgba 0.0 1.0 0.0 1.0
> -
>  # Overflow is undefined according to the GLSL spec, so nothing to test.
> --
> 2.7.3
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 4/5] deqp: in group mode, rerun tests that fail in test at a time mode

2016-04-04 Thread Jason Ekstrand
I think the default mode we want here is more of a "continue after crash"
mode where, when it crashes, we don't rerun anything but instead just
continue starting from the next test.  This is what Google does with their
"cherry" tool and it would prevent ensure that random crashes don't get
hidden by the rerun.

On Thu, Mar 24, 2016 at 11:43 AM, Dylan Baker 
wrote:

> This adds a new feature to the deqp integration group at a time mode,
> which allows tests to be rerun when they meet a set of bad status in
> test at a time mode. This helps to eliminate tests where the crash
> caused tests to not be run, and helps clear up issues where an error
> would change test statuses.
>
> In my runs this is still significantly faster than test at a time mode,
> unless a huge number of tests are crashing. In that case it is really up
> to the developer to know whether they need test at a time mode, or
> whether group at a time mode is sufficient.
>
> A new option, --deqp-no-group-rerun, is added which disables this
> feature.
>
> This also addresses the vulkan suite issue, by rerunning any tests where
> the problematic statuses are detected in test at a time mode.
>
> Signed-off-by: Dylan Baker 
> ---
>  framework/backends/abstract.py |   6 ++
>  framework/options.py   |   3 +
>  framework/profile.py   |  80 ++
>  framework/programs/run.py  |   9 ++
>  framework/test/deqp.py | 182
> +++--
>  tests/deqp_vk.py   |  11 ++-
>  unittests/deqp_tests.py|  50 +++
>  7 files changed, 228 insertions(+), 113 deletions(-)
>
> diff --git a/framework/backends/abstract.py
> b/framework/backends/abstract.py
> index b5b4858..4ebc8ae 100644
> --- a/framework/backends/abstract.py
> +++ b/framework/backends/abstract.py
> @@ -207,6 +207,12 @@ class FileBackend(Backend):
>
>  """
>  def finish(val):
> +# If finish is passed None delete the file. This is used in
> the
> +# dEQP backend
> +if val is None:
> +os.unlink(file_)
> +return
> +
>  tfile = file_ + '.tmp'
>  with open(tfile, 'w') as f:
>  self._write(f, name, val)
> diff --git a/framework/options.py b/framework/options.py
> index 52d90be..b39cf60 100644
> --- a/framework/options.py
> +++ b/framework/options.py
> @@ -181,6 +181,8 @@ class _Options(object):  # pylint:
> disable=too-many-instance-attributes
>  env -- environment variables set for each test before run
>  deqp_mode -- either 'test' or 'group. Controls deqp integration mode,
> to
>   either run test at a time or group at a time.
> +deqp_group_rerun -- If True any tests that fail in group mode will be
> rerun
> +in individual mode.
>
>  """
>  include_filter = _ReListDescriptor('_include_filter',
> type_=_FilterReList)
> @@ -196,6 +198,7 @@ class _Options(object):  # pylint:
> disable=too-many-instance-attributes
>  self.dmesg = False
>  self.sync = False
>  self.deqp_mode = 'test'
> +self.deqp_group_rerun = False
>
>  # env is used to set some base environment variables that are not
> going
>  # to change across runs, without sending them to os.environ which
> is
> diff --git a/framework/profile.py b/framework/profile.py
> index fc38c56..5971dcb 100644
> --- a/framework/profile.py
> +++ b/framework/profile.py
> @@ -232,6 +232,50 @@ class TestProfile(object):
>  """
>  pass
>
> +def _test(self, pair, log, backend):
> +"""Function to call test.execute from map"""
> +name, test = pair
> +with backend.write_test(name) as w:
> +test.execute(name, log.get(), self.dmesg)
> +w(test.result)
> +
> +def _run_threads(self, pool, testlist, log, backend):
> +""" Open a pool, close it, and join it """
> +pool.imap(lambda pair: self._test(pair, log, backend), testlist)
> +pool.close()
> +pool.join()
> +
> +def _run(self, log, backend, test_list=None):
> +"""Run all the tests using requested threading."""
> +test_list = test_list or self.test_list
> +
> +# Multiprocessing.dummy is a wrapper around Threading that
> provides a
> +# multiprocessing compatible API
> +#
> +# The default value of pool is the number of virtual processor
> cores
> +single = multiprocessing.dummy.Pool(1)
> +multi = multiprocessing.dummy.Pool()
> +
> +if options.OPTIONS.concurrent == "all":
> +self._run_threads(multi, six.iteritems(test_list), log,
> +  backend)
> +elif options.OPTIONS.concurrent == "none":
> +self._run_threads(single, six.iteritems(test_list), log,
> +  backend)
> +else:
> +# Filter and return only thread safe tests to the threaded
>

[Piglit] [PATCH] Add a test runner for the Vulkan CTS

2016-03-15 Thread Jason Ekstrand
This is mostly a copy-and-paste of the original GLES3 dEQP runner with a
few added tidbits that makes running the Vulkan CTS easier.  The two
force-skip cases were very useful in the early days when lots of tests were
still in development and may no longer be needed.  However, I have a
feeling that we will yet want them.
---
 tests/deqp_vk.py | 91 
 1 file changed, 91 insertions(+)
 create mode 100644 tests/deqp_vk.py

diff --git a/tests/deqp_vk.py b/tests/deqp_vk.py
new file mode 100644
index 000..bc84229
--- /dev/null
+++ b/tests/deqp_vk.py
@@ -0,0 +1,91 @@
+# Copyright 2014, 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 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.
+
+"""Piglit integrations for dEQP VK tests."""
+
+import xml.etree.cElementTree as ET
+import re
+
+from framework.test import deqp
+
+__all__ = ['profile']
+
+# Path to the deqp-gles3 executable.
+_DEQP_VK_EXE = deqp.get_option('PIGLIT_DEQP_VK_EXE',
+   ('deqp-vk', 'exe'))
+
+_EXTRA_ARGS = deqp.get_option('PIGLIT_DEQP_VK_EXTRA_ARGS',
+  ('deqp-vk', 'extra_args'),
+  default='').split()
+
+
+def _get_test_case(root, root_group, outputfile):
+"""Parser the test case list of Google Android CTS,
+and store the test case list to dEQP-VK-cases.txt
+"""
+for child in root:
+root_group.append(child.get('name'))
+if child.tag == "Test":
+outputfile.write('TEST: {}\n'.format('.'.join(root_group)))
+del root_group[-1]
+else:
+_get_test_case(child, root_group, outputfile)
+del root_group[-1]
+
+
+def _load_test_hierarchy(mustpass, case_list):
+"""Google have added a subset of dEQP to CTS test, the case list is stored
+at some xml files. Such as: com.drawelements.deqp.gles3.xml This function
+is used to parser the file, and generate a new dEQP-VK-cases.txt which
+only contain the subset of dEQP.
+"""
+tree = ET.parse(mustpass)
+root = tree.getroot()
+root_group = []
+with open(case_list, 'w') as f:
+_get_test_case(root, root_group, f)
+
+_deqp_assert = re.compile(r'deqp-vk: external/vulkancts/.*: Assertion `.*\' 
failed.')
+
+class DEQPVKTest(deqp.DEQPBaseTest):
+timeout = 60
+deqp_bin = _DEQP_VK_EXE
+extra_args = [x for x in _EXTRA_ARGS if not x.startswith('--deqp-case')]
+
+
+def __init__(self, *args, **kwargs):
+super(DEQPVKTest, self).__init__(*args, **kwargs)
+
+def interpret_result(self):
+if 'Failed to compile shader at vkGlslToSpirV' in self.result.out:
+self.result.result = 'skip'
+self.result.out += '\n\nMarked as skip because GLSLang failed to 
compile shaders'
+elif _deqp_assert.search(self.result.err):
+self.result.result = 'skip'
+self.result.out += '\n\nMarked as skip because of a internal dEQP 
assertion'
+else:
+super(DEQPVKTest, self).interpret_result()
+
+
+profile = deqp.make_profile(  # pylint: disable=invalid-name
+deqp.iter_deqp_test_cases(
+deqp.gen_caselist_txt(_DEQP_VK_EXE, 'dEQP-VK-cases.txt',
+  _EXTRA_ARGS)),
+DEQPVKTest)
-- 
2.5.0.400.gff86faf

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


Re: [Piglit] [PATCH v2] framework: handle crash codes like piglit native tests.

2015-11-14 Thread Jason Ekstrand
On Thu, Nov 12, 2015 at 4:43 PM,   wrote:
> From: Dylan Baker 
>
> This changes the behavior of the dEQP integration such that a status
> that is < 0 on unix or (< 0 || == 3) on windows will be a crash rather
> than a fail. A status > 0 (except 3 on windows) will still be marked
> fail.
>
> This makes use of the helper function from framework/test/base.py
> rather than calling super() (which would still call the helper) because
> we don't want to get the warn status that we would also inherit.
>
> v2: - Update tests to use actual deqp ouput.
> - Fix status loop, v1 had a bug that would cause the loop to not
>   exit when it needed to, but it would pass the simplified tests.

Seems to work as advertised this time.  Thanks!

Tested-by: Jason Ekstrand 

> cc: Jason Ekstrand 
> Signed-off-by: Dylan Baker 
> ---
>  framework/test/base.py|   5 +-
>  framework/test/deqp.py|  23 +++--
>  framework/tests/deqp_tests.py | 191 
> ++
>  3 files changed, 174 insertions(+), 45 deletions(-)
>
> diff --git a/framework/test/base.py b/framework/test/base.py
> index bf00396..e130ec5 100644
> --- a/framework/test/base.py
> +++ b/framework/test/base.py
> @@ -47,6 +47,7 @@ __all__ = [
>  'TestRunError',
>  'ValgrindMixin',
>  'WindowResizeMixin',
> +'is_crash_returncode',
>  ]
>
>
> @@ -112,7 +113,7 @@ class ProcessTimeout(threading.Thread):
>  return self.status
>
>
> -def _is_crash_returncode(returncode):
> +def is_crash_returncode(returncode):
>  """Determine whether the given process return code correspond to a
>  crash.
>  """
> @@ -204,7 +205,7 @@ class Test(object):
>  def interpret_result(self):
>  """Convert the raw output of the test into a form piglit understands.
>  """
> -if _is_crash_returncode(self.result.returncode):
> +if is_crash_returncode(self.result.returncode):
>  # check if the process was terminated by the timeout
>  if self.timeout > 0 and self.__proc_timeout.join() > 0:
>  self.result.result = 'timeout'
> diff --git a/framework/test/deqp.py b/framework/test/deqp.py
> index 8290faf..5c84131 100644
> --- a/framework/test/deqp.py
> +++ b/framework/test/deqp.py
> @@ -24,7 +24,8 @@ import subprocess
>
>  # Piglit modules
>  from framework import core, grouptools, exceptions
> -from framework.profile import Test, TestProfile
> +from framework.profile import TestProfile
> +from framework.test.base import Test, is_crash_returncode
>
>  __all__ = [
>  'DEQPBaseTest',
> @@ -141,11 +142,10 @@ class DEQPBaseTest(Test):
>  command = super(DEQPBaseTest, self).command
>  return command + self.extra_args
>
> -def interpret_result(self):
> -if self.result.returncode != 0:
> -self.result.result = 'fail'
> -return
> -
> +def __find_map(self):
> +"""Run over the lines and set the result."""
> +# splitting this into a separate function allows us to return 
> cleanly,
> +# otherwise this requires some break/else/continue madness
>  for line in self.result.out.split('\n'):
>  line = line.lstrip()
>  for k, v in self.__RESULT_MAP.iteritems():
> @@ -153,5 +153,14 @@ class DEQPBaseTest(Test):
>  self.result.result = v
>  return
>
> +def interpret_result(self):
> +if is_crash_returncode(self.result.returncode):
> +self.result.result = 'crash'
> +elif self.result.returncode != 0:
> +self.result.result = 'fail'
> +else:
> +self.__find_map()
> +
>  # We failed to parse the test output. Fallback to 'fail'.
> -self.result.result = 'fail'
> +if self.result.result == 'notrun':
> +self.result.result = 'fail'
> diff --git a/framework/tests/deqp_tests.py b/framework/tests/deqp_tests.py
> index d9327ec..d95390d 100644
> --- a/framework/tests/deqp_tests.py
> +++ b/framework/tests/deqp_tests.py
> @@ -25,6 +25,9 @@ tests
>
>  """
>
> +from __future__ import absolute_import, division, print_function
> +
> +import mock
>  import nose.tools as nt
>
>  from framework import profile, grouptools, exceptions
> @@ -137,42 +140,158 @@ def test_DEQPBaseTest_command():
>  nt.eq_(test.command[-1], 'e

Re: [Piglit] [PATCH] ext_texture_format_bgra8888: Add test for GL_BGRA format in Tex(Sub)Image calls

2015-10-15 Thread Jason Ekstrand
On Wed, Oct 14, 2015 at 6:50 PM, Eduardo Lima Mitev  wrote:
> This is a new test that checks valid and invalid combinations of GL_BGRA_EXT
> format and internal format in Tex(Sub)Image2D calls, as specified by the
> EXT_texture_format_BGRA extension
> <https://www.khronos.org/registry/gles/extensions/EXT/EXT_texture_format_BGRA.txt>.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92265
> ---
>  tests/all.py   |   6 ++
>  tests/spec/CMakeLists.txt  |   1 +
>  .../CMakeLists.gles2.txt   |   7 ++
>  .../ext_texture_format_bgra/CMakeLists.txt |   1 +
>  tests/spec/ext_texture_format_bgra/teximage.c  | 103 
> +
>  5 files changed, 118 insertions(+)
>  create mode 100644 
> tests/spec/ext_texture_format_bgra/CMakeLists.gles2.txt
>  create mode 100644 tests/spec/ext_texture_format_bgra/CMakeLists.txt
>  create mode 100644 tests/spec/ext_texture_format_bgra/teximage.c
>
> diff --git a/tests/all.py b/tests/all.py
> index 610d89f..144b51e 100644
> --- a/tests/all.py
> +++ b/tests/all.py
> @@ -2226,6 +2226,12 @@ with profile.group_manager(
>  g(['arb_occlusion_query2-api'], 'api')
>  g(['arb_occlusion_query2-render'], 'render')
>
> +# Group EXT_texture_format_BGRA tests
> +with profile.group_manager(
> +PiglitGLTest,
> +grouptools.join('spec', 'EXT_texture_format_BGRA')) as g:
> +g(['ext_texture_format_bgra-teximage'], 'teximage')
> +
>  with profile.group_manager(
>  PiglitGLTest,
>  grouptools.join('spec', 'ARB_pixel_buffer_object')) as g:
> diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
> index 5dc37a1..bf22680 100644
> --- a/tests/spec/CMakeLists.txt
> +++ b/tests/spec/CMakeLists.txt
> @@ -133,3 +133,4 @@ add_subdirectory (arb_texture_stencil8)
>  add_subdirectory (arb_vertex_attrib_64bit)
>  add_subdirectory (ext_framebuffer_blit)
>  add_subdirectory (mesa_pack_invert)
> +add_subdirectory (ext_texture_format_bgra)
> diff --git a/tests/spec/ext_texture_format_bgra/CMakeLists.gles2.txt 
> b/tests/spec/ext_texture_format_bgra/CMakeLists.gles2.txt
> new file mode 100644
> index 000..38edd70
> --- /dev/null
> +++ b/tests/spec/ext_texture_format_bgra/CMakeLists.gles2.txt
> @@ -0,0 +1,7 @@
> +link_libraries (
> +   piglitutil_${piglit_target_api}
> +)
> +
> +piglit_add_executable (ext_texture_format_bgra-teximage teximage.c)
> +
> +# vim: ft=cmake:
> diff --git a/tests/spec/ext_texture_format_bgra/CMakeLists.txt 
> b/tests/spec/ext_texture_format_bgra/CMakeLists.txt
> new file mode 100644
> index 000..144a306
> --- /dev/null
> +++ b/tests/spec/ext_texture_format_bgra/CMakeLists.txt
> @@ -0,0 +1 @@
> +piglit_include_target_api()
> diff --git a/tests/spec/ext_texture_format_bgra/teximage.c 
> b/tests/spec/ext_texture_format_bgra/teximage.c
> new file mode 100644
> index 000..cb40db2
> --- /dev/null
> +++ b/tests/spec/ext_texture_format_bgra/teximage.c

Let's call this api-errors.c or something like that.  It really isn't
testing TexImage.  We should probably eventually have a test that
tests that the texture actually gets on the screen.  However, I'm not
too terribly worried about it since, as long as we don't error out, we
*probably* do the right thing there.

With it re-named to api-errors,

Reviewed-by: Jason Ekstrand 

> @@ -0,0 +1,103 @@
> +/*
> + * Copyright © 2015 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, T

[Piglit] [PATCH] Add a test for a uniform indexed by a swizzled vector

2015-08-20 Thread Jason Ekstrand
This catches a bug in the i965 backend compiler where we were running a
pass (to split vectors up) that didn't know about indirects before we
lowered the indirects away.
---
 ...fs-uniform-indexed-by-swizzled-vec4.shader_test | 24 ++
 1 file changed, 24 insertions(+)
 create mode 100644 
tests/shaders/glsl-fs-uniform-indexed-by-swizzled-vec4.shader_test

diff --git a/tests/shaders/glsl-fs-uniform-indexed-by-swizzled-vec4.shader_test 
b/tests/shaders/glsl-fs-uniform-indexed-by-swizzled-vec4.shader_test
new file mode 100644
index 000..ffe54c5
--- /dev/null
+++ b/tests/shaders/glsl-fs-uniform-indexed-by-swizzled-vec4.shader_test
@@ -0,0 +1,24 @@
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+void main()
+{
+   gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+uniform float f[2];
+uniform ivec4 s;
+
+void main()
+{
+   gl_FragColor = vec4(f[s.x], f[s.y], f[s.z], f[s.w]);
+}
+
+[test]
+uniform float f[0] 0.0
+uniform float f[1] 1.0
+uniform ivec4 s 0 1 0 1
+draw rect -1 -1 2 2
+probe rgb 1 1 0.0 1.0 0.0
-- 
2.4.3

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


Re: [Piglit] [PATCH] spec/arb_copy_image: Don't try to do compressed-to-compressed copies

2015-03-12 Thread Jason Ekstrand
On Thu, Mar 12, 2015 at 9:59 PM, Ilia Mirkin  wrote:

> The bytes comparison is an approximation of what the spec says... it
> has those explicit classes. But this is probably good enough...
>

Yeah, as long as we don't add anything to the list that's not called out as
being usable with copy_image, we should be ok.

Reviewed-by: Ilia Mirkin 
>

Thanks!


>
> On Fri, Mar 13, 2015 at 12:23 AM, Jason Ekstrand 
> wrote:
> > This isn't actually supported by the GL_ARB_copy_image spec.
> > ---
> >  tests/spec/arb_copy_image/formats.c | 17 ++---
> >  1 file changed, 14 insertions(+), 3 deletions(-)
> >
> > diff --git a/tests/spec/arb_copy_image/formats.c
> b/tests/spec/arb_copy_image/formats.c
> > index 8a5faa7..aa9b4d3 100644
> > --- a/tests/spec/arb_copy_image/formats.c
> > +++ b/tests/spec/arb_copy_image/formats.c
> > @@ -261,10 +261,21 @@ is_format_supported(struct texture_format *format)
> >  static bool
> >  are_formats_compatible(struct texture_format *f1, struct texture_format
> *f2)
> >  {
> > -   if (f1->can_be_reinterpreted && f2->can_be_reinterpreted)
> > -   return f1->bytes == f2->bytes;
> > +   if (f1 == f2)
> > +   return true;
> > +
> > +   if (is_format_compressed(f1)) {
> > +   if (is_format_compressed(f2))
> > +   /* Compressed-to-compressed copies are not
> supported */
> > +   return false;
> >
> > -   return f1 == f2;
> > +   return f1->bytes == f2->bytes;
> > +   } else if (is_format_compressed(f2)) {
> > +   return f1->bytes == f2->bytes;
> > +   } else {
> > +   return f1->can_be_reinterpreted &&
> f2->can_be_reinterpreted &&
> > +  f1->bytes == f2->bytes;
> > +   }
> >  }
> >
> >  static const float green[3] = {0.0, 1.0, 0.0};
> > --
> > 2.3.2
> >
> > ___
> > Piglit mailing list
> > Piglit@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/piglit
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] spec/arb_copy_image: Don't try to do compressed-to-compressed copies

2015-03-12 Thread Jason Ekstrand
This isn't actually supported by the GL_ARB_copy_image spec.
---
 tests/spec/arb_copy_image/formats.c | 17 ++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/tests/spec/arb_copy_image/formats.c 
b/tests/spec/arb_copy_image/formats.c
index 8a5faa7..aa9b4d3 100644
--- a/tests/spec/arb_copy_image/formats.c
+++ b/tests/spec/arb_copy_image/formats.c
@@ -261,10 +261,21 @@ is_format_supported(struct texture_format *format)
 static bool
 are_formats_compatible(struct texture_format *f1, struct texture_format *f2)
 {
-   if (f1->can_be_reinterpreted && f2->can_be_reinterpreted)
-   return f1->bytes == f2->bytes;
+   if (f1 == f2)
+   return true;
+
+   if (is_format_compressed(f1)) {
+   if (is_format_compressed(f2))
+   /* Compressed-to-compressed copies are not supported */
+   return false;
 
-   return f1 == f2;
+   return f1->bytes == f2->bytes;
+   } else if (is_format_compressed(f2)) {
+   return f1->bytes == f2->bytes;
+   } else {
+   return f1->can_be_reinterpreted && f2->can_be_reinterpreted &&
+  f1->bytes == f2->bytes;
+   }
 }
 
 static const float green[3] = {0.0, 1.0, 0.0};
-- 
2.3.2

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


Re: [Piglit] [PATCH] arb_gpu_shader_fp64: make fs-modf-double require GLSL 1.50

2015-02-04 Thread Jason Ekstrand
On Feb 4, 2015 9:46 PM, "Ilia Mirkin"  wrote:
>
> Yeah, it does require GLSL 1.50. From
> https://www.opengl.org/registry/specs/ARB/gpu_shader_fp64.txt:
>
> OpenGL 3.2 and GLSL 1.50 are required.
>
> But most importantly, because of the GLSL >= 130 line, only a compat
> context was being created by shader_runner, which in turn meant that
> the fp64 extension wasn't being exposed (since it's listed as
> core-only).

Good enough for me.

>
> On Thu, Feb 5, 2015 at 12:41 AM, Jason Ekstrand 
wrote:
> > Does fp64 require 1.50?  If not, then it seems as if the requirement of
> > having the gpu_shader_fp64 extension available is sufficient.  Am I
missing
> > something?
> >
> > On Wed, Feb 4, 2015 at 7:34 PM, Ilia Mirkin 
wrote:
> >>
> >> Mesa only exposes fp64 on core profiles.
> >>
> >> Signed-off-by: Ilia Mirkin 
> >> ---
> >>  .../built-in-functions/fs-modf-double.shader_test | 19
> >> +--
> >>  1 file changed, 13 insertions(+), 6 deletions(-)
> >>
> >> diff --git
> >>
a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-modf-double.shader_test
> >>
b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-modf-double.shader_test
> >> index 79bae06..9618308 100644
> >> ---
> >>
a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-modf-double.shader_test
> >> +++
> >>
b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-modf-double.shader_test
> >> @@ -4,19 +4,19 @@
> >>  # returns them correctly.
> >>
> >>  [require]
> >> -GLSL >= 1.30
> >> +GLSL >= 1.50
> >>  GL_ARB_gpu_shader_fp64
> >>
> >>  [vertex shader]
> >> -#version 130
> >> +in vec4 vertex;
> >>  void main()
> >>  {
> >> -  gl_Position = gl_Vertex;
> >> +  gl_Position = vertex;
> >>  }
> >>
> >>  [fragment shader]
> >> -#version 130
> >>  #extension GL_ARB_gpu_shader_fp64 : enable
> >> +
> >>  uniform double value;
> >>  uniform double expected1;
> >>  uniform double expected2;
> >> @@ -31,17 +31,24 @@ void main()
> >>gl_FragColor = vec4(b1, b2, 0.0, 1.0);
> >>  }
> >>
> >> +[vertex data]
> >> +vertex/float/2
> >> +-1.0 -1.0
> >> + 1.0 -1.0
> >> + 1.0  1.0
> >> +-1.0  1.0
> >> +
> >>  [test]
> >>  uniform double value 2.5
> >>  uniform double expected1 2.0
> >>  uniform double expected2 0.5
> >>  uniform double tolerance 0.0041452078
> >> -draw rect -1 -1 2 2
> >> +draw arrays GL_TRIANGLE_FAN 0 4
> >>  probe rgba 0 0 1.0 1.0 0.0 1.0
> >>
> >>  uniform double value -1.33
> >>  uniform double expected1 -1.0
> >>  uniform double expected2 -0.33
> >>  uniform double tolerance 0.0041452078
> >> -draw rect -1 -1 2 2
> >> +draw arrays GL_TRIANGLE_FAN 0 4
> >>  probe rgba 1 0 1.0 1.0 0.0 1.0
> >> --
> >> 2.0.5
> >>
> >> ___
> >> Piglit mailing list
> >> Piglit@lists.freedesktop.org
> >> http://lists.freedesktop.org/mailman/listinfo/piglit
> >
> >
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] arb_gpu_shader_fp64: make fs-modf-double require GLSL 1.50

2015-02-04 Thread Jason Ekstrand
Does fp64 require 1.50?  If not, then it seems as if the requirement of
having the gpu_shader_fp64 extension available is sufficient.  Am I missing
something?

On Wed, Feb 4, 2015 at 7:34 PM, Ilia Mirkin  wrote:

> Mesa only exposes fp64 on core profiles.
>
> Signed-off-by: Ilia Mirkin 
> ---
>  .../built-in-functions/fs-modf-double.shader_test | 19
> +--
>  1 file changed, 13 insertions(+), 6 deletions(-)
>
> diff --git
> a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-modf-double.shader_test
> b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-modf-double.shader_test
> index 79bae06..9618308 100644
> ---
> a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-modf-double.shader_test
> +++
> b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-modf-double.shader_test
> @@ -4,19 +4,19 @@
>  # returns them correctly.
>
>  [require]
> -GLSL >= 1.30
> +GLSL >= 1.50
>  GL_ARB_gpu_shader_fp64
>
>  [vertex shader]
> -#version 130
> +in vec4 vertex;
>  void main()
>  {
> -  gl_Position = gl_Vertex;
> +  gl_Position = vertex;
>  }
>
>  [fragment shader]
> -#version 130
>  #extension GL_ARB_gpu_shader_fp64 : enable
> +
>  uniform double value;
>  uniform double expected1;
>  uniform double expected2;
> @@ -31,17 +31,24 @@ void main()
>gl_FragColor = vec4(b1, b2, 0.0, 1.0);
>  }
>
> +[vertex data]
> +vertex/float/2
> +-1.0 -1.0
> + 1.0 -1.0
> + 1.0  1.0
> +-1.0  1.0
> +
>  [test]
>  uniform double value 2.5
>  uniform double expected1 2.0
>  uniform double expected2 0.5
>  uniform double tolerance 0.0041452078
> -draw rect -1 -1 2 2
> +draw arrays GL_TRIANGLE_FAN 0 4
>  probe rgba 0 0 1.0 1.0 0.0 1.0
>
>  uniform double value -1.33
>  uniform double expected1 -1.0
>  uniform double expected2 -0.33
>  uniform double tolerance 0.0041452078
> -draw rect -1 -1 2 2
> +draw arrays GL_TRIANGLE_FAN 0 4
>  probe rgba 1 0 1.0 1.0 0.0 1.0
> --
> 2.0.5
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] arb_copy_image-targets: Add comments to silence Coverity defects.

2015-01-20 Thread Jason Ekstrand
Fine with me

Reviewed-by: Jason Ekstrand 

On Mon, Jan 19, 2015 at 1:48 PM, Vinson Lee  wrote:

> Silence Coverity "missing break in switch" defects.
>
> Signed-off-by: Vinson Lee 
> ---
>  tests/spec/arb_copy_image/targets.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/tests/spec/arb_copy_image/targets.c
> b/tests/spec/arb_copy_image/targets.c
> index 86edeca..333631c 100644
> --- a/tests/spec/arb_copy_image/targets.c
> +++ b/tests/spec/arb_copy_image/targets.c
> @@ -65,12 +65,14 @@ image_init(struct image *image, GLenum target, int
> width, int height, int depth)
> switch (target) {
> case GL_TEXTURE_CUBE_MAP:
> assert(depth == 6);
> +   /* Fall through. */
> case GL_TEXTURE_CUBE_MAP_ARRAY_ARB:
> assert(width == height);
> assert(depth % 6 == 0);
> break;
> case GL_TEXTURE_1D:
> assert(height == 1);
> +   /* Fall through. */
> case GL_TEXTURE_2D:
> case GL_TEXTURE_RECTANGLE:
> assert(depth == 1);
> --
> 2.2.1
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] gpu_shader5: Fix the GLSL version in indirect-projGradOffset-shadow

2015-01-14 Thread Jason Ekstrand
The ARB_gpu_shader5 extension requires GLSL 1.50 and we were only requiring
GLSL 1.30
---
 .../spec/arb_gpu_shader5/compiler/indirect-projGradOffset-shadow.frag | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/tests/spec/arb_gpu_shader5/compiler/indirect-projGradOffset-shadow.frag 
b/tests/spec/arb_gpu_shader5/compiler/indirect-projGradOffset-shadow.frag
index ccf1886..aaeeba4 100644
--- a/tests/spec/arb_gpu_shader5/compiler/indirect-projGradOffset-shadow.frag
+++ b/tests/spec/arb_gpu_shader5/compiler/indirect-projGradOffset-shadow.frag
@@ -1,9 +1,9 @@
 // [config]
 // expect_result: pass
-// glsl_version: 1.30
+// glsl_version: 1.50
 // require_extensions: GL_ARB_gpu_shader5
 // [end config]
-#version 130
+#version 150
 #extension GL_ARB_gpu_shader5: require
 
 uniform int i;
-- 
2.2.1

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


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

2015-01-14 Thread Jason Ekstrand
On Tue, Jan 13, 2015 at 11:49 PM, Samuel Iglesias Gonsalvez <
sigles...@igalia.com> wrote:

> Packed types are not explicitly allowed to work with GL_ABGR_EXT format in
> the OpenGL spec nor GL_EXT_abgr spec.
>
> NVIDIA allows it but AMD doesn't and Intel driver hasn't allowed it with
> UNSIGNED_SHORT_5_5_5_1 and UNSIGNED_INT_10_10_10_2 as of c471b09bf4.
>
> Signed-off-by: Samuel Iglesias Gonsalvez 
> ---
>  tests/glean/tpixelformats.cpp | 6 ++
>  1 file changed, 6 insertions(+)
>
> diff --git a/tests/glean/tpixelformats.cpp b/tests/glean/tpixelformats.cpp
> index 27881bf..b040957 100644
> --- a/tests/glean/tpixelformats.cpp
> +++ b/tests/glean/tpixelformats.cpp
> @@ -612,6 +612,12 @@ PixelFormatsTest::CompatibleFormatAndType(GLenum
> format, GLenum datatype) const
> if (format == GL_ABGR_EXT && !haveABGR)
> return false;
>
> +   // Special case: GL_ABGR_EXT can't be used with packed types
> +   // because they are not explicitely allowed by GL_ABGR_EXT spec or
> +   // OpenGL spec.
>

I'd word this differently:

...because the packed formats specs (which were all written after the
GL_EXT_abgr) explicitly say that the packed formats can only be used with
GL_RGB, GL_BGR, GL_RGBA, or GL_BGRA and do not mention GL_ABGR_EXT.

Either way,
Reviewed-by: Jason Ekstrand 


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


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

2015-01-13 Thread Jason Ekstrand
On Tue, Jan 13, 2015 at 2:24 AM, Samuel Iglesias Gonsálvez <
sigles...@igalia.com> wrote:

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

Thans, Sam.   Pushed.


>
> I sent yesterday morning a similar patch [0] that also stop testing those
> GL_ABGR_EXT format and type combinations in texture-packed-formats.c  and
> tests/glean/tpixelformats.cpp.
>
> As your patch is more complete than mine for texture-packed-formats.c , I
> am
> going to modify mine and resend it once you have pushed this patch to
> master.
>
> Sam
>
> [0]  http://lists.freedesktop.org/archives/piglit/2015-January/014052.html
>
> > ---
> >  tests/texturing/texture-packed-formats.c | 13 -
> >  1 file changed, 13 deletions(-)
> >
> > diff --git a/tests/texturing/texture-packed-formats.c
> > b/tests/texturing/texture-packed-formats.c index 1c92b1c..87da808 100644
> > --- a/tests/texturing/texture-packed-formats.c
> > +++ b/tests/texturing/texture-packed-formats.c
> > @@ -89,19 +89,6 @@ static const struct pixel_format Formats[] = {
> >   { "GL_BGRA/GL_UNSIGNED_SHORT_1_5_5_5_REV",
> > GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, 2, 0xfc00, 0x83e0 },
> >
> > - { "GL_ABGR_EXT/GL_UNSIGNED_INT_8_8_8_8",
> > -   GL_ABGR_EXT, GL_UNSIGNED_INT_8_8_8_8, 4, 0x80ff, 0x8000ff00
> },
> > - { "GL_ABGR_EXT/GL_UNSIGNED_INT_8_8_8_8_REV",
> > -   GL_ABGR_EXT, GL_UNSIGNED_INT_8_8_8_8_REV, 4, 0xff80,
> 0x00ff0080 },
> > - { "GL_ABGR_EXT/GL_UNSIGNED_SHORT_4_4_4_4",
> > -   GL_ABGR_EXT, GL_UNSIGNED_SHORT_4_4_4_4, 2, 0x800f, 0x80f0 },
> > - { "GL_ABGR_EXT/GL_UNSIGNED_SHORT_4_4_4_4_REV",
> > -   GL_ABGR_EXT, GL_UNSIGNED_SHORT_4_4_4_4_REV, 2, 0xf008, 0x0f08 },
> > - { "GL_ABGR_EXT/GL_UNSIGNED_SHORT_5_5_5_1",
> > -   GL_ABGR_EXT, GL_UNSIGNED_SHORT_5_5_5_1, 2, 0xf801, 0xf83e },
> > - { "GL_ABGR_EXT/GL_UNSIGNED_SHORT_1_5_5_5_REV",
> > -   GL_ABGR_EXT, GL_UNSIGNED_SHORT_1_5_5_5_REV, 2, 0x800f, 0x7c0f },
> > -
> >   { "GL_RGB/GL_UNSIGNED_SHORT_5_6_5",
> > GL_RGB, GL_UNSIGNED_SHORT_5_6_5, 2, 0xf800, 0x7e0 },
> >   { "GL_RGB/GL_UNSIGNED_SHORT_5_6_5_REV",
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] gpu_shader5: Add a require_extensions section to indirect-progGradOffset-shadow

2015-01-12 Thread Jason Ekstrand
---
 tests/spec/arb_gpu_shader5/compiler/indirect-projGradOffset-shadow.frag | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/tests/spec/arb_gpu_shader5/compiler/indirect-projGradOffset-shadow.frag 
b/tests/spec/arb_gpu_shader5/compiler/indirect-projGradOffset-shadow.frag
index e908578..ccf1886 100644
--- a/tests/spec/arb_gpu_shader5/compiler/indirect-projGradOffset-shadow.frag
+++ b/tests/spec/arb_gpu_shader5/compiler/indirect-projGradOffset-shadow.frag
@@ -1,6 +1,7 @@
 // [config]
 // expect_result: pass
 // glsl_version: 1.30
+// require_extensions: GL_ARB_gpu_shader5
 // [end config]
 #version 130
 #extension GL_ARB_gpu_shader5: require
-- 
2.2.0

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


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

2015-01-12 Thread Jason Ekstrand
Since GL_ABGR_EXT was extension number 1 to the GL spec, it didn't take
packed formats into account.  As far as I can tell from the way the packed
formats extensions are written, packed formats with GL_ABGR_EXT isn't
allowed by the spec.  NVIDIA allows it but AMD doesn't and our driver
hasn't allowed ith with UNSIGNED_INT_5_5_5_1 as of c471b09bf4.  Let's stop
testing invalid things.
---
 tests/texturing/texture-packed-formats.c | 13 -
 1 file changed, 13 deletions(-)

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

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


Re: [Piglit] [PATCH] gpu_shader5: Add a test that uses an absurd number of texture arguments

2015-01-10 Thread Jason Ekstrand
On Sat, Jan 10, 2015 at 2:22 AM, Chris Forbes  wrote:

> On Sat, Jan 10, 2015 at 7:27 PM, Jason Ekstrand 
> wrote:
> > This adds a test that uses an indirect offset into an array of 2D shadow
> > samplers with a textureProjGradOffset.  The primary purpse of this is to
> > use a lot of arguments with an indirect offset.  This hits a bug in the
> > current NIR code where we originally assumed a max of 4 texture
> arguments.
> > ---
> >  .../compiler/indirect-projGradOffset-shadow.frag   | 18
> ++
> >  1 file changed, 18 insertions(+)
> >  create mode 100644
> tests/spec/arb_gpu_shader5/compiler/indirect-projGradOffset-shadow.frag
> >
> > diff --git
> a/tests/spec/arb_gpu_shader5/compiler/indirect-projGradOffset-shadow.frag
> b/tests/spec/arb_gpu_shader5/compiler/indirect-projGradOffset-shadow.frag
> > new file mode 100644
> > index 000..43bbe0b
> > --- /dev/null
> > +++
> b/tests/spec/arb_gpu_shader5/compiler/indirect-projGradOffset-shadow.frag
> > @@ -0,0 +1,18 @@
> > +// [config]
> > +// expect_result: pass
> > +// glsl_version: 1.30
> > +// [end config]
> > +#version 130
> > +#extension GL_ARB_gpu_shader5: require
> > +
> > +uniform int i;
> > +uniform vec4 coord;
> > +uniform ivec2 offset;
>
> Nothing uses this?
>

right.


>
> > +uniform sampler2DShadow s[5];
> > +
> > +void main()
> > +{
> > +  float f = textureProjGradOffset(s[i], coord, coord.xy, coord.zw,
> > + ivec2(43, 7));
>
> The offset components should really be restricted to -8/+7.
>

sure.


>
> > +  gl_FragColor = vec4(0, f, 0, 1);
> > +}
> > --
> > 2.2.0
>
> Otherwise,
>
> Reviewed-by: Chris Forbes 
>

Thanks.


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


[Piglit] [PATCH] gpu_shader5: Add a test that uses an absurd number of texture arguments

2015-01-09 Thread Jason Ekstrand
This adds a test that uses an indirect offset into an array of 2D shadow
samplers with a textureProjGradOffset.  The primary purpse of this is to
use a lot of arguments with an indirect offset.  This hits a bug in the
current NIR code where we originally assumed a max of 4 texture arguments.
---
 .../compiler/indirect-projGradOffset-shadow.frag   | 18 ++
 1 file changed, 18 insertions(+)
 create mode 100644 
tests/spec/arb_gpu_shader5/compiler/indirect-projGradOffset-shadow.frag

diff --git 
a/tests/spec/arb_gpu_shader5/compiler/indirect-projGradOffset-shadow.frag 
b/tests/spec/arb_gpu_shader5/compiler/indirect-projGradOffset-shadow.frag
new file mode 100644
index 000..43bbe0b
--- /dev/null
+++ b/tests/spec/arb_gpu_shader5/compiler/indirect-projGradOffset-shadow.frag
@@ -0,0 +1,18 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.30
+// [end config]
+#version 130
+#extension GL_ARB_gpu_shader5: require
+
+uniform int i;
+uniform vec4 coord;
+uniform ivec2 offset;
+uniform sampler2DShadow s[5];
+
+void main()
+{
+  float f = textureProjGradOffset(s[i], coord, coord.xy, coord.zw,
+ ivec2(43, 7));
+  gl_FragColor = vec4(0, f, 0, 1);
+}
-- 
2.2.0

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


Re: [Piglit] [PATCH 1/2] teximage-colors: Add support for testing PBO uploads

2015-01-09 Thread Jason Ekstrand
On Fri, Jan 9, 2015 at 2:58 PM, Dylan Baker  wrote:

> On Friday, January 09, 2015 02:53:25 PM Jason Ekstrand wrote:
> > ---
> >  tests/all.py  |  3 +++
> >  tests/texturing/teximage-colors.c | 54
> ---
> >  2 files changed, 42 insertions(+), 15 deletions(-)
> >
> > diff --git a/tests/all.py b/tests/all.py
> > index 87ff8e9..50d4b39 100644
> > --- a/tests/all.py
> > +++ b/tests/all.py
> > @@ -853,6 +853,9 @@ color_formats = [
> >  for format in color_formats:
> >  add_concurrent_test(gl11, ['teximage-colors', format])
> >
> > +for format in color_formats:
> > +add_concurrent_test(gl11, ['teximage-colors', '--pbo', format])
> > +
>
> Is there a reason this cannot be part of the previous loop?
>

No.  Would you rather it be?


>
> >  gl10 = {}
> >  spec['!OpenGL 1.0'] = gl10
> >  add_concurrent_test(gl10, ['gl-1.0-beginend-coverage'])
> > diff --git a/tests/texturing/teximage-colors.c
> b/tests/texturing/teximage-colors.c
> > index 31136a9..5944137 100644
> > --- a/tests/texturing/teximage-colors.c
> > +++ b/tests/texturing/teximage-colors.c
> > @@ -459,8 +459,11 @@ int texture_size = 31;
> >  struct texture_format *format = NULL;
> >  GLuint unsigned_prog, signed_prog;
> >  void *rand_data;
> > +float *rand_float;
> > +GLuint pbo, float_pbo;
> >  float tolerance[4];
> >  bool benchmark = false;
> > +bool use_pbo = false;
> >
> >  void
> >  piglit_init(int argc, char **argv)
> > @@ -473,6 +476,8 @@ piglit_init(int argc, char **argv)
> >   } else if (strcmp(argv[i], "--benchmark") == 0) {
> >   benchmark = true;
> >   texture_size = 128;
> > + } else if (strcmp(argv[i], "--pbo") == 0) {
> > + use_pbo = true;
> >   } else if (i == argc - 1) {
> >   format = find_format(argv[i]);
> >   break;
> > @@ -492,10 +497,31 @@ piglit_init(int argc, char **argv)
> >   unsigned_prog = piglit_build_simple_program(NULL,
> frag_shader_unsigned_src);
> >
> >   srand(seed);
> > +
> >   rand_data = malloc(texture_size * texture_size * 128);
> >   for (i = 0; i < texture_size * texture_size * 128; ++i)
> >   ((GLubyte *)rand_data)[i] = rand();
> >
> > + rand_float = malloc(texture_size * texture_size * 128);
> > + for (i = 0; i < texture_size * texture_size * 32; ++i)
> > + rand_float[i] = sn_to_float(32, ((GLint *)rand_data)[i]);
> > +
> > + if (use_pbo) {
> > + glGenBuffers(1, &pbo);
> > + glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pbo);
> > + glBufferData(GL_PIXEL_UNPACK_BUFFER,
> > +  texture_size * texture_size * 128, rand_data,
> > +  GL_STATIC_DRAW);
> > +
> > + glGenBuffers(1, &float_pbo);
> > + glBindBuffer(GL_PIXEL_UNPACK_BUFFER, float_pbo);
> > + glBufferData(GL_PIXEL_UNPACK_BUFFER,
> > +  texture_size * texture_size * 128, rand_float,
> > +  GL_STATIC_DRAW);
> > +
> > + glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
> > + }
> > +
> >   if (is_format_srgb(format->internal_format)) {
> >   /* We loose a little precision in the high numbers */
> >   tolerance[0] = 0.02;
> > @@ -701,9 +727,9 @@ run_test(GLenum test_format, GLenum test_type, float
> *time_out)
> >   bool pass = true;
> >   int64_t time;
> >   GLuint tex;
> > - int i, Bpp, channels;
> > - float *tmp, *expected, *observed;
> > - void *data;
> > + int i, Bpp;
> > + float *expected, *observed;
> > + void *data, *teximage_ptr;
> >
> >   glGenTextures(1, &tex);
> >   glBindTexture(GL_TEXTURE_2D, tex);
> > @@ -712,18 +738,15 @@ run_test(GLenum test_format, GLenum test_type,
> float *time_out)
> >
> >   glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
> >
> > - channels = num_channels(test_format);
> >   Bpp = bytes_per_pixel(test_format, test_type);
> >
> > - if (test_type == GL_FLOAT) {
> > - /* Sanatize so we don't get invalid floating point values
> */
> > - tmp = malloc(texture_size * texture_size * channels *
> sizeof(flo

[Piglit] [PATCH 1/2] teximage-colors: Add support for testing PBO uploads

2015-01-09 Thread Jason Ekstrand
---
 tests/all.py  |  3 +++
 tests/texturing/teximage-colors.c | 54 ---
 2 files changed, 42 insertions(+), 15 deletions(-)

diff --git a/tests/all.py b/tests/all.py
index 87ff8e9..50d4b39 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -853,6 +853,9 @@ color_formats = [
 for format in color_formats:
 add_concurrent_test(gl11, ['teximage-colors', format])
 
+for format in color_formats:
+add_concurrent_test(gl11, ['teximage-colors', '--pbo', format])
+
 gl10 = {}
 spec['!OpenGL 1.0'] = gl10
 add_concurrent_test(gl10, ['gl-1.0-beginend-coverage'])
diff --git a/tests/texturing/teximage-colors.c 
b/tests/texturing/teximage-colors.c
index 31136a9..5944137 100644
--- a/tests/texturing/teximage-colors.c
+++ b/tests/texturing/teximage-colors.c
@@ -459,8 +459,11 @@ int texture_size = 31;
 struct texture_format *format = NULL;
 GLuint unsigned_prog, signed_prog;
 void *rand_data;
+float *rand_float;
+GLuint pbo, float_pbo;
 float tolerance[4];
 bool benchmark = false;
+bool use_pbo = false;
 
 void
 piglit_init(int argc, char **argv)
@@ -473,6 +476,8 @@ piglit_init(int argc, char **argv)
} else if (strcmp(argv[i], "--benchmark") == 0) {
benchmark = true;
texture_size = 128;
+   } else if (strcmp(argv[i], "--pbo") == 0) {
+   use_pbo = true;
} else if (i == argc - 1) {
format = find_format(argv[i]);
break;
@@ -492,10 +497,31 @@ piglit_init(int argc, char **argv)
unsigned_prog = piglit_build_simple_program(NULL, 
frag_shader_unsigned_src);
 
srand(seed);
+
rand_data = malloc(texture_size * texture_size * 128);
for (i = 0; i < texture_size * texture_size * 128; ++i)
((GLubyte *)rand_data)[i] = rand();
 
+   rand_float = malloc(texture_size * texture_size * 128);
+   for (i = 0; i < texture_size * texture_size * 32; ++i)
+   rand_float[i] = sn_to_float(32, ((GLint *)rand_data)[i]);
+
+   if (use_pbo) {
+   glGenBuffers(1, &pbo);
+   glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pbo);
+   glBufferData(GL_PIXEL_UNPACK_BUFFER,
+texture_size * texture_size * 128, rand_data,
+GL_STATIC_DRAW);
+
+   glGenBuffers(1, &float_pbo);
+   glBindBuffer(GL_PIXEL_UNPACK_BUFFER, float_pbo);
+   glBufferData(GL_PIXEL_UNPACK_BUFFER,
+texture_size * texture_size * 128, rand_float,
+GL_STATIC_DRAW);
+
+   glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
+   }
+
if (is_format_srgb(format->internal_format)) {
/* We loose a little precision in the high numbers */
tolerance[0] = 0.02;
@@ -701,9 +727,9 @@ run_test(GLenum test_format, GLenum test_type, float 
*time_out)
bool pass = true;
int64_t time;
GLuint tex;
-   int i, Bpp, channels;
-   float *tmp, *expected, *observed;
-   void *data;
+   int i, Bpp;
+   float *expected, *observed;
+   void *data, *teximage_ptr;
 
glGenTextures(1, &tex);
glBindTexture(GL_TEXTURE_2D, tex);
@@ -712,18 +738,15 @@ run_test(GLenum test_format, GLenum test_type, float 
*time_out)
 
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
 
-   channels = num_channels(test_format);
Bpp = bytes_per_pixel(test_format, test_type);
 
-   if (test_type == GL_FLOAT) {
-   /* Sanatize so we don't get invalid floating point values */
-   tmp = malloc(texture_size * texture_size * channels * 
sizeof(float));
-   for (i = 0; i < texture_size * texture_size * channels; ++i)
-   tmp[i] = sn_to_float(32, ((GLint *)rand_data)[i]);
-   data = tmp;
+   data = (test_type == GL_FLOAT) ? rand_float : rand_data;
+   if (use_pbo) {
+   glBindBuffer(GL_PIXEL_UNPACK_BUFFER,
+(test_type == GL_FLOAT) ? float_pbo : pbo);
+   teximage_ptr = NULL;
} else {
-   tmp = NULL;
-   data = rand_data;
+   teximage_ptr = data;
}
 
expected = malloc(texture_size * texture_size * 4 * sizeof(float));
@@ -736,16 +759,18 @@ run_test(GLenum test_format, GLenum test_type, float 
*time_out)
for (i = 0; i < BENCHMARK_ITERATIONS; ++i)
glTexImage2D(GL_TEXTURE_2D, 0, format->internal_format,
 texture_size, texture_size, 0,
-test_format, test_type, data);
+test_format, test_type, teximage_ptr);
time = piglit_time_get_nano() - time;
*time_out = (double)time / (double)(BENCHMARK_ITERATIONS*1000);
} else {
   

[Piglit] [PATCH 2/2] teximage-colors: Improve --benchmark option

2015-01-09 Thread Jason Ekstrand
This commit does a couple of things.  First, we increase the size of the
texture uploaded while benchmarking to 1024 square to reduce the affect of
set-up overhead.  Second, we do a render and then call glFinish at the end
of the upload loop to ensure that things actually get flushed through the
GPU and GPU time is included in the test.
---
 tests/texturing/teximage-colors.c | 35 +++
 1 file changed, 23 insertions(+), 12 deletions(-)

diff --git a/tests/texturing/teximage-colors.c 
b/tests/texturing/teximage-colors.c
index 5944137..ff2b174 100644
--- a/tests/texturing/teximage-colors.c
+++ b/tests/texturing/teximage-colors.c
@@ -29,6 +29,9 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
 
config.supports_gl_compat_version = 13;
 
+   config.window_width = 1024;
+   config.window_height = 1024;
+
config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE;
 
 PIGLIT_GL_TEST_CONFIG_END
@@ -475,7 +478,7 @@ piglit_init(int argc, char **argv)
srand(seed);
} else if (strcmp(argv[i], "--benchmark") == 0) {
benchmark = true;
-   texture_size = 128;
+   texture_size = 1024;
} else if (strcmp(argv[i], "--pbo") == 0) {
use_pbo = true;
} else if (i == argc - 1) {
@@ -754,33 +757,41 @@ run_test(GLenum test_format, GLenum test_type, float 
*time_out)
to_expected(test_format, test_type, (GLubyte *)data + (i * Bpp),
expected + 4 * i);
 
+   if (is_format_signed(format->internal_format)) {
+   glUseProgram(signed_prog);
+
+   for (i = 0; i < texture_size * texture_size * 4; ++i)
+   expected[i] = 0.5 + 0.5 * expected[i];
+   } else {
+   glUseProgram(unsigned_prog);
+   }
+
if (benchmark) {
time = piglit_time_get_nano();
+
for (i = 0; i < BENCHMARK_ITERATIONS; ++i)
glTexImage2D(GL_TEXTURE_2D, 0, format->internal_format,
 texture_size, texture_size, 0,
 test_format, test_type, teximage_ptr);
+
+   piglit_draw_rect_tex(0, 0, texture_size, texture_size,
+0, 0, 1, 1);
+   glFinish();
+
time = piglit_time_get_nano() - time;
*time_out = (double)time / (double)(BENCHMARK_ITERATIONS*1000);
} else {
glTexImage2D(GL_TEXTURE_2D, 0, format->internal_format,
 texture_size, texture_size, 0,
 test_format, test_type, teximage_ptr);
-   }
-   pass &= piglit_check_gl_error(GL_NO_ERROR);
 
-   glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
-
-   if (is_format_signed(format->internal_format)) {
-   glUseProgram(signed_prog);
+   pass &= piglit_check_gl_error(GL_NO_ERROR);
 
-   for (i = 0; i < texture_size * texture_size * 4; ++i)
-   expected[i] = 0.5 + 0.5 * expected[i];
-   } else {
-   glUseProgram(unsigned_prog);
+   piglit_draw_rect_tex(0, 0, texture_size, texture_size,
+0, 0, 1, 1);
}
 
-   piglit_draw_rect_tex(0, 0, texture_size, texture_size, 0, 0, 1, 1);
+   glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
 
observed = malloc(texture_size * texture_size * 4 * sizeof(float));
glReadPixels(0, 0, texture_size, texture_size,
-- 
2.2.0

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


Re: [Piglit] [PATCH 3/4] utils: add initial WAFFLE_WGL support

2014-12-15 Thread Jason Ekstrand
On Fri, Nov 21, 2014 at 11:52 AM, Emil Velikov 
wrote:
>
> This will allow us to use waffle with its upcoming WGL support for
> Windows. With that done, the final step to removing glut is to convert
> piglit to use waffle for MacOS.
>
> Current implementation does not have input handling/event loop, and as
> such one needs to pass "-auto" when running individual tests, otherwise
> the test will abort after being displayed for 8 seconds.
>
> Waffle 1.5.0 is the first version that has WGL support.
>

Do we need anything from 1.5.0 besides WGL?  If not, can we only require
1.5.0 if we're on windows and continue only requiring 1.3.0 on linux?  I
ask because I very much enjoy just using the fedora packages for waffle
which are at 1.3 (fedora 21) and 1.4 (rawhide).
--Jason


>
> TODO:
>  - Bump the WAFFLE_API_VERSION ?
>  - Add input handling (event_loop).
>
> v2: Updated the instructions in the README.
> v3: Update against upstream Waffle (no API breakage)
>
> Signed-off-by: Emil Velikov 
> Reviewed-by: Brian Paul  (v1)
> Signed-off-by: Emil Velikov 
> ---
>  CMakeLists.txt |  7 +-
>  README | 38 +-
>  tests/util/CMakeLists.txt  |  5 ++
>  .../piglit-framework-gl/piglit_wfl_framework.c | 10 +++
>  .../piglit-framework-gl/piglit_wgl_framework.c | 85
> ++
>  .../piglit-framework-gl/piglit_wgl_framework.h | 29 
>  .../piglit-framework-gl/piglit_winsys_framework.c  |  7 ++
>  7 files changed, 177 insertions(+), 4 deletions(-)
>  create mode 100644 tests/util/piglit-framework-gl/piglit_wgl_framework.c
>  create mode 100644 tests/util/piglit-framework-gl/piglit_wgl_framework.h
>
> diff --git a/CMakeLists.txt b/CMakeLists.txt
> index 2f15971..6ba6df8 100644
> --- a/CMakeLists.txt
> +++ b/CMakeLists.txt
> @@ -61,7 +61,7 @@ if(PIGLIT_USE_WAFFLE)
> # validates the required version at most once for the lifetime of
> the
> # source tree.  If someone changes the required version by editing
> the
> # CMakeLists, CMake fails to detect the new requirement.
> -   set(WAFFLE_REQUIRED_VERSION "1.3.0")
> +   set(WAFFLE_REQUIRED_VERSION "1.5.0")
> if(WAFFLE_VERSION VERSION_LESS WAFFLE_REQUIRED_VERSION)
> message(FATAL_ERROR "Found waffle-${WAFFLE_VERSION}, but "
> "piglit requires waffle-${WAFFLE_REQUIRED_VERSION}")
> @@ -128,6 +128,11 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
> pkg_check_modules(LIBDRM_INTEL QUIET libdrm_intel)
> pkg_check_modules(XCB_DRI2 QUIET xcb-dri2)
> pkg_check_modules(GLPROTO QUIET glproto)
> +ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
> +   if (PIGLIT_USE_WAFFLE)
> +   set(PIGLIT_HAS_WGL True)
> +   add_definitions(-DPIGLIT_HAS_WGL)
> +   endif()
>  ENDIF()
>
>  IF(PIGLIT_HAS_GLX)
> diff --git a/README b/README
> index 2917c3a..b894db7 100644
> --- a/README
> +++ b/README
> @@ -144,15 +144,19 @@ http://www.opengl.org/registry/#headers
>  Copy header files to MSVC.
>  C:\Program Files\Microsoft Visual Studio 12.0\VC\include\GL
>
> -Download freeglut for MSVC.
> -http://www.transmissionzero.co.uk/software/freeglut-devel
> -
>  Install pip.
>  http://www.pip-installer.org/en/latest/installing.html
>
>  Install python mako.
>> c:\Python27\Scripts\pip.exe install mako
>
> +
> +2.5.1 GLUT
> +--
> +
> +Download freeglut for MSVC.
> +http://www.transmissionzero.co.uk/software/freeglut-devel
> +
>  Open Visual Studio Command Prompt.
>  Start Menu->All Programs->Visual Studio 2013->Visual Studio Tools->VS2013
> x86 Native Tools Command Prompt
>  CD to piglit directory.
> @@ -172,6 +176,34 @@ File->Exit
>  Build from the Visual Studio Command Prompt.
>> nmake
>
> +2.5.2 Waffle
> +
> +
> +Download waffle for MSVC.
> +http://www.waffle-gl.org/
> +
> +Open the Command Prompt.
> +CD to piglit directory.
> +
> +Run CMake GUI.
> +  > C:\Program Files\CMake 2.8\bin\cmake-gui.exe .
> +Configure
> +  - 'Visual Studio 12 2013', or
> +  - 'Visual Studio 12 2013 Win64'
> +  - Use default native compilers
> +Set these variables in the Advanced view.
> +Note that the values provided are for reference purposed and may differ
> on your system.
> +  - PIGLIT_USE_WAFFLE, BOOL, TRUE
> +  - WAFFLE_VERSION, STRING, "1.5.0"
> +  - WAFFLE_INCLUDE_DIRS, PATH, ${waffle_root}\include\waffle
> +  - WAFFLE_LDFLAGS, FILEPATH, ${waffle_root}\lib\waffle-1.lib
> +  - GLEXT_INCLUDE_DIR, PATH, C:\Program Files\Microsoft Visual Studio
> 12.0\VC\include\GL
> +Configure
> +Generate
> +File->Exit
> +
> +Build from the Command Prompt.
> +  > cmake --build .
>
>  3. How to run tests
>  ---
> diff --git a/tests/util/CMakeLists.txt b/tests/util/CMakeLists.txt
> index 98eedd0..edc8469 100644
> --- a/tests/util/CMakeLists.txt
> +++ b/tests/util/CMakeLists.txt
> @@ -64,6 +64,11 @@ if(PIGLIT_USE_WAFFLE)
> piglit-util-waffl

Re: [Piglit] [PATCH v2] teximage-color: Add comment to silence Coverity defect.

2014-12-14 Thread Jason Ekstrand
That's better
On Dec 13, 2014 10:58 PM, "Vinson Lee"  wrote:

> Silences Coverity report about missing break in switch.
>
> Signed-off-by: Vinson Lee 
> ---
>  tests/texturing/teximage-colors.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/tests/texturing/teximage-colors.c
> b/tests/texturing/teximage-colors.c
> index 001626d..8bbe15e 100644
> --- a/tests/texturing/teximage-colors.c
> +++ b/tests/texturing/teximage-colors.c
> @@ -525,6 +525,7 @@ piglit_init(int argc, char **argv)
> case GL_UNSIGNED_SHORT_5_5_5_1:
> case GL_UNSIGNED_SHORT_1_5_5_5_REV:
> tolerance[3] = 0.6;
> +   /* Fall through. */
> case GL_UNSIGNED_SHORT_5_6_5:
> case GL_UNSIGNED_SHORT_5_6_5_REV:
> tolerance[0] = 0.05;
> --
> 1.9.2
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 2/3] ssa: Add a test for the classic "lost copy problem" in out-of-SSA translation

2014-12-13 Thread Jason Ekstrand
---
 tests/shaders/ssa/fs-lost-copy-problem.shader_test | 23 ++
 1 file changed, 23 insertions(+)
 create mode 100644 tests/shaders/ssa/fs-lost-copy-problem.shader_test

diff --git a/tests/shaders/ssa/fs-lost-copy-problem.shader_test 
b/tests/shaders/ssa/fs-lost-copy-problem.shader_test
new file mode 100644
index 000..4eeeacc
--- /dev/null
+++ b/tests/shaders/ssa/fs-lost-copy-problem.shader_test
@@ -0,0 +1,23 @@
+[require]
+GLSL >= 1.10
+
+[fragment shader]
+uniform int count;
+
+void main()
+{
+int j = 0;
+for (int i = 0; i <= count; ++i)
+j = i;
+
+if (j == 6)
+gl_FragColor = vec4(0, 1, 0, 1);
+else
+gl_FragColor = vec4(1, 0, 0, 1);
+}
+
+[test]
+uniform int count 6
+
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 1.0
-- 
2.2.0

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


[Piglit] [PATCH 1/3] ssa: Add a test for the classic "swap problem" in out-of-SSA translation

2014-12-13 Thread Jason Ekstrand
---
 tests/shaders/ssa/fs-swap-problem.shader_test | 19 +++
 1 file changed, 19 insertions(+)
 create mode 100644 tests/shaders/ssa/fs-swap-problem.shader_test

diff --git a/tests/shaders/ssa/fs-swap-problem.shader_test 
b/tests/shaders/ssa/fs-swap-problem.shader_test
new file mode 100644
index 000..2cf03ff
--- /dev/null
+++ b/tests/shaders/ssa/fs-swap-problem.shader_test
@@ -0,0 +1,19 @@
+[require]
+GLSL >= 1.10
+
+[fragment shader]
+uniform bool f;
+
+void main()
+{
+gl_FragColor = vec4(1, 0, 0, 1);
+do {
+gl_FragColor.xy = gl_FragColor.yx;
+} while (f);
+}
+
+[test]
+uniform int f = 0
+
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 1.0
-- 
2.2.0

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


[Piglit] [PATCH 3/3] ssa: Add a test for an edge case in into-SSA translation

2014-12-13 Thread Jason Ekstrand
In particular, we want to test the case

a = ...
if (foo) {
a = ...
} else {
break;
}
... = a;

We had a bug in one of the into-ssa passes that caused the use of a at the
end to use the first definition of a instead of the second.
---
 tests/shaders/ssa/fs-if-def-else-break.shader_test | 30 ++
 1 file changed, 30 insertions(+)
 create mode 100644 tests/shaders/ssa/fs-if-def-else-break.shader_test

diff --git a/tests/shaders/ssa/fs-if-def-else-break.shader_test 
b/tests/shaders/ssa/fs-if-def-else-break.shader_test
new file mode 100644
index 000..c763df6
--- /dev/null
+++ b/tests/shaders/ssa/fs-if-def-else-break.shader_test
@@ -0,0 +1,30 @@
+[require]
+GLSL >= 1.10
+
+[fragment shader]
+uniform bool t, f;
+
+void main()
+{
+gl_FragColor = vec4(0, 0, 1, 1);
+do {
+int a = 1;
+if (t) {
+a = 2;
+} else {
+break;
+}
+
+if (a == 2)
+gl_FragColor = vec4(0, 1, 0, 1);
+else
+gl_FragColor = vec4(1, 0, 0, 1);
+} while (f);
+}
+
+[test]
+uniform int t 1
+uniform int f 0
+
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 1.0
-- 
2.2.0

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


[Piglit] [PATCH 0/3] Add a folder and some tests for SSA tests

2014-12-13 Thread Jason Ekstrand
This short little series adds a folder and 3 tests for problems that may
arise if your compiler translates to/from SSA form incorrectly.  The first
two are just the classic "swap" and "lost copy" problems that you can find
in any out-of-SSA paper.  The third is a strange edge-case in into-SSA
translation that Connor Abbot pointed out to me on IRC last night.

I put these tests in their own folder because, while they are just compiler
tests, they are fairly specific to SSA form.  We probably want more SSA
tests, but most of the other SSA bugs I've seen are already covered in a
reasonably minimal way by control flow that happens all the time in piglit.

Jason Ekstrand (3):
  ssa: Add a test for the classic "swap problem" in out-of-SSA
translation
  ssa: Add a test for the classic "lost copy problem" in out-of-SSA
translation
  ssa: Add a test for an edge case in into-SSA translation

 tests/shaders/ssa/fs-if-def-else-break.shader_test | 30 ++
 tests/shaders/ssa/fs-lost-copy-problem.shader_test | 23 +
 tests/shaders/ssa/fs-swap-problem.shader_test  | 19 ++
 3 files changed, 72 insertions(+)
 create mode 100644 tests/shaders/ssa/fs-if-def-else-break.shader_test
 create mode 100644 tests/shaders/ssa/fs-lost-copy-problem.shader_test
 create mode 100644 tests/shaders/ssa/fs-swap-problem.shader_test

-- 
2.2.0

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


Re: [Piglit] refactor and optimize OpenGL test generators

2014-11-12 Thread Jason Ekstrand
What did you do (besides verifying that the tests pass) to ensure that the
generated result is equivalent to the previous generator?  Have you
verified that they generate basically the same code?

On Wed, Nov 12, 2014 at 3:45 PM, Dylan Baker 
wrote:

> This rather lengthy series takes a strong stab at cleaning up the python
> generators, particularly the OpenGL generators, with the exception of
> the generators that rely on the builtin_function.py and
> builtin_funciton_fp64.py (I have another series underway to deal with
> those, but one thing at a time).
>
> There are 4 goals for each generator in this series:
> 1) Use mako:
>There on generator (gen_interpolation_tests) that didn't use mako
>before this series. There are also several generators that nominally
>use mako, but don't take advantage of it's features, instead relying
>on python functions and blocks when mako is better equipped to handle
>the problem itself
> 2) Make it fast:
>Mako is faster than string concatenation, but there are also some
>really stupid things going on in these generators. For example Some
>of them loop over the same very large container several times when
>they could be combined.
> 3) Make it clean:
>The style of these ranges from pretty good, to pretty bad. There is a
>lot of C-in-python code here, and a lot of use of sub-optimal
>functions, like range instead of xrange, dict.items() instead of
>dict.iteritems(), etc
> 4) Split the templates:
>This both helps with speed and cleanliness. It makes it clean because
>the templates don't clutter the python scripts, in some cases the
>templates are as long as the script itself. It also means we can use
>a module_directory, which will speed up rebuilds significantly.
>
> Finally, as a bonus, the last patch splits the generators targets for
> the generators so that the OpenGL and OpenCL generators aren't linked by
> default. This allows OpenGL developers and OpenCL developers to save
> time with generated tests they aren't going to run.
>
> Despite all of the work this ends up being a was for LOC, in 45 patches
> we gain ~100 lines.
>
> I noticed on my system ~2 second decrease for OpenGL test generation,
> and about a ~5 second decrease for OpenGL test regeneration (using
> cached templates)
>
> This is available at my github:
> https://github.com/dcbaker/piglit submit/generator-cleanups
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] arb_copy_image-formats: Initialize variable.

2014-11-07 Thread Jason Ekstrand
Sure, fine by me

Reviewed-by: Jason Ekstrand 

On Fri, Nov 7, 2014 at 3:11 PM, Vinson Lee  wrote:

> Fixes GCC maybe-uninitialized warning.
>
> formats.c:560:11: warning: 'gtype' may be used uninitialized in this
> function [-Wmaybe-uninitialized]
>snprintf(fs_src, sizeof(ms_compare_fs_source),
>^
>
> Signed-off-by: Vinson Lee 
> ---
>  tests/spec/arb_copy_image/formats.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/tests/spec/arb_copy_image/formats.c
> b/tests/spec/arb_copy_image/formats.c
> index 92715ba..8a5faa7 100644
> --- a/tests/spec/arb_copy_image/formats.c
> +++ b/tests/spec/arb_copy_image/formats.c
> @@ -551,6 +551,7 @@ load_compare_program(struct texture_format *format)
> gtype = "i";
> } else {
> assert(!"Invalid comparison fucntion");
> +   gtype = "";
> }
>
> /* The generated source will be shorter because we replace
> --
> 1.9.3
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] Restore junit_suffix functionality

2014-10-29 Thread Jason Ekstrand
Reviewed-by: Jason Ekstrand 

I also pushed it.

On Wed, Oct 29, 2014 at 12:50 PM, Mark Janes  wrote:

> b8d8cfadcc83fd09c1367821337d473d80bb6607 inadvertenty disabled the
> --junit_suffix functionality, which is needed to differentiate results
> from multiple test runs.
> ---
>  framework/backends/junit.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/framework/backends/junit.py b/framework/backends/junit.py
> index 09faea5..1c27e98 100644
> --- a/framework/backends/junit.py
> +++ b/framework/backends/junit.py
> @@ -45,9 +45,9 @@ class JUnitBackend(FileBackend):
>  """
>  _REPLACE = re.compile(r'[/\\]')
>
> -def __init__(self, dest, junit_test_suffix='', **options):
> +def __init__(self, dest, junit_suffix='', **options):
>  super(JUnitBackend, self).__init__(dest, **options)
> -self._test_suffix = junit_test_suffix
> +self._test_suffix = junit_suffix
>
>  # make dictionaries of all test names expected to crash/fail
>  # for quick lookup when writing results.  Use lower-case to
> --
> 2.1.1
>
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] teximage-colors: fix bogus precision assumptions and other issues

2014-10-13 Thread Jason Ekstrand
With the formatting fixed:
Reviewed-by: Jason Ekstrand 

On Mon, Oct 13, 2014 at 8:59 AM, Brian Paul  wrote:

> On 10/08/2014 06:00 PM, srol...@vmware.com wrote:
>
>> From: Roland Scheidegger 
>>
>> Some formats had some "implied" precision which relied on the driver
>> picking a
>> specific hw format (e.g. RGB5 and RGB5 both relied on driver picking 565).
>> These tests will now be skipped (for the exact test).
>> Others didn't have any implied precision but relied on driver picking a
>> format
>> with at least 8 bits even though the internal format only implied 4.
>> Also, the exact tests for srgb8 and srgb8_alpha8 were failing too due to
>> using
>> GL_BYTE instead of GL_UNSIGNED_BYTE.
>> With these fixes the only tests llvmpipe is failing seem to be the exact
>> GL_RGB8_SNORM and GL_RGB16_SNORM ones (1, 2 or 4 channels work and the
>> errors
>> seem to be one bit so maybe triggers some conversion somewhere using
>> different
>> signed conversion formula).
>> ---
>>   tests/texturing/teximage-colors.c | 43 ++
>> -
>>   1 file changed, 38 insertions(+), 5 deletions(-)
>>
>> diff --git a/tests/texturing/teximage-colors.c
>> b/tests/texturing/teximage-colors.c
>> index 2bee02f..dcbab65 100644
>> --- a/tests/texturing/teximage-colors.c
>> +++ b/tests/texturing/teximage-colors.c
>> @@ -60,12 +60,12 @@ struct texture_format formats[] = {
>>
>> FORMAT(GL_RGB, GL_RGB, GL_NONE),
>> FORMAT(GL_R3_G3_B2, GL_RGB, GL_UNSIGNED_BYTE_3_3_2),
>> -   FORMAT(GL_RGB4, GL_RGB, GL_UNSIGNED_SHORT_5_6_5),
>> -   FORMAT(GL_RGB5, GL_RGB, GL_UNSIGNED_SHORT_5_6_5),
>> +   FORMAT(GL_RGB4, GL_RGB, GL_NONE),
>> +   FORMAT(GL_RGB5, GL_RGB, GL_NONE),
>> FORMAT(GL_RGB8, GL_RGB, GL_UNSIGNED_BYTE),
>> FORMAT(GL_RGB8_SNORM, GL_RGB, GL_BYTE),
>> -   FORMAT(GL_SRGB8, GL_RGB, GL_BYTE),
>> -   FORMAT(GL_RGB10, GL_RGB, GL_UNSIGNED_SHORT),
>> +   FORMAT(GL_SRGB8, GL_RGB, GL_UNSIGNED_BYTE),
>> +   FORMAT(GL_RGB10, GL_RGB, GL_NONE),
>> FORMAT(GL_R11F_G11F_B10F, GL_RGB, GL_NONE),
>> FORMAT(GL_RGB12, GL_RGB, GL_NONE),
>> FORMAT(GL_RGB9_E5, GL_RGB, GL_NONE),
>> @@ -81,7 +81,7 @@ struct texture_format formats[] = {
>> FORMAT(GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE),
>> FORMAT(GL_RGB10_A2, GL_RGBA, GL_UNSIGNED_INT_10_10_10_2),
>> FORMAT(GL_RGBA8_SNORM, GL_RGBA, GL_BYTE),
>> -   FORMAT(GL_SRGB8_ALPHA8, GL_RGBA, GL_BYTE),
>> +   FORMAT(GL_SRGB8_ALPHA8, GL_RGBA, GL_UNSIGNED_BYTE),
>> FORMAT(GL_RGBA12, GL_RGBA, GL_NONE),
>> FORMAT(GL_RGBA16, GL_RGBA, GL_UNSIGNED_SHORT),
>> FORMAT(GL_RGBA16_SNORM, GL_RGBA, GL_SHORT),
>> @@ -543,6 +543,39 @@ piglit_init(int argc, char **argv)
>> tolerance[3] = 0.3;
>> break;
>> }
>> +
>> +   /* The tolerance lowering above only works for formats which have
>> +   explicit data types associated with them and even then it's
>> fishy
>> +   for some.
>> +   The default sort of assumes at least 7 bits which doesn't make
>> +  much sense in any case (for the specific formats with more
>> bits).
>> +  But just fix the cases which cannot pass (unless the driver
>> encodes
>> +  them with more bits). */
>>
>
> The comment is indented with a mix of spaces and tabs.  For block
> comments, we usually prefix each line with '*'.
>
>
>  +   switch (format->internal_format) {
>> +   case GL_RGB4:
>> +   tolerance[0] = 0.1;
>> +   tolerance[1] = 0.1;
>> +   tolerance[2] = 0.1;
>> +   tolerance[3] = 0.1;
>> +   break;
>> +   case GL_RGB5:
>> +   tolerance[0] = 0.05;
>> +   tolerance[1] = 0.05;
>> +   tolerance[2] = 0.05;
>> +   break;
>> +   case GL_LUMINANCE4_ALPHA4:
>> +   tolerance[0] = 0.1;
>> +   tolerance[1] = 0.1;
>> +   tolerance[2] = 0.1;
>> +   tolerance[3] = 0.1;
>> +   break;
>> +case GL_LUMINANCE6_ALPHA2: /* broken but everybody uses 8+8 bits
>> */
>> +case GL_LUMINANCE4: /* broken but presumably noone uses just 4
>> bits */
>> +   case GL_ALPHA4: /* broken but presumably noone uses just 4 bits */
>> +   case GL_RGBA2: /* broken () but everybody uses more bits
>> anyway */
>>
>
> Need some tab indents there too.
>
>
>  +   default:
>> +   break;
>> +   }
>>   }
>>
>>   void
>>
>>
> Looks OK otherwise.
> Reviewed-by: Brian Paul 
>
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [RFC] Piglit tags/releases

2014-09-29 Thread Jason Ekstrand
On Mon, Sep 29, 2014 at 8:14 PM, Jordan Justen  wrote:

> On Mon, Sep 29, 2014 at 7:39 PM, Matt Turner  wrote:
> > On Mon, Sep 29, 2014 at 6:45 PM, Jordan Justen 
> wrote:
> >> On Mon, Sep 29, 2014 at 5:01 PM, Matt Turner 
> wrote:
> >>> On Mon, Sep 29, 2014 at 4:52 PM, Jordan Justen 
> wrote:
>  Anyway, I discussed it with Ian around Mesa 10.2. While I don't think
>  he was excited about it, he also did not express any reasons for not
>  doing it. Basically, we were going to look at it again around Mesa
>  10.3 release time.
> >>>
> >>> How about some reasons to actually do it? I still haven't figured out
> >>> what you're trying to accomplish.
> >>
> >> I'm planning to create a debian piglit package. (Well, it's basically
> >> created at this point.)
> >
> > But to what end? Why is packaging snapshots of an always changing
> > developer test suite useful?
>
> 1. I've wanted to just install (without building) piglit a couple of
> times within the past year. In these cases, I just wanted to run
> shader_runner on a single shader_test.
>
> 2. apt-get build-dep piglit will install the build dependencies for
> building piglit from master.
>

I'll admit that I find this second one useful.  Fedora has piglit packaged
and, while piglit packages are kind of uesless, yum-builddep on piglit
isn't.  It's a pitty they don't do it as a deps-only package.  In general,
I've got to agree with Matt that I don't see a point in doing releases for
a test suite.
--Jason
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 2/2] draw-pixels: update BYTE_TO_FLOAT() macro to match Mesa

2014-09-25 Thread Jason Ekstrand
Yeah, I'm OK with this too.  At some point it would be good to put a lite
effort into making both formulas valid so that piglit works on both legacy
and post 3.2 contexts.  But that's more of a to do list item than a comment
on this patch.
--Jason
On Sep 25, 2014 3:21 PM, "Brian Paul"  wrote:

> On 09/25/2014 03:56 PM, Anuj Phogat wrote:
>
>> On Thu, Sep 25, 2014 at 6:52 AM, Brian Paul  wrote:
>>
>>> Use Mesa's UBYTE_TO_FLOAT_TEX() arithmetic.  This lets Mesa pass the
>>>
>> I think you mean BYTE_TO_FLOAT_TEX() here.
>>
>
> Yes, thanks.  I'll fix that.
>
>
>
>>  test.  No regression with nvidia's driver either.
>>> ---
>>>   tests/general/draw-pixels.c |2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/tests/general/draw-pixels.c b/tests/general/draw-pixels.c
>>> index 27b1675..65f5122 100644
>>> --- a/tests/general/draw-pixels.c
>>> +++ b/tests/general/draw-pixels.c
>>> @@ -37,7 +37,7 @@
>>>   #define UBYTE_TO_FLOAT(u) ((float) u / 255.0F)
>>>
>>>   /** Convert GLbyte in [-128,127] to GLfloat in [-1.0,1.0] */
>>> -#define BYTE_TO_FLOAT(B)((2.0F * (B) + 1.0F) * (1.0F/255.0F))
>>> +#define BYTE_TO_FLOAT(B)((B) == -128 ? -1.0F : (B) * (1.0F/127.0F))
>>>
>>>   /** Convert GLushort in [0,65535] to GLfloat in [0.0,1.0] */
>>>   #define USHORT_TO_FLOAT(S)  ((GLfloat) (S) * (1.0F / 65535.0F))
>>> --
>>> 1.7.10.4
>>>
>>> ___
>>> Piglit mailing list
>>> Piglit@lists.freedesktop.org
>>> https://urldefense.proofpoint.com/v1/url?u=http://lists.
>>> freedesktop.org/mailman/listinfo/piglit&k=oIvRg1%
>>> 2BdGAgOoM1BIlLLqw%3D%3D%0A&r=lGQMzzTgII0I7jefp2FHq7WtZ%
>>> 2BTLs8wadB%2BiIj9xpBY%3D%0A&m=ohKLzWSFy4um%
>>> 2FbQz3pESy2HCK32TcqIlTx2AShS5cEk%3D%0A&s=d3673b4789b125e183860b156956ea
>>> 907d63e764103fff30ea8f48fee26dae0d
>>>
>>
>> Both patches are:
>> Reviewed-by: Anuj Phogat 
>>
>>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] arb_copy_image: Skip if sample count is not supported

2014-09-19 Thread Jason Ekstrand
Reviewed-by: Jason Ekstrand 

On Fri, Sep 19, 2014 at 2:45 PM, Chris Forbes  wrote:

> Signed-off-by: Chris Forbes 
> ---
>  tests/spec/arb_copy_image/formats.c | 8 
>  1 file changed, 8 insertions(+)
>
> diff --git a/tests/spec/arb_copy_image/formats.c
> b/tests/spec/arb_copy_image/formats.c
> index a58580d..92715ba 100644
> --- a/tests/spec/arb_copy_image/formats.c
> +++ b/tests/spec/arb_copy_image/formats.c
> @@ -303,8 +303,16 @@ piglit_init(int argc, char **argv)
> piglit_require_extension("GL_EXT_framebuffer_object");
> piglit_require_extension("GL_EXT_texture_integer");
> if (samples > 1) {
> +   int max_samples;
> +
> piglit_require_extension("GL_ARB_texture_multisample");
> piglit_require_extension("GL_ARB_sample_shading");
> +
> +   glGetIntegerv(GL_MAX_SAMPLES, &max_samples);
> +   if (samples > max_samples) {
> +   printf("%d samples not supported\n", samples);
> +   piglit_report_result(PIGLIT_SKIP);
> +   }
> }
>
> if (argc > 1) {
> --
> 1.8.5.3
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [Mesa-dev] [PATCH v2 08/13] mesa/format_utils: Add a general format conversion function

2014-09-12 Thread Jason Ekstrand
Forgot to reply-all
On Sep 12, 2014 9:05 AM, "Jason Ekstrand"  wrote:

> The teximage-colors test that I pushed to piglit a week or two ago takes a
> --benchmark flag that bumps the texture size and does the upload 1000 times
> and gives you the average time to upload.
> --Jason
> On Sep 12, 2014 9:01 AM, "Brian Paul"  wrote:
>
>> On 09/12/2014 08:49 AM, Jason Ekstrand wrote:
>>
>>>
>>> On Sep 12, 2014 7:09 AM, "Brian Paul" >> <mailto:bri...@vmware.com>> wrote:
>>>  >
>>>  > On 09/11/2014 04:58 PM, Jason Ekstrand wrote:
>>>  >>
>>>  >>
>>>  >>
>>>  >> On Thu, Sep 11, 2014 at 3:53 PM, Dieter Nützel >> <mailto:die...@nuetzel-hh.de>
>>>  >> <mailto:die...@nuetzel-hh.de <mailto:die...@nuetzel-hh.de>>> wrote:
>>>  >>
>>>  >> Am 12.09.2014 00:31, schrieb Jason Ekstrand:
>>>  >>
>>>  >> On Thu, Sep 11, 2014 at 2:55 PM, Dieter Nützel
>>>  >> mailto:die...@nuetzel-hh.de>
>>> <mailto:die...@nuetzel-hh.de <mailto:die...@nuetzel-hh.de>>>
>>>  >>
>>>  >> wrote:
>>>  >>
>>>  >> Am 15.08.2014 04:50, schrieb Jason Ekstrand:
>>>  >>
>>>  >> On Aug 14, 2014 7:13 PM, "Dieter Nützel"
>>>  >> mailto:die...@nuetzel-hh.de>
>>> <mailto:die...@nuetzel-hh.de <mailto:die...@nuetzel-hh.de>>>
>>>  >>
>>>  >> wrote:
>>>  >>
>>>  >>
>>>  >> Am 15.08.2014 02:36, schrieb Dave Airlie:
>>>  >>
>>>  >> On 08/02/2014 02:11 PM, Jason
>>> Ekstrand
>>>  >> wrote:
>>>  >>
>>>  >>
>>>  >>
>>>  >> Most format conversion operations
>>>  >> required by GL can be
>>>  >>
>>>  >> performed by
>>>  >>
>>>  >> converting one channel at a time,
>>>  >> shuffling the channels
>>>  >>
>>>  >> around, and
>>>  >>
>>>  >> optionally filling missing
>>> channels
>>>  >> with zeros and ones.
>>>  >>
>>>  >> This
>>>  >> adds a
>>>  >>
>>>  >> function to do just that in a
>>>  >> general, yet efficient, way.
>>>  >>
>>>  >> v2:
>>>  >> * Add better comments including
>>> full
>>>  >> docs for functions
>>>  >> * Don't use __typeof__
>>>  >> * Use inline helpers instead of
>>>  >> writing out conversions
>>>  >>
>>>  >> by
>>>  >> hand,
>>>  >>
>>>  >> * Force full loop unrolling for
>>>  >> better performance
>>>  >>
>>>  >>
>>>  >>
>>>  >> This file seems to anger gcc a lot.
>>>  >>
>>>  >> It seems to take upwards of a minute or two
>>> to
>>>  >> compile here.
>>>  >>
>>>  >> gcc 4.8.3 on 32-bit x86.
>>>  >>
>>>  >> Dave.
>>>  >>
>>>  >>
>>>  >>
>>>  >> For me (on our poor little Duron 1800/2 GB) it
>>> ran ~5
>>>  >>
>>>  >> minutes...
>>>  >>
>>>  >>
>>>  >> gcc 4.8.1 on 32-bit x86.
>>>  >>
>>>  >>
>&g

[Piglit] [PATCH] teximage-colors: Don't try to do exact upload/download on 12-bit formats

2014-09-08 Thread Jason Ekstrand
Since we can't give a 12-bit input, trying to do an exact test doesn't
really make sense.
---
 tests/texturing/teximage-colors.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/texturing/teximage-colors.c 
b/tests/texturing/teximage-colors.c
index 815ef4d..712e11b 100644
--- a/tests/texturing/teximage-colors.c
+++ b/tests/texturing/teximage-colors.c
@@ -67,7 +67,7 @@ struct texture_format formats[] = {
FORMAT(GL_SRGB8, GL_RGB, GL_BYTE),
FORMAT(GL_RGB10, GL_RGB, GL_UNSIGNED_SHORT),
FORMAT(GL_R11F_G11F_B10F, GL_RGB, GL_NONE),
-   FORMAT(GL_RGB12, GL_RGB, GL_UNSIGNED_SHORT),
+   FORMAT(GL_RGB12, GL_RGB, GL_NONE),
FORMAT(GL_RGB9_E5, GL_RGB, GL_NONE),
FORMAT(GL_RGB16, GL_RGB, GL_UNSIGNED_SHORT),
FORMAT(GL_RGB16F, GL_RGB, GL_NONE),
@@ -82,7 +82,7 @@ struct texture_format formats[] = {
FORMAT(GL_RGB10_A2, GL_RGBA, GL_UNSIGNED_INT_10_10_10_2),
FORMAT(GL_RGBA8_SNORM, GL_RGBA, GL_BYTE),
FORMAT(GL_SRGB8_ALPHA8, GL_RGBA, GL_BYTE),
-   FORMAT(GL_RGBA12, GL_RGBA, GL_UNSIGNED_BYTE),
+   FORMAT(GL_RGBA12, GL_RGBA, GL_NONE),
FORMAT(GL_RGBA16, GL_RGBA, GL_UNSIGNED_SHORT),
FORMAT(GL_RGBA16_SNORM, GL_RGBA, GL_SHORT),
FORMAT(GL_RGBA32F, GL_RGBA, GL_FLOAT),
@@ -90,7 +90,7 @@ struct texture_format formats[] = {
FORMAT(GL_ALPHA, GL_ALPHA, GL_NONE),
FORMAT(GL_ALPHA4, GL_ALPHA, GL_NONE),
FORMAT(GL_ALPHA8, GL_ALPHA, GL_UNSIGNED_BYTE),
-   FORMAT(GL_ALPHA12, GL_ALPHA, GL_UNSIGNED_BYTE),
+   FORMAT(GL_ALPHA12, GL_ALPHA, GL_NONE),
FORMAT(GL_ALPHA16, GL_ALPHA, GL_UNSIGNED_SHORT),
 
FORMAT(GL_LUMINANCE, GL_LUMINANCE, GL_NONE),
-- 
2.1.0

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


Re: [Piglit] [PATCH] summary.py: Replace path separators in testrun names

2014-09-05 Thread Jason Ekstrand
Dylan,
There's one more on line 196 that you're missing.  Wrapping that one in
escape_pathname fixes it up nicely.  With that change,

Reviewed-by: Jason Ekstrand 

--Jason


On Fri, Sep 5, 2014 at 11:35 AM, Jason Ekstrand 
wrote:

> Yeah, on second thought, not quite working...  I'll poke at it a bit.
>
>
> On Thu, Sep 4, 2014 at 10:11 PM, Jason Ekstrand 
> wrote:
>
>> Thanks a bunch Dylan.  It's working great for me.
>> --Jason
>>
>>
>> On Thu, Sep 4, 2014 at 5:11 PM, Dylan Baker 
>> wrote:
>>
>>> On Friday, September 05, 2014 12:22:02 AM Emil Velikov wrote:
>>> > On 04/09/14 22:55, Dylan Baker wrote:
>>> > > On Thursday, September 04, 2014 10:49:10 PM Emil Velikov wrote:
>>> > >> On 04/09/14 21:54, Dylan Baker wrote:
>>> > >>> This solves the bug of running piglit run -n 'wip/foo' which
>>> causes a
>>> > >>> number of issues in the html summary generation.
>>> > >>>
>>> > >> From a quick look it seems that it might help with a funny issue
>>> that I'm seeing:
>>> > >>
>>> > >> Whenever piglit is ran on Windows the testname uses \\ as path
>>> separator (in
>>> > >> some cases / is also used). When trying to generate summary under
>>> Linux, the
>>> > >> script ends up generating a ton of spec\extenstion_name\test files,
>>> rather
>>> > >> than structuring everything as normal.
>>> > >
>>> > > The mixed '/' and '\\' issue is known, it's mostly due to hard
>>> coding of
>>> > > values. It's on my list (although pretty far down) of things to fix.
>>> > >
>>> > In case this makes it in time for XDC2014 there will be a nice bottle
>>> of wine
>>> > waiting for you ;-)
>>> >
>>> > -Emil
>>> >
>>>
>>> Well, I don't get travel budget, so you'll have to ship me that bottle
>>> :)
>>>
>>> ___
>>> Piglit mailing list
>>> Piglit@lists.freedesktop.org
>>> http://lists.freedesktop.org/mailman/listinfo/piglit
>>>
>>>
>>
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] summary.py: Replace path separators in testrun names

2014-09-05 Thread Jason Ekstrand
Yeah, on second thought, not quite working...  I'll poke at it a bit.


On Thu, Sep 4, 2014 at 10:11 PM, Jason Ekstrand 
wrote:

> Thanks a bunch Dylan.  It's working great for me.
> --Jason
>
>
> On Thu, Sep 4, 2014 at 5:11 PM, Dylan Baker 
> wrote:
>
>> On Friday, September 05, 2014 12:22:02 AM Emil Velikov wrote:
>> > On 04/09/14 22:55, Dylan Baker wrote:
>> > > On Thursday, September 04, 2014 10:49:10 PM Emil Velikov wrote:
>> > >> On 04/09/14 21:54, Dylan Baker wrote:
>> > >>> This solves the bug of running piglit run -n 'wip/foo' which causes
>> a
>> > >>> number of issues in the html summary generation.
>> > >>>
>> > >> From a quick look it seems that it might help with a funny issue
>> that I'm seeing:
>> > >>
>> > >> Whenever piglit is ran on Windows the testname uses \\ as path
>> separator (in
>> > >> some cases / is also used). When trying to generate summary under
>> Linux, the
>> > >> script ends up generating a ton of spec\extenstion_name\test files,
>> rather
>> > >> than structuring everything as normal.
>> > >
>> > > The mixed '/' and '\\' issue is known, it's mostly due to hard coding
>> of
>> > > values. It's on my list (although pretty far down) of things to fix.
>> > >
>> > In case this makes it in time for XDC2014 there will be a nice bottle
>> of wine
>> > waiting for you ;-)
>> >
>> > -Emil
>> >
>>
>> Well, I don't get travel budget, so you'll have to ship me that bottle
>> :)
>>
>> ___
>> Piglit mailing list
>> Piglit@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/piglit
>>
>>
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] summary.py: Replace path separators in testrun names

2014-09-04 Thread Jason Ekstrand
Thanks a bunch Dylan.  It's working great for me.
--Jason


On Thu, Sep 4, 2014 at 5:11 PM, Dylan Baker  wrote:

> On Friday, September 05, 2014 12:22:02 AM Emil Velikov wrote:
> > On 04/09/14 22:55, Dylan Baker wrote:
> > > On Thursday, September 04, 2014 10:49:10 PM Emil Velikov wrote:
> > >> On 04/09/14 21:54, Dylan Baker wrote:
> > >>> This solves the bug of running piglit run -n 'wip/foo' which causes a
> > >>> number of issues in the html summary generation.
> > >>>
> > >> From a quick look it seems that it might help with a funny issue that
> I'm seeing:
> > >>
> > >> Whenever piglit is ran on Windows the testname uses \\ as path
> separator (in
> > >> some cases / is also used). When trying to generate summary under
> Linux, the
> > >> script ends up generating a ton of spec\extenstion_name\test files,
> rather
> > >> than structuring everything as normal.
> > >
> > > The mixed '/' and '\\' issue is known, it's mostly due to hard coding
> of
> > > values. It's on my list (although pretty far down) of things to fix.
> > >
> > In case this makes it in time for XDC2014 there will be a nice bottle of
> wine
> > waiting for you ;-)
> >
> > -Emil
> >
>
> Well, I don't get travel budget, so you'll have to ship me that bottle
> :)
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
>
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] arb_texture_view-sampling-2d-array-as-cubemap: Probe the correct rectangle

2014-09-04 Thread Jason Ekstrand
Yup, thanks.  I missed that in my slightly old piglit checkout
--Jason


On Thu, Sep 4, 2014 at 3:54 PM, Ilia Mirkin  wrote:

> I believe ChrisF already fixed that in 25a322ccfd ("arb_texture_view:
> Fix bogus probe rects"). Or am I missing something?
>
> On Thu, Sep 4, 2014 at 6:43 PM, Jason Ekstrand 
> wrote:
> > Signed-off-by: Jason Ekstrand 
> > Cc: Ilia Mirkin 
> >
> > ---
> >  tests/spec/arb_texture_view/sampling-2d-array-as-cubemap.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/tests/spec/arb_texture_view/sampling-2d-array-as-cubemap.c
> b/tests/spec/arb_texture_view/sampling-2d-array-as-cubemap.c
> > index 2366d0c..987c797 100644
> > --- a/tests/spec/arb_texture_view/sampling-2d-array-as-cubemap.c
> > +++ b/tests/spec/arb_texture_view/sampling-2d-array-as-cubemap.c
> > @@ -52,7 +52,7 @@ piglit_display(void)
> >
> > piglit_draw_rect(-1, -1, 2, 2);
> >
> > -   pass = piglit_probe_rect_rgba(-1, -1, 2, 2, green);
> > +   pass = piglit_probe_rect_rgba(0, 0, piglit_width, piglit_height,
> green);
> >
> > piglit_present_results();
> >
> > --
> > 2.1.0
> >
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] arb_texture_view-sampling-2d-array-as-cubemap: Probe the correct rectangle

2014-09-04 Thread Jason Ekstrand
Signed-off-by: Jason Ekstrand 
Cc: Ilia Mirkin 

---
 tests/spec/arb_texture_view/sampling-2d-array-as-cubemap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/spec/arb_texture_view/sampling-2d-array-as-cubemap.c 
b/tests/spec/arb_texture_view/sampling-2d-array-as-cubemap.c
index 2366d0c..987c797 100644
--- a/tests/spec/arb_texture_view/sampling-2d-array-as-cubemap.c
+++ b/tests/spec/arb_texture_view/sampling-2d-array-as-cubemap.c
@@ -52,7 +52,7 @@ piglit_display(void)
 
piglit_draw_rect(-1, -1, 2, 2);
 
-   pass = piglit_probe_rect_rgba(-1, -1, 2, 2, green);
+   pass = piglit_probe_rect_rgba(0, 0, piglit_width, piglit_height, green);
 
piglit_present_results();
 
-- 
2.1.0

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


[Piglit] [PATCH] spec/ARB_copy_image: Exercise different mipmap levels in the formats test

2014-09-03 Thread Jason Ekstrand
Previously, we only ever worked on level 0.  Now we work on levels 1 and 3
so that cross-level copying gets tested.
---
 tests/spec/arb_copy_image/formats.c | 92 -
 1 file changed, 61 insertions(+), 31 deletions(-)

diff --git a/tests/spec/arb_copy_image/formats.c 
b/tests/spec/arb_copy_image/formats.c
index 5b07a1e..ae56b4f 100644
--- a/tests/spec/arb_copy_image/formats.c
+++ b/tests/spec/arb_copy_image/formats.c
@@ -33,6 +33,8 @@
 #include "piglit-util-gl.h"
 
 #define TEX_SIZE 32
+#define DEFAULT_SRC_LEVEL 1
+#define DEFAULT_DST_LEVEL 3
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
@@ -476,8 +478,7 @@ const char ms_compare_fs_source[] =
 "  ivec2 tex_px = ivec2(tex_coords * tex_size);\n"
 "  for (int i = 0; i < samples; ++i) {\n"
 "  %svec4 val1 = texelFetch(tex1, tex_px, i);\n"
-"  %svec4 val2 = texelFetch(tex2, tex_px, i);\n"
-"  if (val1 == val2)\n"
+"  %svec4 val2 = texelFetch(tex2, tex_px, i);\n" " if 
(val1 == val2)\n"
 "  ++count;\n"
 "  }\n"
 "  gl_FragColor = mix(red, green, float(count) / float(samples));\n"
@@ -683,8 +684,8 @@ run_multisample_test(struct texture_format *src_format,
 }
 
 static bool
-check_texture(GLuint texture, const struct texture_format *format,
- const unsigned char *data)
+check_texture(GLuint texture, unsigned level,
+ const struct texture_format *format, const unsigned char *data)
 {
int i, j, k;
bool pass = true;
@@ -696,9 +697,9 @@ check_texture(GLuint texture, const struct texture_format 
*format,
glBindTexture(GL_TEXTURE_2D, texture);
if (format->block_width != 1 || format->block_height != 1) {
/* Compressed */
-   glGetCompressedTexImage(GL_TEXTURE_2D, 0, tex_data);
+   glGetCompressedTexImage(GL_TEXTURE_2D, level, tex_data);
} else {
-   glGetTexImage(GL_TEXTURE_2D, 0, format->format,
+   glGetTexImage(GL_TEXTURE_2D, level, format->format,
  format->data_type, tex_data);
}
 
@@ -737,6 +738,7 @@ run_test(struct texture_format *src_format, struct 
texture_format *dst_format)
 {
bool pass = true, warn = false;
unsigned src_width, src_height, dst_width, dst_height;
+   unsigned src_level, dst_level;
GLuint texture[2];
 
glEnable(GL_TEXTURE_2D);
@@ -747,61 +749,89 @@ run_test(struct texture_format *src_format, struct 
texture_format *dst_format)
src_height = TEX_SIZE * src_format->block_height;
 
glBindTexture(GL_TEXTURE_2D, texture[0]);
-   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
-   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-   if (src_format->block_width != 1 || src_format->block_height != 1) {
-   /* Compressed */
-   glCompressedTexImage2D(GL_TEXTURE_2D, 0,
-  src_format->internal_format,
-  src_width, src_height, 0,
-  TEX_SIZE * TEX_SIZE * src_format->bytes,
-  src_data);
+   if (src_format->can_be_reinterpreted) {
+   src_level = DEFAULT_SRC_LEVEL;
+   glTexStorage2D(GL_TEXTURE_2D, src_level + 2,
+  src_format->internal_format,
+  src_width << src_level, src_height << src_level);
+   if (src_format->block_width != 1 ||
+   src_format->block_height != 1) {
+   /* Compressed */
+   glCompressedTexSubImage2D(GL_TEXTURE_2D, src_level,
+ 0, 0, 
+ src_width, src_height,
+ src_format->internal_format,
+ TEX_SIZE * TEX_SIZE * 
src_format->bytes,
+ src_data);
+   } else {
+   glTexSubImage2D(GL_TEXTURE_2D, src_level, 0, 0,
+src_width, src_height, src_format->format,
+src_format->data_type, src_data);
+   }
} else {
+   src_level = 0;
+   /* All non-reintepritable textures are uncompressed */
glTexImage2D(GL_TEXTURE_2D, 0, src_format->internal_format,
 src_width, src_height, 0, src_format->format,
 src_format->data_type, src_data);
}
+   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
pass &= piglit_check_gl_error(GL_NO_ERROR);
if (!pass) goto cleanup;
-   warn |= !check_texture(texture[0], sr

Re: [Piglit] [PATCH] results.py: Do not allow path separators in test names

2014-09-01 Thread Jason Ekstrand
On Sat, Aug 30, 2014 at 4:20 PM, Dylan Baker 
wrote:

> This causes problems in the html summary generator, since os.mkdir
> doesn't understand that it's a string not a full path (and the
> underlying file system probably can't understand that either). Instead
> of raising an error we silently replace any illegal characters with an
> underscore.
>
> Signed-off-by: Dylan Baker 
> ---
>  framework/results.py | 21 -
>  framework/tests/results_tests.py | 16 
>  2 files changed, 36 insertions(+), 1 deletion(-)
>
> diff --git a/framework/results.py b/framework/results.py
> index efc7029..c89b39c 100644
> --- a/framework/results.py
> +++ b/framework/results.py
> @@ -305,7 +305,7 @@ class TestrunResult(object):
>  'lspci',
>  'results_version',
>  'time_elapsed']
> -self.name = None
> +self.__name = None
>  self.uname = None
>  self.options = None
>  self.glxinfo = None
> @@ -406,6 +406,25 @@ class TestrunResult(object):
> if k in self.serialized_keys),
>f, default=_piglit_encoder,
> indent=JSONWriter.INDENT)
>
> +@property
> +def name(self):
> +return self.__name
> +
> +@name.setter
> +def name(self, name):
> +""" Set the name of the test run
> +
> +We don't allow path seperators in the name, they are silently
> replaced
> +with underscores.
> +
> +"""
> +replace = ['/', '\\']
> +
> +for r in replace:
> +name = name.replace(r, '_')
> +
> +self.__name = name
> +
>

Personally, I'd rather we mangle things when we turn them into file names
rather than mangling the original.  This way the original string still
shows up in table headers etc.  That said, this also accomplishes the
objective of not crashing in stupid places.
--Jason


>
>  def load_results(filename):
>  """ Loader function for TestrunResult class
> diff --git a/framework/tests/results_tests.py
> b/framework/tests/results_tests.py
> index 54661cc..02438cf 100644
> --- a/framework/tests/results_tests.py
> +++ b/framework/tests/results_tests.py
> @@ -159,3 +159,19 @@ def test_update_results_old():
>  res = results.update_results(base, f.name)
>
>  nt.assert_equal(res.results_version, results.CURRENT_JSON_VERSION)
> +
> +
> +@utils.nose_generator
> +def test_testrunresult_set_name():
> +""" Generate tests for the name setter """
> +emsg = '"{}" should have been replaced but was not'
> +
> +def test(value, expected, message):
> +""" The actual test """
> +t = results.TestrunResult()
> +t.name = value
> +nt.assert_equal(t.name, expected, msg=message)
> +
> +for x in ['/', '\\']:
> +test.description = 'TestrunResult.name replaces "{}" with
> "_"'.format(x)
> +yield test, 'a{}name'.format(x), 'a_name', emsg.format(x)
> --
> 2.1.0
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] framework: Use os.mkdirs instead of os.mkdir for summary subfolders

2014-08-30 Thread Jason Ekstrand
On Aug 30, 2014 3:23 PM, "Dylan Baker"  wrote:
>
> I'll need to think about it and read the code to be sure, I think that
> using '/' in test run names may cause some strange behavior in the html
> pages because of assumptions. There's also the windows '\\' issue to
> think about.

Yeah, just letting paths be paths is probably not the solution.  Does
python provide a nice way to sanatize names for this sort of thing?  I'm
not a fan of adding silly restrictions to things that are otherwise
arbitrary strings.  Let me know what you think.

If I have to, I can munge things in my shell script before passing the name
to piglit but then they're munged in the table labels in the HTML.
--Jason

> But, either way you need to put makedirs in a try/except block
> try:
> os.makedirs(...)
> except OSError:
> pass

Yup

> On Saturday, August 30, 2014 11:49:51 AM Jason Ekstrand wrote:
> > This way test names can contain "/" characters.  I to name tests after
git
> > branches and I tend to have git branches named wip/whatever.  This
prevents
> > piglit from crashing.
> > ---
> >  framework/summary.py | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/framework/summary.py b/framework/summary.py
> > index 332aa40..1815dc7 100644
> > --- a/framework/summary.py
> > +++ b/framework/summary.py
> > @@ -454,7 +454,7 @@ class Summary:
> >
> >  # Iterate across the tests creating the various test specific
files
> >  for each in self.results:
> > -os.mkdir(path.join(destination, each.name))
> > +os.makedirs(path.join(destination, each.name))
> >
> >  if each.time_elapsed is not None:
> >  time = datetime.timedelta(0, each.time_elapsed)
> > --
> > 2.1.0
> >
> > ___
> > Piglit mailing list
> > Piglit@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/piglit
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 1/1] cl: Merge tests with the same name.

2014-08-30 Thread Jason Ekstrand
On Aug 30, 2014 12:27 PM, "Jan Vesely"  wrote:
>
> On Fri, 2014-08-01 at 16:24 -0400, Jan Vesely wrote:
> > This fixes hidden failures where summary would report the result
> > of the last test with given name.
> >
> > Signed-off-by: Jan Vesely 
> > ---
> >
> > I saw 3 ways to deal with the problem of tests having the same name:
> > a) Merge the tests
> > b) Add index to every test
> > c) add support for same named tests to summary
>
> ping. any comments ?

I'd go for fixing the duplicates and then making it just fail in all.py if
there are *any* duplicate names.  That way it's impossible to add a
duplicate name and have piglit run at all.

--Jason Ekstrand

>
> >
> > This patch implements a), it introduces 9 regressions on Intel OCL SDK
all
> > of which are previously hidden fails. No changes on r600.
> >
> > I don't really use python, so I went for least invasive changes with
ugly/non-efficient code as a side-effect. Comments welcome.
> >
> > Jan
> >
> >
> >  generated_tests/genclbuiltins.py | 63

> >  1 file changed, 32 insertions(+), 31 deletions(-)
> >
> > diff --git a/generated_tests/genclbuiltins.py
b/generated_tests/genclbuiltins.py
> > index cdef80b..4a574b8 100644
> > --- a/generated_tests/genclbuiltins.py
> > +++ b/generated_tests/genclbuiltins.py
> > @@ -113,10 +113,10 @@ def gen_kernel(f, fnName, inTypes, outType,
vecSizes, typePrefix):
> >
> >  suffix = ';'
> >  if (vecSizes[0] == 1):
> > -f.write('  *out = ')
> > +f.write('  out[get_global_id(0)] = ')
> >  else:
> >  f.write('  vstore'+str(vecSizes[0])+'(')
> > -suffix = ', 0, out)' + suffix
> > +suffix = ', get_global_id(0), out)' + suffix
> >
> >  f.write(fnName+'(')
> >  suffix = ')' + suffix
> > @@ -126,9 +126,9 @@ def gen_kernel(f, fnName, inTypes, outType,
vecSizes, typePrefix):
> >  f.write(', ')
> >  # if scalar, don't print vload/vstore
> >  if (vecSizes[arg] == 1):
> > -f.write('*in'+str(arg))
> > +f.write('in'+str(arg)+'[get_global_id(0)]')
> >  else:
> > -f.write('vload'+str(vecSizes[arg])+'(0, in'+str(arg)+')')
> > +f.write('vload'+str(vecSizes[arg])+'(get_global_id(0),
in'+str(arg)+')')
> >
> >  f.write(suffix+'\n}\n\n')
> >
> > @@ -247,16 +247,19 @@ def getValue(type, val, isVector):
> >
> >  # Evaluate the value of the requested function and arguments
> >  # TODO: Change to varargs calls after unshifting the first
list element
> > -if (len(val) == 2):
> > -return (val[0])(getValue(type, val[1], isVector))
> > -elif (len(val) == 3):
> > -return (val[0])(getValue(type, val[1], isVector),
getValue(type, val[2], isVector))
> > -elif (len(val) == 4):
> > -return (val[0])(getValue(type, val[1], isVector),
getValue(type, val[2], isVector),
> > +if (callable(val[0])):
> > +if (len(val) == 2):
> > +return (val[0])(getValue(type, val[1], isVector))
> > +elif (len(val) == 3):
> > +return (val[0])(getValue(type, val[1], isVector),
getValue(type, val[2], isVector))
> > +elif (len(val) == 4):
> > +return (val[0])(getValue(type, val[1], isVector),
getValue(type, val[2], isVector),
> >  getValue(type, val[3], isVector))
> > -else:
> > -return (val[0])(getValue(type, val[1], isVector),
getValue(type, val[2], isVector),
> > +else:
> > +return (val[0])(getValue(type, val[1], isVector),
getValue(type, val[2], isVector),
> >  getValue(type, val[3], isVector),
getValue(type, val[4], isVector))
> > +else:
> > + return map(lambda x: getValue(type, x, isVector), val);
> >
> >  # At this point, we should have been passed a number
> >  if (isinstance(val, (int, long, float))):
> > @@ -267,7 +270,7 @@ def getValue(type, val, isVector):
> >
> >
> >  def getStrVal(type, val, isVector):
> > -return str(getValue(type, val, isVector))
> > +return " ".join(map(str, getValue(type, val, isVector)))
> >
> >
>

Re: [Piglit] [PATCH] framework: Use os.mkdirs instead of os.mkdir for summary subfolders

2014-08-30 Thread Jason Ekstrand
Sorry, I should have been more clear by "test name".  I mean the name for
the entire run; i.e., "piglit run -n 'wip/whatever' quick.py
results_folder".  We should do something intelligent here rather than crash
when generating the summary.  If we don't like directories, we could mangle
names instead ('../foo' would also be a problem).
--Jason
On Aug 30, 2014 1:04 PM, "Matt Turner"  wrote:

> Let's just not put / in test names instead?
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] framework: Use os.mkdirs instead of os.mkdir for summary subfolders

2014-08-30 Thread Jason Ekstrand
This way test names can contain "/" characters.  I to name tests after git
branches and I tend to have git branches named wip/whatever.  This prevents
piglit from crashing.
---
 framework/summary.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/framework/summary.py b/framework/summary.py
index 332aa40..1815dc7 100644
--- a/framework/summary.py
+++ b/framework/summary.py
@@ -454,7 +454,7 @@ class Summary:
 
 # Iterate across the tests creating the various test specific files
 for each in self.results:
-os.mkdir(path.join(destination, each.name))
+os.makedirs(path.join(destination, each.name))
 
 if each.time_elapsed is not None:
 time = datetime.timedelta(0, each.time_elapsed)
-- 
2.1.0

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


Re: [Piglit] [PATCH] Add a basic teximage color conversion test

2014-08-22 Thread Jason Ekstrand
I've had this one kicking around my personal repo for a while.  It's nicer
than the equivalent glean test (but doesn't cover quite as much) and is
also useful for benchmarking texture uploads.


On Fri, Aug 22, 2014 at 1:00 PM, Jason Ekstrand 
wrote:

> ---
>  tests/all.py  |  29 ++
>  tests/texturing/CMakeLists.gl.txt |   1 +
>  tests/texturing/teximage-colors.c | 872
> ++
>  3 files changed, 902 insertions(+)
>  create mode 100644 tests/texturing/teximage-colors.c
>
> diff --git a/tests/all.py b/tests/all.py
> index 17d5d9b..5670928 100644
> --- a/tests/all.py
> +++ b/tests/all.py
> @@ -797,6 +797,35 @@ add_concurrent_test(gl11,
> 'triangle-guardband-viewport')
>  add_concurrent_test(gl11, 'getteximage-targets 1D')
>  add_concurrent_test(gl11, 'getteximage-targets 2D')
>
> +color_formats = [
> +   'GL_RED', 'GL_R8', 'GL_R8_SNORM', 'GL_R16', 'GL_R16_SNORM',
> +   'GL_R16F', 'GL_R32F',
> +
> +   'GL_RG', 'GL_RG8', 'GL_RG8_SNORM', 'GL_RG16', 'GL_RG16_SNORM',
> +   'GL_RG16F', 'GL_RG32F',
> +
> +   'GL_RGB', 'GL_R3_G3_B2', 'GL_RGB4', 'GL_RGB5', 'GL_RGB8',
> +   'GL_RGB8_SNORM', 'GL_SRGB8', 'GL_RGB10', 'GL_R11F_G11F_B10F',
> +   'GL_RGB12', 'GL_RGB9_E5', 'GL_RGB16', 'GL_RGB16F',
> +   'GL_RGB16_SNORM', 'GL_RGB32F',
> +
> +   'GL_RGBA', 'GL_RGBA2', 'GL_RGBA4', 'GL_RGB5_A1', 'GL_RGBA8',
> +   'GL_RGB10_A2', 'GL_RGBA8_SNORM', 'GL_SRGB8_ALPHA8', 'GL_RGBA12',
> +   'GL_RGBA16', 'GL_RGBA16_SNORM', 'GL_RGBA32F',
> +
> +   'GL_ALPHA', 'GL_ALPHA4', 'GL_ALPHA8', 'GL_ALPHA12', 'GL_ALPHA16',
> +
> +   'GL_LUMINANCE', 'GL_LUMINANCE4', 'GL_LUMINANCE8', 'GL_SLUMINANCE8',
> +   'GL_LUMINANCE12', 'GL_LUMINANCE16',
> +
> +   'GL_LUMINANCE_ALPHA', 'GL_LUMINANCE4_ALPHA4',
> +   'GL_LUMINANCE6_ALPHA2', 'GL_LUMINANCE8_ALPHA8',
> +   'GL_SLUMINANCE8_ALPHA8', 'GL_LUMINANCE12_ALPHA4',
> +   'GL_LUMINANCE12_ALPHA12', 'GL_LUMINANCE16_ALPHA16',
> +]
> +for format in color_formats:
> +   add_concurrent_test(gl11, 'teximage-colors ' + format)
> +
>  gl10 = {}
>  spec['!OpenGL 1.0'] = gl10
>  add_concurrent_test(gl10, 'gl-1.0-beginend-coverage')
> diff --git a/tests/texturing/CMakeLists.gl.txt
> b/tests/texturing/CMakeLists.gl.txt
> index b121163..7d8d512 100644
> --- a/tests/texturing/CMakeLists.gl.txt
> +++ b/tests/texturing/CMakeLists.gl.txt
> @@ -87,5 +87,6 @@ ENDIF (UNIX)
>  piglit_add_executable (texsubimage texsubimage.c)
>  piglit_add_executable (texture-al texture-al.c)
>  piglit_add_executable (texture-rg texture-rg.c)
> +piglit_add_executable (teximage-colors teximage-colors.c)
>
>  # vim: ft=cmake:
> diff --git a/tests/texturing/teximage-colors.c
> b/tests/texturing/teximage-colors.c
> new file mode 100644
> index 000..c68bddd
> --- /dev/null
> +++ b/tests/texturing/teximage-colors.c
> @@ -0,0 +1,872 @@
> +/*
> + * Copyright 2014 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the
> "Software"),
> + * to deal in the Software without restriction, including without
> limitation
> + * the rights to use, copy, modify, merge, publish, distribute,
> sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the
> next
> + * paragraph) shall be included in all copies or substantial portions of
> the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
> MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT
> SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
> OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT O

[Piglit] [PATCH] Add a basic teximage color conversion test

2014-08-22 Thread Jason Ekstrand
---
 tests/all.py  |  29 ++
 tests/texturing/CMakeLists.gl.txt |   1 +
 tests/texturing/teximage-colors.c | 872 ++
 3 files changed, 902 insertions(+)
 create mode 100644 tests/texturing/teximage-colors.c

diff --git a/tests/all.py b/tests/all.py
index 17d5d9b..5670928 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -797,6 +797,35 @@ add_concurrent_test(gl11, 'triangle-guardband-viewport')
 add_concurrent_test(gl11, 'getteximage-targets 1D')
 add_concurrent_test(gl11, 'getteximage-targets 2D')
 
+color_formats = [
+   'GL_RED', 'GL_R8', 'GL_R8_SNORM', 'GL_R16', 'GL_R16_SNORM',
+   'GL_R16F', 'GL_R32F',
+
+   'GL_RG', 'GL_RG8', 'GL_RG8_SNORM', 'GL_RG16', 'GL_RG16_SNORM',
+   'GL_RG16F', 'GL_RG32F',
+
+   'GL_RGB', 'GL_R3_G3_B2', 'GL_RGB4', 'GL_RGB5', 'GL_RGB8',
+   'GL_RGB8_SNORM', 'GL_SRGB8', 'GL_RGB10', 'GL_R11F_G11F_B10F',
+   'GL_RGB12', 'GL_RGB9_E5', 'GL_RGB16', 'GL_RGB16F',
+   'GL_RGB16_SNORM', 'GL_RGB32F',
+
+   'GL_RGBA', 'GL_RGBA2', 'GL_RGBA4', 'GL_RGB5_A1', 'GL_RGBA8',
+   'GL_RGB10_A2', 'GL_RGBA8_SNORM', 'GL_SRGB8_ALPHA8', 'GL_RGBA12',
+   'GL_RGBA16', 'GL_RGBA16_SNORM', 'GL_RGBA32F',
+
+   'GL_ALPHA', 'GL_ALPHA4', 'GL_ALPHA8', 'GL_ALPHA12', 'GL_ALPHA16',
+
+   'GL_LUMINANCE', 'GL_LUMINANCE4', 'GL_LUMINANCE8', 'GL_SLUMINANCE8',
+   'GL_LUMINANCE12', 'GL_LUMINANCE16',
+
+   'GL_LUMINANCE_ALPHA', 'GL_LUMINANCE4_ALPHA4',
+   'GL_LUMINANCE6_ALPHA2', 'GL_LUMINANCE8_ALPHA8',
+   'GL_SLUMINANCE8_ALPHA8', 'GL_LUMINANCE12_ALPHA4',
+   'GL_LUMINANCE12_ALPHA12', 'GL_LUMINANCE16_ALPHA16',
+]
+for format in color_formats:
+   add_concurrent_test(gl11, 'teximage-colors ' + format)
+
 gl10 = {}
 spec['!OpenGL 1.0'] = gl10
 add_concurrent_test(gl10, 'gl-1.0-beginend-coverage')
diff --git a/tests/texturing/CMakeLists.gl.txt 
b/tests/texturing/CMakeLists.gl.txt
index b121163..7d8d512 100644
--- a/tests/texturing/CMakeLists.gl.txt
+++ b/tests/texturing/CMakeLists.gl.txt
@@ -87,5 +87,6 @@ ENDIF (UNIX)
 piglit_add_executable (texsubimage texsubimage.c)
 piglit_add_executable (texture-al texture-al.c)
 piglit_add_executable (texture-rg texture-rg.c)
+piglit_add_executable (teximage-colors teximage-colors.c)
 
 # vim: ft=cmake:
diff --git a/tests/texturing/teximage-colors.c 
b/tests/texturing/teximage-colors.c
new file mode 100644
index 000..c68bddd
--- /dev/null
+++ b/tests/texturing/teximage-colors.c
@@ -0,0 +1,872 @@
+/*
+ * Copyright 2014 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "piglit-util-gl-common.h"
+
+#define BENCHMARK_ITERATIONS 1000
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_compat_version = 13;
+
+   config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+struct texture_format {
+   GLenum internal_format;
+   const char *name;
+   GLenum format;
+   GLenum data_type;
+};
+
+struct texture_format formats[] = {
+#define FORMAT(IF, F, D) { IF, #IF, F, D }
+   FORMAT(GL_RED, GL_RED, GL_NONE),
+   FORMAT(GL_R8, GL_RED, GL_UNSIGNED_BYTE),
+   FORMAT(GL_R8_SNORM, GL_RED, GL_BYTE),
+   FORMAT(GL_R16, GL_RED, GL_UNSIGNED_SHORT),
+   FORMAT(GL_R16_SNORM, GL_RED, GL_SHORT),
+   FORMAT(GL_R16F, GL_RED, GL_NONE),
+   FORMAT(GL_R32F, GL_RED, GL_FLOAT),
+
+   FORMAT(GL_RG, GL_RG, GL_NONE),
+   FORMAT(GL_RG8, GL_RG, GL_UNSIGNED_BYTE),
+   FORMAT(GL_RG8_SNORM, GL_RG, GL_BYTE),
+   FORMAT(GL_RG16, GL_RG, GL_UNSIGNED_SHORT),
+   FORMAT(GL_RG16_SNORM, GL_RG, GL_SHORT),
+   FORMAT(GL_RG16F, GL_RG, GL_NONE),
+   FORMAT(GL_RG32F, GL_RG, GL_FLOAT),
+
+   FORMAT(GL_RGB, GL_RGB, GL_NONE),
+   FORMAT(GL_R3_G3_B2, GL_RGB, GL_UNSIGNED_BYTE_3_3_2),
+   FORMAT(GL_RGB4, GL_RGB, GL_UNSIGNED_SHORT_5_6_5),
+   FORMAT(GL_RGB5, GL_RGB, GL_UNSIGNED_SHOR

Re: [Piglit] [PATCH] Allow one 'non-concurrent' test to run in parallel with concurrent tests again

2014-08-20 Thread Jason Ekstrand
On Aug 19, 2014 8:13 PM, "Michel Dänzer"  wrote:
>
> From: Michel Dänzer 
>
> This reverts commit acb824ddc53c446124d88e37db610a4f8c59d56c.
>
> This decreases the runtime of the gpu.py profile from around 15 minutes to
> around 12 minutes on my machine, with no change in results.

Do you use a compositing window manager?  If so, then each window gets its
own front buffer and you can use the -c option and run all the tests in
parallel without problems.  If you are not running a compositor then there
could be a problem if the concurrent test pops up a window on top of the
non-concurrent test.  In this case the concurrent test's window would
destroy the front buffer of the nom-concurrent test.

This will only work if we can guarantee that the non-concurrent test
doesn't pop up any windows.

--Jason Ekstrand
>
> If in the future there are tests which really can't run in parallel with
any
> other tests, a new category should be added for them.
>
> Signed-off-by: Michel Dänzer 
> ---
>  framework/profile.py | 29 +++--
>  1 file changed, 15 insertions(+), 14 deletions(-)
>
> diff --git a/framework/profile.py b/framework/profile.py
> index 5428890..1bb2b50 100644
> --- a/framework/profile.py
> +++ b/framework/profile.py
> @@ -189,8 +189,6 @@ class TestProfile(object):
>  self._pre_run_hook()
>  framework.exectest.Test.OPTS = opts
>
> -chunksize = 1
> -
>  self._prepare_test_list(opts)
>  log = Log(len(self.test_list), opts.verbose)
>
> @@ -203,30 +201,33 @@ class TestProfile(object):
>  name, test = pair
>  test.execute(name, log, json_writer, self.dmesg)
>
> -def run_threads(pool, testlist):
> -""" Open a pool, close it, and join it """
> -pool.imap(test, testlist, chunksize)
> -pool.close()
> -pool.join()
> -
>  # Multiprocessing.dummy is a wrapper around Threading that
provides a
>  # multiprocessing compatible API
>  #
>  # The default value of pool is the number of virtual processor
cores
>  single = multiprocessing.dummy.Pool(1)
>  multi = multiprocessing.dummy.Pool()
> +chunksize = 1
>
>  if opts.concurrent == "all":
> -run_threads(multi, self.test_list.iteritems())
> +multi.imap(test, self.test_list.iteritems(), chunksize)
>  elif opts.concurrent == "none":
> -run_threads(single, self.test_list.iteritems())
> +single.imap(test, self.test_list.iteritems(), chunksize)
>  else:
>  # Filter and return only thread safe tests to the threaded
pool
> -run_threads(multi, (x for x in self.test_list.iteritems()
> -if x[1].run_concurrent))
> +multi.imap(test, (x for x in self.test_list.iteritems()
> +  if x[1].run_concurrent), chunksize)
>  # Filter and return the non thread safe tests to the single
pool
> -run_threads(single, (x for x in self.test_list.iteritems()
> - if not x[1].run_concurrent))
> +single.imap(test, (x for x in self.test_list.iteritems()
> +   if not x[1].run_concurrent), chunksize)
> +
> +# Close and join the pools
> +# If we don't close and the join the pools the script will exit
before
> +# the pools finish running
> +multi.close()
> +single.close()
> +multi.join()
> +single.join()
>
>  log.summary()
>
> --
> 2.1.0
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v5 4/5] spec/ARB_copy_image: Test different combinations of texture formats

2014-08-08 Thread Jason Ekstrand
This tests glCopyTexSubImage on all of the allowed combinations of internal
texture formats.  This also tests multisample textures.

v2: Incorperated comments from Brian Paul and Dylan Baker
v3: Added multisample support and more formats
v4: Properly handle subtests that skip or warn instead of just pass/fail
v5: Test copying between different portions of the same image

Signed-off-by: Jason Ekstrand 
---
 tests/all.py|   5 +
 tests/spec/arb_copy_image/CMakeLists.gl.txt |   1 +
 tests/spec/arb_copy_image/formats.c | 889 
 3 files changed, 895 insertions(+)
 create mode 100644 tests/spec/arb_copy_image/formats.c

diff --git a/tests/all.py b/tests/all.py
index 257c26b..0d3b7bf 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -3410,6 +3410,11 @@ add_concurrent_test(arb_copy_image, 
'arb_copy_image-targets GL_TEXTURE_3D 32 32
 add_concurrent_test(arb_copy_image, 'arb_copy_image-targets GL_TEXTURE_3D 32 
32 17 GL_TEXTURE_CUBE_MAP_ARRAY 16 16 18 11 5 2 5 9 7 5 7 11')
 add_concurrent_test(arb_copy_image, 'arb_copy_image-targets GL_TEXTURE_3D 32 
32 17 GL_TEXTURE_3D 32 16 18 11 5 2 5 9 7 14 7 11')
 
+add_concurrent_test(arb_copy_image, 'arb_copy_image-formats')
+add_concurrent_test(arb_copy_image, 'arb_copy_image-formats --samples=2')
+add_concurrent_test(arb_copy_image, 'arb_copy_image-formats --samples=4')
+add_concurrent_test(arb_copy_image, 'arb_copy_image-formats --samples=8')
+
 arb_half_float_vertex = {}
 spec['ARB_half_float_vertex'] = arb_half_float_vertex
 add_plain_test(arb_half_float_vertex, 'draw-vertices-half-float')
diff --git a/tests/spec/arb_copy_image/CMakeLists.gl.txt 
b/tests/spec/arb_copy_image/CMakeLists.gl.txt
index f0d631a..c8b0406 100644
--- a/tests/spec/arb_copy_image/CMakeLists.gl.txt
+++ b/tests/spec/arb_copy_image/CMakeLists.gl.txt
@@ -10,5 +10,6 @@ link_libraries (
 
 piglit_add_executable (arb_copy_image-simple simple.c)
 piglit_add_executable (arb_copy_image-targets targets.c)
+piglit_add_executable (arb_copy_image-formats formats.c)
 
 # vim: ft=cmake:
diff --git a/tests/spec/arb_copy_image/formats.c 
b/tests/spec/arb_copy_image/formats.c
new file mode 100644
index 000..5b07a1e
--- /dev/null
+++ b/tests/spec/arb_copy_image/formats.c
@@ -0,0 +1,889 @@
+/*
+ * Copyright 2014 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/*
+ * This tests glCopySubImageData on different multisampled texture
+ * formats.  One texture is created and filled with random data.  The
+ * texture is then copied to a second texture, the texture is downloaded,
+ * and the data verified.  Because glCopySubImageData is supposed to be a
+ * direct memcpy, the copy is verified to be bit-for-bit copy of the
+ * original.
+ */
+
+#include "piglit-util-gl.h"
+
+#define TEX_SIZE 32
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_compat_version = 13;
+
+   config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+struct texture_format {
+   GLenum internal_format;
+   const char *name;
+   GLenum format;
+   GLenum data_type;
+   bool can_be_reinterpreted;
+   GLuint bytes;
+   GLuint block_width;
+   GLuint block_height;
+};
+
+struct texture_format formats[] = {
+#define FORMAT(IF, F, D, S, B, W, H) { IF, #IF, F, D, S, B, W, H }
+   FORMAT(GL_RED, GL_RED, GL_UNSIGNED_BYTE, false, 1, 1, 1),
+   FORMAT(GL_R8UI, GL_RED_INTEGER, GL_UNSIGNED_BYTE, true, 1, 1, 1),
+   FORMAT(GL_R8I, GL_RED_INTEGER, GL_BYTE, true, 1, 1, 1),
+   FORMAT(GL_R8, GL_RED, GL_UNSIGNED_BYTE, true, 1, 1, 1),
+   FORMAT(GL_R8_SNORM, GL_RED, GL_BYTE, true, 1, 1, 1),
+
+   FORMAT(GL_RG, GL_RG, GL_UNSIGNED_BYTE, false, 2, 1, 1),
+   FORMAT(GL_RG8UI, GL_RG_INTEGE

[Piglit] [PATCH v3 3/5] util: Add a function for uploading multisample textures

2014-08-07 Thread Jason Ekstrand
One of the greatest difficulties in properly testing multisample textures
is actually generating and working with reference images.  This adds a nice
little util function that allows you to upload a multisampled image as if
you were using glTexImage3D.

Signed-off-by: Jason Ekstrand 
---
 tests/util/piglit-util-gl.c | 202 
 tests/util/piglit-util-gl.h |   5 ++
 2 files changed, 207 insertions(+)

diff --git a/tests/util/piglit-util-gl.c b/tests/util/piglit-util-gl.c
index caeb564..d383536 100644
--- a/tests/util/piglit-util-gl.c
+++ b/tests/util/piglit-util-gl.c
@@ -2462,6 +2462,208 @@ piglit_array_texture(GLenum target, GLenum 
internalformat,
return tex;
 }
 
+static const char multisample_texture_vs_source[] =
+"#version 130\n"
+"in vec2 vertex;\n"
+"out vec2 tex_coords;\n"
+"void main()\n"
+"{\n"
+"  tex_coords = vertex;\n"
+"  vec2 pos = (vertex.xy * 2) - vec2(1, 1);\n"
+"  gl_Position = vec4(pos, 0, 1);\n"
+"}\n";
+
+static const char multisample_texture_fs_source[] =
+"#version 130\n"
+"#extension GL_ARB_sample_shading : enable\n"
+"in vec2 tex_coords;\n"
+"uniform sampler2DArray tex;\n"
+"uniform int tex_depth;\n"
+"uniform int z;\n"
+"void main()\n"
+"{\n"
+"  int layer = (gl_SampleID * tex_depth) + z;\n"
+"  gl_FragColor = texture(tex, vec3(tex_coords, layer));\n"
+"}\n";
+
+/**
+ * Uploads an arbitrary multisample texture.
+ *
+ * This function acts like glTexImage for multisample textures.  If the
+ * input texture is zero, it will create one.  Otherwise, it will use the
+ * texture given and assumes that glTexImage[23]DMultisample has already
+ * been called to establish the storage.
+ *
+ * When this function returns, multisample texture will be bound to the
+ * currently active texture.
+ *
+ * \param target either GL_TEXTURE_2D_MULTISAMPLE or
+ *   GL_TEXTURE2D_MULTISAMPLE_ARRAY
+ * \param internalformat a renderable color format accepted by
+ *   glTexImage2DMultisample
+ * \param width  texture width
+ * \param height texture height
+ * \param depth  texture depth.  If target is
+ *   GL_TEXTURE_2D_MULTISAMPLE, this must be 1.
+ * \param samplesthe number of samples
+ * \param format format of the pixel data
+ * \param type   type of the pixel data
+ * \param data   pixel data with whitch to fill the texture
+ *
+ * \return the new texture object id
+ */
+GLuint
+piglit_multisample_texture(GLenum target, GLenum tex, GLenum internalFormat,
+  unsigned width, unsigned height,
+  unsigned depth, unsigned samples,
+  GLenum format, GLenum type, void *data)
+{
+   static GLuint prog = 0;
+   static GLint tex_loc, tex_depth_loc, z_loc;
+   static GLuint fbo, array_tex, ms_tex;
+   static const float verts[] = {
+   0.0, 0.0,
+   0.0, 1.0,
+   1.0, 1.0,
+   1.0, 1.0,
+   1.0, 0.0,
+   0.0, 0.0
+   };
+   unsigned z;
+
+   struct {
+   GLint active_tex;
+   GLint draw_fbo;
+   GLint prog;
+   GLint viewport[4];
+   GLboolean arb_sample_shading;
+   GLfloat min_sample_shading;
+   GLint clamp_fragment_color;
+   } backup;
+
+   piglit_require_extension("GL_ARB_texture_multisample");
+   piglit_require_extension("GL_ARB_sample_shading");
+
+   if (target == GL_TEXTURE_2D_MULTISAMPLE) {
+   assert(depth == 1);
+   } else if (target == GL_TEXTURE_2D_MULTISAMPLE_ARRAY) {
+   } else {
+   assert(!"Invalid texture target");
+   return 0;
+   }
+
+   if (prog == 0) {
+   /* First-run setup */
+   prog = piglit_build_simple_program_unlinked(
+   multisample_texture_vs_source,
+   multisample_texture_fs_source);
+   glBindAttribLocation(prog, 0, "vertex");
+   glLinkProgram(prog);
+   if (!piglit_link_check_status(prog)) {
+   prog = 0;
+   return 0;
+   }
+
+   tex_loc = glGetUniformLocation(prog, "tex");
+   tex_depth_loc = glGetUniformLocation(prog, "tex_depth");
+   z_loc = glGetUniformLocation(prog, "z");
+
+   glGenFramebuffers(1, &fbo);
+   glGenTextures(1, &array_tex);
+   }
+
+   /* Backup client values so we can restore them later */
+   glGetIntegerv(GL_ACTIVE_TEXTURE, &backup.active_tex

[Piglit] [PATCH v3 1/5] spec/ARB_copy_image: Add a simple ARB_copy_image test

2014-08-07 Thread Jason Ekstrand
This is a simple sanity test for the ARB_copy_image extension.  This tests
tests the different combinations of textures and renderbuffers for intputs
and outputs to glCopyTexSubImage.

v2: Incorperated comments from Brian Paul
v3: Also copy from the texture back onto itself to test yet another path

Signed-off-by: Jason Ekstrand 
---
 tests/all.py|   6 +
 tests/spec/CMakeLists.txt   |   1 +
 tests/spec/arb_copy_image/CMakeLists.gl.txt |  13 ++
 tests/spec/arb_copy_image/CMakeLists.txt|   1 +
 tests/spec/arb_copy_image/simple.c  | 215 
 5 files changed, 236 insertions(+)
 create mode 100644 tests/spec/arb_copy_image/CMakeLists.gl.txt
 create mode 100644 tests/spec/arb_copy_image/CMakeLists.txt
 create mode 100644 tests/spec/arb_copy_image/simple.c

diff --git a/tests/all.py b/tests/all.py
index 9d7a861..b551abe 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -3332,6 +3332,12 @@ arb_copy_buffer['overlap'] = 
concurrent_test('arb_copy_buffer-overlap')
 arb_copy_buffer['targets'] = concurrent_test('arb_copy_buffer-targets')
 arb_copy_buffer['subdata-sync'] = 
concurrent_test('arb_copy_buffer-subdata-sync')
 
+arb_copy_image = {}
+spec['ARB_copy_image'] = arb_copy_image
+add_concurrent_test(arb_copy_image, 'arb_copy_image-simple --tex-to-tex')
+add_concurrent_test(arb_copy_image, 'arb_copy_image-simple --rb-to-tex')
+add_concurrent_test(arb_copy_image, 'arb_copy_image-simple --rb-to-rb')
+
 arb_half_float_vertex = {}
 spec['ARB_half_float_vertex'] = arb_half_float_vertex
 add_plain_test(arb_half_float_vertex, 'draw-vertices-half-float')
diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index c7001f1..2fcb00e 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -4,6 +4,7 @@ add_subdirectory (arb_buffer_storage)
 add_subdirectory (arb_clear_buffer_object)
 add_subdirectory (arb_clear_texture)
 add_subdirectory (arb_color_buffer_float)
+add_subdirectory (arb_copy_image)
 add_subdirectory (arb_compute_shader)
 add_subdirectory (arb_debug_output)
 add_subdirectory (khr_debug)
diff --git a/tests/spec/arb_copy_image/CMakeLists.gl.txt 
b/tests/spec/arb_copy_image/CMakeLists.gl.txt
new file mode 100644
index 000..ac8ddcc
--- /dev/null
+++ b/tests/spec/arb_copy_image/CMakeLists.gl.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 (arb_copy_image-simple simple.c)
+
+# vim: ft=cmake:
diff --git a/tests/spec/arb_copy_image/CMakeLists.txt 
b/tests/spec/arb_copy_image/CMakeLists.txt
new file mode 100644
index 000..144a306
--- /dev/null
+++ b/tests/spec/arb_copy_image/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git a/tests/spec/arb_copy_image/simple.c 
b/tests/spec/arb_copy_image/simple.c
new file mode 100644
index 000..1138f3f
--- /dev/null
+++ b/tests/spec/arb_copy_image/simple.c
@@ -0,0 +1,215 @@
+/*
+ * Copyright 2014 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/** @file simple.c
+ *
+ * A simple test of glCopyImageSubData that copies a square from one
+ * 2D texture to another and back.  This test exercises texture to texture,
+ * texture to renderbuffer, renderbuffer to texture, and renderbuffer to
+ * renderbuffer copies.  This test also exercises copying from one texture
+ * or renderbuffer to the same texture or renderbuffer
+ */
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_compat_version = 13;
+
+   config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE;
+
+PIGLIT_GL_TEST_CONFIG_END

  1   2   >