Re: [Piglit] [PATCH] arb_texture_view-texsubimage-levels: correct buffer size

2017-02-02 Thread Bartosz Tomczyk
Please push it for me.

On Thu, Feb 2, 2017 at 8:51 PM, Anuj Phogat  wrote:

> On Tue, Jan 31, 2017 at 1:45 AM, Bartosz Tomczyk
>  wrote:
> > ---
> >  tests/spec/arb_texture_view/texsubimage-levels.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/tests/spec/arb_texture_view/texsubimage-levels.c
> b/tests/spec/arb_texture_view/texsubimage-levels.c
> > index 20d956fa2..7bbaf7f8b 100644
> > --- a/tests/spec/arb_texture_view/texsubimage-levels.c
> > +++ b/tests/spec/arb_texture_view/texsubimage-levels.c
> > @@ -89,7 +89,7 @@ piglit_init(int argc, char **argv)
> > }
> >
> > if (use_pbo) {
> > -   glBufferData(GL_PIXEL_UNPACK_BUFFER, TEX_SIZE *
> TEX_SIZE * 4,
> > +   glBufferData(GL_PIXEL_UNPACK_BUFFER, dim * dim
> * 4,
> >  pixels, GL_STREAM_DRAW);
> > }
> > glTexSubImage2D(GL_TEXTURE_2D,
> > @@ -118,7 +118,7 @@ piglit_init(int argc, char **argv)
> > }
> >
> > if (use_pbo) {
> > -   glBufferData(GL_PIXEL_UNPACK_BUFFER, TEX_SIZE *
> TEX_SIZE * 4,
> > +   glBufferData(GL_PIXEL_UNPACK_BUFFER, dim * dim
> * 4,
> >  pixels, GL_STREAM_DRAW);
> > }
> > glTexSubImage2D(GL_TEXTURE_2D, i, 0, 0, dim, dim,
> > --
> > 2.11.0
> >
> > ___
> > Piglit mailing list
> > Piglit@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/piglit
>
> Reviewed-by: Anuj Phogat 
>
> I can push it upstream if you don't have the access.
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [Bug 99649] When testlist contains non-existing (removed) test, piglit excepts out

2017-02-02 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=99649

--- Comment #1 from Dylan Baker  ---
I'm really uncomfortable with this patch.

The problem is that this list is both a set of tests to run, and a
deterministic order to run them in. When a test that doesn't exist (or never
exists) is allowed to just warn then the deterministic ordering is lost.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] framework/programs/run.py: Allow comments in test-list files.

2017-02-02 Thread Dylan Baker
Pushed :)

Quoting Petri Latvala (2017-02-02 01:24:56)
> On 02/01/2017 08:36 PM, Dylan Baker wrote:
> > This look good, thanks for making the changes. Do you have push access or 
> > should
> > I push this for you?
> >
> > Reviewed-by: Dylan Baker 
> >
> >
> 
> I don't think I have access. If you'd be so kind?
> 
> 
> -- 
> Petri Latvala
> 


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


[Piglit] [PATCH] gl-4.5/compare-framebuffer-parameter-with-get: add test

2017-02-02 Thread Alejandro Piñeiro
OpenGL 4.5 spec introduced new valid pnames for
GetFramebufferParameter.

From OpenGL 4.5 spec, Section 9.2.3 "Framebuffer Object Queries":

   "pname may also be one of DOUBLEBUFFER, IMPLEMENTATION_COLOR_-
READ_FORMAT, IMPLEMENTATION_COLOR_READ_TYPE, SAMPLES,
SAMPLE_BUFFERS, or STEREO, indicating the corresponding
framebuffer-dependent state from table 23.73. Values of
framebuffer-dependent state are identical to those that would be
obtained were the framebuffer object bound and queried using the
simple state queries in that table. These values may be queried
from either a framebuffer object or a default framebuffer."

That "simple state queries in that table" are either glGetBooleanv or
glGetIntegerv.

4.5 also defines a new method, available on previous versions through
the direct state access extension, GetNamedFramebufferParameteriv:

   "For GetFramebufferParameteriv, the framebuffer object is that
bound to target"

   "For GetNamedFramebufferParameteriv, framebuffer may be zero,
indicating the default draw framebuffer, or the name of the
framebuffer object."

So with the Named version, you can query the same info, but you can
query for a framebuffer not bound at that moment.

This test checks that the behaviour of GetFramebufferParameter,
GetNamedFramebufferParameter and glGetX is the same for the bound
framebuffer (default or user defined). Behaviour in the sense of same
value returned or same error generated. ForNamed* we will explicitly
bound to a different framebuffer, to ensure that it works when the
queried framebuffer is not bound at that moment.

Note that we will not check if the error or the value is correct, just
that are the same. Value and error correctness should be evaluated by
other tests.

The test provides a way to run just one pname and one type of
framebuffer. Those options were added to make it more useful while
fixing things on mesa, but it is not intended to use them when running
the full suite.
---

This test fails with mesa master. Just sent three patches to mesa-dev to
get it working:

https://patchwork.freedesktop.org/series/19008/

 tests/all.py   |   1 +
 tests/spec/gl-4.5/CMakeLists.gl.txt|   1 +
 .../compare-framebuffer-parameter-with-get.c   | 345 +
 3 files changed, 347 insertions(+)
 create mode 100644 tests/spec/gl-4.5/compare-framebuffer-parameter-with-get.c

diff --git a/tests/all.py b/tests/all.py
index 43e413e..9bd2687 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -1316,6 +1316,7 @@ with profile.test_list.group_manager(
 grouptools.join('spec', '!opengl 4.5')) as g:
 g(['gl-4.5-named-framebuffer-draw-buffers-errors'], 
'named-framebuffer-draw-buffers-errors')
 g(['gl-4.5-named-framebuffer-read-buffer-errors'], 
'named-framebuffer-read-buffer-errors')
+g(['gl-4.5-compare-framebuffer-parameter-with-get'], 
'compare-framebuffer-parameter-with-get')
 
 with profile.test_list.group_manager(
 PiglitGLTest,
diff --git a/tests/spec/gl-4.5/CMakeLists.gl.txt 
b/tests/spec/gl-4.5/CMakeLists.gl.txt
index 93736c9..9bf6b7d 100644
--- a/tests/spec/gl-4.5/CMakeLists.gl.txt
+++ b/tests/spec/gl-4.5/CMakeLists.gl.txt
@@ -10,5 +10,6 @@ link_libraries (
 
 piglit_add_executable (gl-4.5-named-framebuffer-draw-buffers-errors 
named-framebuffer-draw-buffers-errors.c)
 piglit_add_executable (gl-4.5-named-framebuffer-read-buffer-errors 
named-framebuffer-read-buffer-errors.c)
+piglit_add_executable (gl-4.5-compare-framebuffer-parameter-with-get 
compare-framebuffer-parameter-with-get.c)
 
 # vim: ft=cmake:
diff --git a/tests/spec/gl-4.5/compare-framebuffer-parameter-with-get.c 
b/tests/spec/gl-4.5/compare-framebuffer-parameter-with-get.c
new file mode 100644
index 000..5b0d5c0
--- /dev/null
+++ b/tests/spec/gl-4.5/compare-framebuffer-parameter-with-get.c
@@ -0,0 +1,345 @@
+/**
+ * Copyright 2017 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 

Re: [Piglit] [PATCH] arb_texture_view-texsubimage-levels: correct buffer size

2017-02-02 Thread Anuj Phogat
On Tue, Jan 31, 2017 at 1:45 AM, Bartosz Tomczyk
 wrote:
> ---
>  tests/spec/arb_texture_view/texsubimage-levels.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tests/spec/arb_texture_view/texsubimage-levels.c 
> b/tests/spec/arb_texture_view/texsubimage-levels.c
> index 20d956fa2..7bbaf7f8b 100644
> --- a/tests/spec/arb_texture_view/texsubimage-levels.c
> +++ b/tests/spec/arb_texture_view/texsubimage-levels.c
> @@ -89,7 +89,7 @@ piglit_init(int argc, char **argv)
> }
>
> if (use_pbo) {
> -   glBufferData(GL_PIXEL_UNPACK_BUFFER, TEX_SIZE * 
> TEX_SIZE * 4,
> +   glBufferData(GL_PIXEL_UNPACK_BUFFER, dim * dim * 4,
>  pixels, GL_STREAM_DRAW);
> }
> glTexSubImage2D(GL_TEXTURE_2D,
> @@ -118,7 +118,7 @@ piglit_init(int argc, char **argv)
> }
>
> if (use_pbo) {
> -   glBufferData(GL_PIXEL_UNPACK_BUFFER, TEX_SIZE * 
> TEX_SIZE * 4,
> +   glBufferData(GL_PIXEL_UNPACK_BUFFER, dim * dim * 4,
>  pixels, GL_STREAM_DRAW);
> }
> glTexSubImage2D(GL_TEXTURE_2D, i, 0, 0, dim, dim,
> --
> 2.11.0
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit

Reviewed-by: Anuj Phogat 

I can push it upstream if you don't have the access.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 1/5] Rename gen_conversion_fp64 to gen_conversion

2017-02-02 Thread Dylan Baker
Quoting Nicolai Hähnle (2017-02-02 06:48:39)
> On 01.02.2017 19:30, Dylan Baker wrote:
> > Can you modify 'unittests/generators/test_generators.py' to know about the
> > rename, and run the tests? 'pytest unittest/generators' or "tox -e
> > 'py{27,35}-generators'" will run the tests, depending on what you have
> > installed.
> 
> FWIW, there are some warnings that are surely unrelated:
> 
> WW0 in unittests/generators/test_generators.py:40 the following warning 
> was recorded:
>  
> ../../../../home/nha/amd/piglit/.tox/py27-generator/local/lib/python2.7/site-packages/_pytest/assertion/rewrite.py:74:
>  
> ImportWarning: Not importing directory '/home/nha/amd/piglit/templates': 
> missing __init__.py
>fd, fn, desc = imp.find_module(lastname, path)
> 
> WW0 in unittests/generators/test_generators.py:40 the following warning 
> was recorded:
>  
> ../../../../home/nha/amd/piglit/generated_tests/gen_builtin_packing_tests.py:45:
>  
> ImportWarning: Not importing directory '/home/nha/amd/piglit/templates': 
> missing __init__.py
>from templates import template_dir
> 
> Apart from that, it all looks green (in particular the py35-generator 
> environment has no warnings).
> 
> > If that passes, for the series:
> > Acked-by: Dylan Baker 
> 
> Thanks!
> 
> Nicolai

Yup, the first one isn't our warning, and the second isn't a big deal.


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


[Piglit] [PATCH] cl: Add sign_extend_inreg test

2017-02-02 Thread arsenm2
From: Matt Arsenault 

v2: Rename test file
---
 .../cl/program/execute/amdgcn.sign_extend_inreg.cl | 387 +
 1 file changed, 387 insertions(+)
 create mode 100644 tests/cl/program/execute/amdgcn.sign_extend_inreg.cl

diff --git a/tests/cl/program/execute/amdgcn.sign_extend_inreg.cl 
b/tests/cl/program/execute/amdgcn.sign_extend_inreg.cl
new file mode 100644
index 0..896747f2f
--- /dev/null
+++ b/tests/cl/program/execute/amdgcn.sign_extend_inreg.cl
@@ -0,0 +1,387 @@
+/*!
+[config]
+name: sign extend in register
+clc_version_min: 10
+
+dimensions: 1
+
+## Addition ##
+
+[test]
+name: SALU i8 in i64 0
+kernel_name: s_sext_in_reg_i8_in_i64
+
+arg_out: 0 buffer long[14] \
+  0x   \
+  0x000f   \
+  0xfff0   \
+  0x   \
+  0x0  \
+  0x0  \
+  0x79 \
+  0xff80   \
+  0xff81   \
+  0xff82   \
+  0xfffe   \
+  0x7f \
+  0xffaa   \
+  0x55
+
+arg_in: 1 long 0x
+arg_in: 2 long 0x000f
+arg_in: 3 long 0x00f0
+arg_in: 4 long 0x00ff
+arg_in: 5 long 0xff00
+arg_in: 6 long 0xf000
+arg_in: 7 long 0x0079
+arg_in: 8 long 0x0080
+arg_in: 9 long 0x0081
+arg_in: 10 long 0x0082
+arg_in: 11 long 0x00fe
+arg_in: 12 long 0x007f
+arg_in: 13 long 0x00aa
+arg_in: 14 long 0x0055
+arg_in: 15 int 0
+
+
+[test]
+name: SALU i16 in i64 0
+kernel_name: s_sext_in_reg_i16_in_i64
+
+arg_out: 0 buffer long[14] \
+  0x   \
+  0x000f   \
+  0x00f0   \
+  0x0f00   \
+  0xf000   \
+  0x   \
+  0xfffe   \
+  0x8000   \
+  0x   \
+  0x   \
+  0xff \
+  0xfff\
+  0x8001   \
+  0x8080
+
+arg_in: 1 long 0x
+arg_in: 2 long 0x000f
+arg_in: 3 long 0x00f0
+arg_in: 4 long 0x0f00
+arg_in: 5 long 0xf000
+arg_in: 6 long 0x
+arg_in: 7 long 0xfffe
+arg_in: 8 long 0x8000
+arg_in: 9 long 0x
+arg_in: 10 long 0x
+arg_in: 11 long 0x00ff
+arg_in: 12 long 0x0fff
+arg_in: 13 long 0x8001
+arg_in: 14 long 0x8080
+arg_in: 15 int 0
+
+
+[test]
+name: SALU i32 in i64 0
+kernel_name: s_sext_in_reg_i32_in_i64
+global_size: 1 0 0
+
+arg_out: 0 buffer long[16] \
+  0\
+  0xf  \
+  0x   \
+  0x   \
+  0x   \
+  0xfffe   \
+  0x7fff   \
+  0x8000   \
+  0x8001   \
+  0x0  \
+  0x   \
+  0x   \
+  0x4000   \
+  0xff \
+  0x0  \
+  0x0
+
+arg_in: 1  long 0x0
+arg_in: 2  long 0xf
+arg_in: 3  long 0x
+arg_in: 4  long 0x
+arg_in: 5  long 0x
+arg_in: 6  long 0xfffe
+arg_in: 7  long 0x7fff
+arg_in: 8  long 0x8000
+arg_in: 9  long 0x8001
+arg_in: 10 long 0x1
+arg_in: 11 long 0x
+arg_in: 12 long 0x
+arg_in: 13 long 0x4000
+arg_in: 14 long 0xff
+arg_in: 15 long 0x0001
+arg_in: 16 long 0x100
+
+arg_in: 17 int 0
+
+
+[test]
+name: VALU i8 in i64 0
+kernel_name: v_sext_in_reg_i8_in_i64
+global_size: 14 0 0
+
+arg_out: 0 buffer long[14] \
+  0x   \
+  0x000f   \
+  0xfff0   \
+  0x   \
+  0x0  \
+  0x0  \
+  0x79 \
+  0xff80   \
+  0xff81   \
+  0xff82   \
+  0xfffe   \
+  0x7f \
+  0xffaa   \
+  0x55
+
+arg_in: 1 buffer long[14] \
+  0x \
+  0x000f \
+  0x00f0 \
+  0x00ff \
+  0xff00 \
+  0xf000 \
+  0x0079 \
+  0x0080 \
+  0x0081 \
+  0x0082 \
+  0x00fe \
+  0x007f \
+  0x00aa \
+  0x0055
+
+arg_in: 2 int 0
+
+[test]
+name: VALU i16 in i64 0
+kernel_name: v_sext_in_reg_i16_in_i64
+global_size: 14 0 0
+
+arg_out: 0 buffer long[14] \
+  0x   \
+  0x000f   \
+  0x00f0   \
+  0x0f00   \
+  0xf000   \
+  0x   \
+  0xfffe   \
+  0x8000   \
+  0x   \
+  0x   \
+  0xff \
+  0xfff\
+  0x8001   \
+  0x8080
+
+arg_in: 1 buffer long[14] \
+  0x \
+  0x000f \
+  0x00f0 \
+  0x0f00 \
+  0xf000 \
+  0x \
+  0xfffe \
+  0x8000 \
+  0x \
+  0x \
+  0x00ff \
+  0x0fff \
+  0x8001 \
+  0x8080
+
+arg_in: 2 int 0
+
+[test]
+name: VALU i32 in i64 0
+kernel_name: v_sext_in_reg_i32_in_i64
+global_size: 16 0 0
+

Re: [Piglit] [PATCH] framework/programs/run.py: Allow comments in test-list files.

2017-02-02 Thread Petri Latvala

On 02/01/2017 08:36 PM, Dylan Baker wrote:

This look good, thanks for making the changes. Do you have push access or should
I push this for you?

Reviewed-by: Dylan Baker 




I don't think I have access. If you'd be so kind?


--
Petri Latvala

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


[Piglit] [Bug 99646] New Account Request

2017-02-02 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=99646

--- Comment #1 from Plamena Manolova  ---
Created attachment 129292
  --> https://bugs.freedesktop.org/attachment.cgi?id=129292=edit
Public SSH key

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [Bug 99646] New: New Account Request

2017-02-02 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=99646

Bug ID: 99646
   Summary: New Account Request
   Product: piglit
   Version: unspecified
  Hardware: Other
OS: All
Status: NEW
  Severity: normal
  Priority: medium
 Component: tests
  Assignee: piglit@lists.freedesktop.org
  Reporter: plamena.manol...@intel.com
QA Contact: piglit@lists.freedesktop.org

Created attachment 129291
  --> https://bugs.freedesktop.org/attachment.cgi?id=129291=edit
Public GPG key

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 1/5] util: move SUBTEST and SUBTESTCONDITION to piglit-util

2017-02-02 Thread Anuj Phogat
On Wed, Jan 11, 2017 at 1:46 PM, Alejandro Piñeiro  wrote:
> Defined on dsa-utils.h. Plan to use on other tests.
> ---
>  tests/spec/arb_direct_state_access/dsa-utils.h | 16 
>  tests/util/piglit-util.h   | 23 +++
>  2 files changed, 23 insertions(+), 16 deletions(-)
>
> diff --git a/tests/spec/arb_direct_state_access/dsa-utils.h 
> b/tests/spec/arb_direct_state_access/dsa-utils.h
> index 1f84f95..cd6c56b 100644
> --- a/tests/spec/arb_direct_state_access/dsa-utils.h
> +++ b/tests/spec/arb_direct_state_access/dsa-utils.h
> @@ -39,22 +39,6 @@ extern "C" {
>
>  #include "piglit-util-gl.h"
>
> -#define SUBTEST(error, global, ...) \
> -do { \
> -   bool local = piglit_check_gl_error((error)); \
> -   global = global && local; \
> -   piglit_report_subtest_result(local ? PIGLIT_PASS : PIGLIT_FAIL, \
> -__VA_ARGS__); \
> -} while (0)
> -
> -#define SUBTESTCONDITION(condition, global, ...) \
> -do { \
> -   bool cond = (condition); \
> -   global = global && cond; \
> -   piglit_report_subtest_result(cond ? PIGLIT_PASS : PIGLIT_FAIL, \
> -__VA_ARGS__); \
> -} while (0)
> -
>  GLuint dsa_create_program(GLenum target);
>
>  void dsa_texture_with_unit(GLuint prog, GLuint unit);
> diff --git a/tests/util/piglit-util.h b/tests/util/piglit-util.h
> index ec580df..550b14c 100644
> --- a/tests/util/piglit-util.h
> +++ b/tests/util/piglit-util.h
> @@ -185,6 +185,29 @@ piglit_run_selected_subtests(const struct piglit_subtest 
> *all_subtests,
>  #define MAX2(a, b) ((a) > (b) ? (a) : (b))
>  #define ALIGN(value, alignment) (((value) + alignment - 1) & ~(alignment - 
> 1))
>
> +/**
> + * Utility macro that checks for a given opengl error, and report a
> + * subtest result.
> + */
> +#define SUBTEST(error, global, ...) \
> +do { \
> +   bool local = piglit_check_gl_error((error)); \
> +   global = global && local; \
> +   piglit_report_subtest_result(local ? PIGLIT_PASS : PIGLIT_FAIL, \
> +__VA_ARGS__);  \
> +} while (0)
> +
> +/**
> + * Utility macro that checks for a given condition, and report a
> + * subtest result.
> + */
> +#define SUBTESTCONDITION(condition, global, ...) \
> +do { \
> +   bool cond = (condition); \
> +   global = global && cond; \
> +   piglit_report_subtest_result(cond ? PIGLIT_PASS : PIGLIT_FAIL, \
> +__VA_ARGS__); \
> +} while (0)
>
>  static inline unsigned
>  log2u(unsigned v)
> --
> 2.9.3
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit

How about changing the names of macros to:
PIGLIT_SUBTEST_ERROR and PIGLIT_SUBTEST_CONDITION ?
They go well with piglit's global naming conventions.

I'm fine with the patch otherwise. With the suggested change, patch is:
Reviewed-by: Anuj Phogat 
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH v2] gl-4.5/named-framebuffer-read-buffer-errors: add test

2017-02-02 Thread Anuj Phogat
On Tue, Jan 31, 2017 at 1:38 AM, Alejandro Piñeiro  wrote:
> All spec quotes come from OpenGL 4.5 spec, section 18.2.1
> "Selecting Buffers for Reading", page 502 (524 on PDF).
>
> Note that the errors are the same that with glReadBuffer,
> so we are testing this method too, although indirectly.
>
> v2 (Anuj):
>  * Move logic to piglit_init (as we are not drawing anything)
>  * Fit all lines under 80 character limit.
> ---
>  tests/all.py   |   1 +
>  tests/spec/gl-4.5/CMakeLists.gl.txt|   1 +
>  .../gl-4.5/named-framebuffer-read-buffer-errors.c  | 186 
> +
>  3 files changed, 188 insertions(+)
>  create mode 100644 tests/spec/gl-4.5/named-framebuffer-read-buffer-errors.c
>
> diff --git a/tests/all.py b/tests/all.py
> index be0fbaa..43e413e 100644
> --- a/tests/all.py
> +++ b/tests/all.py
> @@ -1315,6 +1315,7 @@ with profile.test_list.group_manager(
>  PiglitGLTest,
>  grouptools.join('spec', '!opengl 4.5')) as g:
>  g(['gl-4.5-named-framebuffer-draw-buffers-errors'], 
> 'named-framebuffer-draw-buffers-errors')
> +g(['gl-4.5-named-framebuffer-read-buffer-errors'], 
> 'named-framebuffer-read-buffer-errors')
>
>  with profile.test_list.group_manager(
>  PiglitGLTest,
> diff --git a/tests/spec/gl-4.5/CMakeLists.gl.txt 
> b/tests/spec/gl-4.5/CMakeLists.gl.txt
> index 3ea3b65..93736c9 100644
> --- a/tests/spec/gl-4.5/CMakeLists.gl.txt
> +++ b/tests/spec/gl-4.5/CMakeLists.gl.txt
> @@ -9,5 +9,6 @@ link_libraries (
>  )
>
>  piglit_add_executable (gl-4.5-named-framebuffer-draw-buffers-errors 
> named-framebuffer-draw-buffers-errors.c)
> +piglit_add_executable (gl-4.5-named-framebuffer-read-buffer-errors 
> named-framebuffer-read-buffer-errors.c)
>
>  # vim: ft=cmake:
> diff --git a/tests/spec/gl-4.5/named-framebuffer-read-buffer-errors.c 
> b/tests/spec/gl-4.5/named-framebuffer-read-buffer-errors.c
> new file mode 100644
> index 000..c4f2d34
> --- /dev/null
> +++ b/tests/spec/gl-4.5/named-framebuffer-read-buffer-errors.c
> @@ -0,0 +1,186 @@
> +/**
> + * Copyright 2017 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 named-framebuffer-read-buffer-errors.c
> + *
> + * Test that NamedFramebufferReadBuffer() returns correct error
> + * message for different values.
> + *
> + * All spec quotes come from OpenGL 4.5 spec, section 18.2.1
> + * "Selecting Buffers for Reading", page 502 (524 on PDF).
> + *
> + * Note that for 4.5, they are the same errors that for ReadBuffer, so
> + * we get that method tested it, although indirectly. Also some spec
> + * quotes could mention ReadBuffer too.
> + *
> + * From OpenGL 4.5, section 18.2.1 "Selecting Buffers for Reading",
> + * page 502:
> + *
> + *  "When reading pixels from a color buffer of a framebuffer object,
> + *   the buffer selected for reading is termed the read buffer, and is
> + *   controlled with the commands:
> + *
> + *   void ReadBuffer( enum src );
> + *   void NamedFramebufferReadBuffer( uint framebuffer, enum src );
> + *
> + *   For ReadBuffer, the target framebuffer object is that bound to
> + *   READ_- FRAMEBUFFER . For NamedFramebufferReadBuffer, framebuffer
> + *   is zero or the name of the target framebuffer object. If
> + *   framebuffer is zero, then the default read framebuffer is
> + *   affected."
> + */
> +
> +#include "piglit-util-gl.h"
> +
> +PIGLIT_GL_TEST_CONFIG_BEGIN
> +
> +   config.supports_gl_core_version = 45;
> +
> +   config.window_visual = PIGLIT_GL_VISUAL_RGBA |
> +   PIGLIT_GL_VISUAL_DOUBLE;
> +
> +PIGLIT_GL_TEST_CONFIG_END
> +
> +static const GLenum table_17_4[] = {
> +   GL_NONE,
> +   GL_FRONT_LEFT,
> +   GL_FRONT_RIGHT,
> +   GL_BACK_LEFT,
> +   GL_BACK_RIGHT,
> +   GL_FRONT,
> +   GL_BACK,
> +   GL_LEFT,
> +  

Re: [Piglit] [PATCH] gl-4.5/named-framebuffer-draw-buffers-errors: add a new test

2017-02-02 Thread Anuj Phogat
On Tue, Jan 31, 2017 at 1:37 AM, Alejandro Piñeiro  wrote:
> Equivalent to the already existing gl-3.1/draw-buffers-errors and
> spec/gles-2.0/draw-buffers, but using the 4.5 API. The errors are
> the same that with DrawBuffers so we are testing this method too,
> although indirectly.
>
> Used as reference OpenGL 4.5 spec, section 17.4.1 "Selecting Buffers
> for Writing", page 490 (511 on the PDF).
>
> Note that the behaviour is slightly different on compared with 4.4 and
> lower, but we are testing only 4.5, as is the most recent 4.x spec.
>
> v2 (Anuj):
>  * Move logic to piglit_init (as we are not drawing anything)
>  * Remove unneeded space
>  * Fit all lines under 80 character limit.
> ---
>  tests/all.py   |   5 +
>  tests/spec/CMakeLists.txt  |   1 +
>  tests/spec/gl-4.5/CMakeLists.gl.txt|  13 +
>  tests/spec/gl-4.5/CMakeLists.txt   |   1 +
>  .../gl-4.5/named-framebuffer-draw-buffers-errors.c | 339 
> +
>  5 files changed, 359 insertions(+)
>  create mode 100644 tests/spec/gl-4.5/CMakeLists.gl.txt
>  create mode 100644 tests/spec/gl-4.5/CMakeLists.txt
>  create mode 100644 tests/spec/gl-4.5/named-framebuffer-draw-buffers-errors.c
>
> diff --git a/tests/all.py b/tests/all.py
> index 74ffb42..be0fbaa 100644
> --- a/tests/all.py
> +++ b/tests/all.py
> @@ -1313,6 +1313,11 @@ with profile.test_list.group_manager(
>
>  with profile.test_list.group_manager(
>  PiglitGLTest,
> +grouptools.join('spec', '!opengl 4.5')) as g:
> +g(['gl-4.5-named-framebuffer-draw-buffers-errors'], 
> 'named-framebuffer-draw-buffers-errors')
> +
> +with profile.test_list.group_manager(
> +PiglitGLTest,
>  grouptools.join('spec', '!opengl 4.4')) as g:
>  g(['tex-errors'])
>
> diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
> index 548515d..47f4bb6 100644
> --- a/tests/spec/CMakeLists.txt
> +++ b/tests/spec/CMakeLists.txt
> @@ -118,6 +118,7 @@ add_subdirectory (gl-3.1)
>  add_subdirectory (gl-3.2)
>  add_subdirectory (gl-3.3)
>  add_subdirectory (gl-4.4)
> +add_subdirectory (gl-4.5)
>  add_subdirectory (gles-2.0)
>  add_subdirectory (gles-3.0)
>  add_subdirectory (glx_arb_create_context)
> diff --git a/tests/spec/gl-4.5/CMakeLists.gl.txt 
> b/tests/spec/gl-4.5/CMakeLists.gl.txt
> new file mode 100644
> index 000..3ea3b65
> --- /dev/null
> +++ b/tests/spec/gl-4.5/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 (gl-4.5-named-framebuffer-draw-buffers-errors 
> named-framebuffer-draw-buffers-errors.c)
> +
> +# vim: ft=cmake:
> diff --git a/tests/spec/gl-4.5/CMakeLists.txt 
> b/tests/spec/gl-4.5/CMakeLists.txt
> new file mode 100644
> index 000..4a012b9
> --- /dev/null
> +++ b/tests/spec/gl-4.5/CMakeLists.txt
> @@ -0,0 +1 @@
> +piglit_include_target_api()
> \ No newline at end of file
> diff --git a/tests/spec/gl-4.5/named-framebuffer-draw-buffers-errors.c 
> b/tests/spec/gl-4.5/named-framebuffer-draw-buffers-errors.c
> new file mode 100644
> index 000..9a56299
> --- /dev/null
> +++ b/tests/spec/gl-4.5/named-framebuffer-draw-buffers-errors.c
> @@ -0,0 +1,339 @@
> +/**
> + * Copyright 2017 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 named-framebuffer-draw-buffers-errors.c
> + *
> + * Test that NamedFramebufferDrawBuffers() returns correct error
> + * message for different values.
> + *
> + * All spec quotes come from OpenGL 4.5 spec, section 17.4.1
> + * "Selecting Buffers for Writint", page 492 (515 on PDF).
> + *
> + * Note that for 4.5, they are the same errors that for 

[Piglit] [Bug 99649] New: When testlist contains non-existing (removed) test, piglit excepts out

2017-02-02 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=99649

Bug ID: 99649
   Summary: When testlist contains non-existing (removed) test,
piglit excepts out
   Product: piglit
   Version: unspecified
  Hardware: Other
OS: All
Status: NEW
  Severity: minor
  Priority: medium
 Component: infrastructure
  Assignee: baker.dyla...@gmail.com
  Reporter: tomi.p.sarv...@intel.com
QA Contact: piglit@lists.freedesktop.org

This trivial patch turns exception into warning if testlist contains
non-existing tests. Issue happens easily if testlist is maintained outside
framework and subtests (or even tests) are removed.

Patch sent to mailing list, but is waiting for moderation.

Best regards,

Tomi



diff --git a/framework/profile.py b/framework/profile.py
index 94efd0a..80f1cd3 100644
--- a/framework/profile.py
+++ b/framework/profile.py
@@ -39,6 +39,7 @@ import multiprocessing
 import multiprocessing.dummy
 import os
 import re
+import warnings

 import six

@@ -314,7 +315,8 @@ class TestProfile(object):
 if self.forced_test_list:
 opts = collections.OrderedDict()
 for n in self.forced_test_list:
-opts[n] = self.test_list[n]
+try: opts[n] = self.test_list[n]
+except KeyError: warnings.warn("Test {} missing".format(n),
RuntimeWarning)
 else:
 opts = self.test_list  # pylint: disable=redefined-variable-type

-- 
You are receiving this mail because:
You are the QA Contact for the bug.___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


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

2017-02-02 Thread Plamena Manolova
A basic test to check whether the values written to gl_SampleMaskIn
are still correct after enabling the ARB_post_depth_coverage
extension.

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

diff --git a/tests/all.py b/tests/all.py
index 74ffb42..cef4773 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4765,6 +4765,11 @@ with profile.test_list.group_manager(
 g(['arb_shader_image_load_store-unused'], 'unused')
 
 with profile.test_list.group_manager(
+PiglitGLTest,
+grouptools.join('spec', 'arb_post_depth_coverage')) as g:
+g(['arb_post_depth_coverage-basic'])
+
+with profile.test_list.group_manager(
 PiglitGLTest,
 grouptools.join('spec', 'arb_shader_image_size')) as g:
 g(['arb_shader_image_size-builtin'], 'builtin')
diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index 548515d..1f3164e 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -154,3 +154,4 @@ add_subdirectory (ext_window_rectangles)
 add_subdirectory (arb_shader_texture_image_samples)
 add_subdirectory (arb_texture_barrier)
 add_subdirectory (intel_conservative_rasterization)
+add_subdirectory (arb_post_depth_coverage)
diff --git a/tests/spec/arb_post_depth_coverage/CMakeLists.gl.txt 
b/tests/spec/arb_post_depth_coverage/CMakeLists.gl.txt
new file mode 100644
index 000..1a71774
--- /dev/null
+++ b/tests/spec/arb_post_depth_coverage/CMakeLists.gl.txt
@@ -0,0 +1,11 @@
+include_directories(
+   ${GLEXT_INCLUDE_DIR}
+   ${OPENGL_INCLUDE_PATH}
+)
+
+link_libraries (
+   piglitutil_${piglit_target_api}
+   ${OPENGL_gl_LIBRARY}
+)
+
+piglit_add_executable (arb_post_depth_coverage-basic basic.c)
diff --git a/tests/spec/arb_post_depth_coverage/CMakeLists.txt 
b/tests/spec/arb_post_depth_coverage/CMakeLists.txt
new file mode 100644
index 000..144a306
--- /dev/null
+++ b/tests/spec/arb_post_depth_coverage/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git a/tests/spec/arb_post_depth_coverage/basic.c 
b/tests/spec/arb_post_depth_coverage/basic.c
new file mode 100644
index 000..07f6ab1
--- /dev/null
+++ b/tests/spec/arb_post_depth_coverage/basic.c
@@ -0,0 +1,241 @@
+/*
+ * Copyright (c) 2015 Intel Corporation.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * A rudimentary test to check whether the correct values are being written
+ * to gl_SampleMaskIn when ARB_post_depth_coverage is enabled.
+ */
+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+   config.supports_gl_compat_version = 43;
+   config.supports_gl_core_version = 43;
+   config.window_width = 160;
+   config.window_height = 160;
+   config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DEPTH | 
PIGLIT_GL_VISUAL_DOUBLE;
+PIGLIT_GL_TEST_CONFIG_END
+
+static GLuint prog1, prog2, vao, ssbo;
+static GLint *sample_mask;
+
+static const char *vs_text =
+   "#version 430\n"
+   "in vec4 pos_in;\n"
+   "void main()\n"
+   "{\n"
+   "   gl_Position = pos_in;\n"
+   "}\n";
+
+static const char *fs_text1 =
+   "#version 430\n"
+   "out vec4 color;\n"
+   "void main()\n"
+   "{\n"
+   "  gl_FragDepth = 0.5f;\n"
+   "   color = vec4(0.0, 1.0, 0.0, 1.0);\n"
+   "}\n";
+
+static const char *fs_text2 =
+   "#version 430\n"
+   "#extension 

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

2017-02-02 Thread Plamena Manolova
A multisampling test with sample shading enabled to check
whether the values written to gl_SampleMaskIn are still correct
after enabling the ARB_post_depth_coverage extension.

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

diff --git a/tests/all.py b/tests/all.py
index 95aa952..2176739 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4769,6 +4769,7 @@ with profile.test_list.group_manager(
 grouptools.join('spec', 'arb_post_depth_coverage')) as g:
 g(['arb_post_depth_coverage-basic'])
 g(['arb_post_depth_coverage-multisampling'])
+g(['arb_post_depth_coverage-sample-shading'])
 
 with profile.test_list.group_manager(
 PiglitGLTest,
diff --git a/tests/spec/arb_post_depth_coverage/CMakeLists.gl.txt 
b/tests/spec/arb_post_depth_coverage/CMakeLists.gl.txt
index 9c1e826..67f0c47 100644
--- a/tests/spec/arb_post_depth_coverage/CMakeLists.gl.txt
+++ b/tests/spec/arb_post_depth_coverage/CMakeLists.gl.txt
@@ -10,3 +10,4 @@ link_libraries (
 
 piglit_add_executable (arb_post_depth_coverage-basic basic.c)
 piglit_add_executable (arb_post_depth_coverage-multisampling multisampling.c)
+piglit_add_executable (arb_post_depth_coverage-sample-shading sample-shading.c)
diff --git a/tests/spec/arb_post_depth_coverage/sample-shading.c 
b/tests/spec/arb_post_depth_coverage/sample-shading.c
new file mode 100644
index 000..891e7bc
--- /dev/null
+++ b/tests/spec/arb_post_depth_coverage/sample-shading.c
@@ -0,0 +1,317 @@
+/*
+ * Copyright (c) 2015 Intel Corporation.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * A test to check whether the right values are written to gl_SampleMaskIn
+ * when ARB_post_depth_coverage, sample shading and multisampling are enabled.
+ * Tests at 2, 4, 8, 16 sample rates.
+ */
+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+   config.supports_gl_compat_version = 43;
+   config.supports_gl_core_version = 43;
+   config.window_width = 160;
+   config.window_height = 160;
+   config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DEPTH |
+   PIGLIT_GL_VISUAL_DOUBLE;
+PIGLIT_GL_TEST_CONFIG_END
+
+static GLuint prog1, prog2, vao, ssbo, tex_color, tex_depth, fbo;
+static GLint *sample_mask;
+
+static const char *vs_text =
+   "#version 430\n"
+   "in vec4 pos_in;\n"
+   "void main()\n"
+   "{\n"
+   "   gl_Position = pos_in;\n"
+   "}\n";
+
+static const char *fs_text1 =
+   "#version 430\n"
+   "out vec4 color;\n"
+   "void main()\n"
+   "{\n"
+   "  gl_FragDepth = 0.5f;\n"
+   "   color = vec4(0.0, 1.0, 0.0, 1.0);\n"
+   "}\n";
+
+static const char *fs_text2 =
+   "#version 430\n"
+   "#extension GL_ARB_post_depth_coverage: enable\n"
+   "out vec4 color;\n"
+   "layout(early_fragment_tests) in;\n"
+   "layout(post_depth_coverage) in;\n"
+   "layout(std430, binding = 0) buffer MaskOutput {\n"
+   "   int data[];\n"
+   "} mask_output;\n"
+   "layout(location = 1) uniform int width;\n"
+   "layout(location = 2) uniform int samples;\n"
+   "void main()\n"
+   "{\n"
+   "   int index = int(gl_FragCoord.y) * width + 
int(gl_FragCoord.x);\n"
+   "   if (gl_SampleMaskIn[0] == (1 << gl_SampleID)) {\n"
+   "   mask_output.data[index] = 1;\n"
+   "   } else {\n"
+   "   mask_output.data[index] = 0;\n"
+   "   }\n"
+   "   color = vec4(1.0, 0.0, 0.0, 1.0);\n"
+   "}\n";
+
+static GLuint
+make_shader_program1(void)
+{
+   GLuint prog;
+
+   prog = 

Re: [Piglit] [PATCH 1/5] Rename gen_conversion_fp64 to gen_conversion

2017-02-02 Thread Nicolai Hähnle

On 01.02.2017 19:30, Dylan Baker wrote:

Can you modify 'unittests/generators/test_generators.py' to know about the
rename, and run the tests? 'pytest unittest/generators' or "tox -e
'py{27,35}-generators'" will run the tests, depending on what you have
installed.


FWIW, there are some warnings that are surely unrelated:

WW0 in unittests/generators/test_generators.py:40 the following warning 
was recorded:


../../../../home/nha/amd/piglit/.tox/py27-generator/local/lib/python2.7/site-packages/_pytest/assertion/rewrite.py:74: 
ImportWarning: Not importing directory '/home/nha/amd/piglit/templates': 
missing __init__.py

  fd, fn, desc = imp.find_module(lastname, path)

WW0 in unittests/generators/test_generators.py:40 the following warning 
was recorded:


../../../../home/nha/amd/piglit/generated_tests/gen_builtin_packing_tests.py:45: 
ImportWarning: Not importing directory '/home/nha/amd/piglit/templates': 
missing __init__.py

  from templates import template_dir

Apart from that, it all looks green (in particular the py35-generator 
environment has no warnings).



If that passes, for the series:
Acked-by: Dylan Baker 


Thanks!

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


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

2017-02-02 Thread Plamena Manolova
A simple multisampling test to check whether the values written
to gl_SampleMaskIn are still correct after enabling the
ARB_post_depth_coverage extension.

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

diff --git a/tests/all.py b/tests/all.py
index cef4773..95aa952 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4768,6 +4768,7 @@ with profile.test_list.group_manager(
 PiglitGLTest,
 grouptools.join('spec', 'arb_post_depth_coverage')) as g:
 g(['arb_post_depth_coverage-basic'])
+g(['arb_post_depth_coverage-multisampling'])
 
 with profile.test_list.group_manager(
 PiglitGLTest,
diff --git a/tests/spec/arb_post_depth_coverage/CMakeLists.gl.txt 
b/tests/spec/arb_post_depth_coverage/CMakeLists.gl.txt
index 1a71774..9c1e826 100644
--- a/tests/spec/arb_post_depth_coverage/CMakeLists.gl.txt
+++ b/tests/spec/arb_post_depth_coverage/CMakeLists.gl.txt
@@ -9,3 +9,4 @@ link_libraries (
 )
 
 piglit_add_executable (arb_post_depth_coverage-basic basic.c)
+piglit_add_executable (arb_post_depth_coverage-multisampling multisampling.c)
diff --git a/tests/spec/arb_post_depth_coverage/multisampling.c 
b/tests/spec/arb_post_depth_coverage/multisampling.c
new file mode 100644
index 000..0c867da
--- /dev/null
+++ b/tests/spec/arb_post_depth_coverage/multisampling.c
@@ -0,0 +1,311 @@
+/*
+ * Copyright (c) 2015 Intel Corporation.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include "piglit-util-gl.h"
+
+/*
+ * A test to check whether the right values are written to gl_SampleMaskIn
+ * when ARB_post_depth_coverage and multisampling are enabled. Tests at
+ * 2, 4, 8, 16 sample rates.
+ */
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+   config.supports_gl_compat_version = 43;
+   config.supports_gl_core_version = 43;
+   config.window_width = 160;
+   config.window_height = 160;
+   config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DEPTH |
+   PIGLIT_GL_VISUAL_DOUBLE;
+PIGLIT_GL_TEST_CONFIG_END
+
+static GLuint prog1, prog2, vao, ssbo, tex_color, tex_depth, fbo;
+static GLint *sample_mask;
+
+static const char *vs_text =
+   "#version 430\n"
+   "in vec4 pos_in;\n"
+   "void main()\n"
+   "{\n"
+   "   gl_Position = pos_in;\n"
+   "}\n";
+
+static const char *fs_text1 =
+   "#version 430\n"
+   "out vec4 color;\n"
+   "void main()\n"
+   "{\n"
+   "  gl_FragDepth = 0.5f;\n"
+   "   color = vec4(0.0, 1.0, 0.0, 1.0);\n"
+   "}\n";
+
+static const char *fs_text2 =
+   "#version 430\n"
+   "#extension GL_ARB_post_depth_coverage: enable\n"
+   "out vec4 color;\n"
+   "layout(early_fragment_tests) in;\n"
+   "layout(post_depth_coverage) in;\n"
+   "layout(std430, binding = 0) buffer MaskOutput {\n"
+   "   int data[];\n"
+   "} mask_output;\n"
+   "layout(location = 1) uniform int width;\n"
+   "layout(location = 2) uniform int samples;\n"
+   "void main()\n"
+   "{\n"
+   "   int index = int(gl_FragCoord.y) * width + 
int(gl_FragCoord.x);\n"
+   "   atomicAdd(mask_output.data[index], 
bitCount(gl_SampleMaskIn[0]));\n"
+   "   color = vec4(1.0, 0.0, 0.0, 1.0);\n"
+   "}\n";
+
+static GLuint
+make_shader_program1(void)
+{
+   GLuint prog;
+
+   prog = piglit_build_simple_program(vs_text, fs_text1);
+   glUseProgram(prog);
+
+   glBindAttribLocation(prog, 0, "pos_in");
+
+   glLinkProgram(prog);
+
+   if (!piglit_check_gl_error(GL_NO_ERROR)) {
+   piglit_report_result(PIGLIT_FAIL);
+   }
+
+   return