[Piglit] [PATCH] arb_shader_storage_buffer_object: fix TOP_LEVEL_ARRAY_STRIDE expected value for std430 case

2015-09-09 Thread Samuel Iglesias Gonsalvez
struct B has a size of 52. Interface packing layout qualifier std430 says that
the array of structures are not rounded up a multiple of the base alignment of
a vec4 but to the next multiple of the base alignment of the structure.

The base alignment of a structure is N, where N is the largest base
alignment value of any of its members.

In this case the largest base alignment is 8 (which is mat2's base alignment
following std430 rules), so 52 is rounded up to 56, not to 64.

Tested on NVIDIA proprietary driver version 352.21.

Signed-off-by: Samuel Iglesias Gonsalvez 
---
 tests/spec/arb_shader_storage_buffer_object/program-interface-query.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/tests/spec/arb_shader_storage_buffer_object/program-interface-query.c 
b/tests/spec/arb_shader_storage_buffer_object/program-interface-query.c
index 2044898..68cbbff 100644
--- a/tests/spec/arb_shader_storage_buffer_object/program-interface-query.c
+++ b/tests/spec/arb_shader_storage_buffer_object/program-interface-query.c
@@ -110,7 +110,7 @@ piglit_init(int argc, char **argv)
const int expected_std140[NUM_QUERIES] =
{ 0, 112, GL_FLOAT_MAT2, 3, 0, 16, 32, 16, 1, 1, 0 };
const int expected_std430[NUM_QUERIES] =
-   { 2, 64, GL_FLOAT_MAT2, 3, 2, 16, 16, 8, 0, 0, 1 };
+   { 2, 56, GL_FLOAT_MAT2, 3, 2, 16, 16, 8, 0, 0, 1 };
int i;
 
piglit_require_extension("GL_ARB_shader_storage_buffer_object");
-- 
2.1.4

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


[Piglit] [PATCH] Add a biased variants of a textureLod() miplevel tests

2015-09-09 Thread Krzesimir Nowak
These tests have the same purpose as the
{vs,fs}-textureLod-miplevels.shader_test ones. These are actually a
slightly modified copies of those. The modifications are setting the
lod_bias parameter to 1.0 and updating the expected colors in probes.

This exposes a bug in softpipe, where it does not take lod_bias into
account, so the colors returned in these tests are the same as in
unbiased versions.
---
 .../fs-textureLod-miplevels-biased.shader_test | 196 +
 .../vs-textureLod-miplevels-biased.shader_test | 196 +
 2 files changed, 392 insertions(+)
 create mode 100644 
tests/spec/glsl-1.30/execution/fs-textureLod-miplevels-biased.shader_test
 create mode 100644 
tests/spec/glsl-1.30/execution/vs-textureLod-miplevels-biased.shader_test

diff --git 
a/tests/spec/glsl-1.30/execution/fs-textureLod-miplevels-biased.shader_test 
b/tests/spec/glsl-1.30/execution/fs-textureLod-miplevels-biased.shader_test
new file mode 100644
index 000..87b38e2
--- /dev/null
+++ b/tests/spec/glsl-1.30/execution/fs-textureLod-miplevels-biased.shader_test
@@ -0,0 +1,196 @@
+#
+# A basic mipmap test:
+#
+# Create an 8x8 texture with four miplevels, colored red, green, blue, and
+# white, respectively.  Draw the following:
+#
+#
+# (integer LODs) (fractional w/ linear)   (fractional w/ nearest)
+#
+# miplevel 3 +
+#[2.2] [2.4] [2.6] [2.8]  [2.2] [2.4] [2.6] [2.8]
+# miplevel 2 +-+
+#+-+
+#[1.2] [1.4] [1.6] [1.8]  [1.2] [1.4] [1.6] [1.8]
+# miplevel 1 +---+
+#|   |
+#+---+
+#[0.2] [0.4] [0.6] [0.8]  [0.2] [0.4] [0.6] [0.8]
+#+--+
+# miplevel 0 |  |
+#|  |
+#+--+
+#
+# This verifies that textureLod() takes lod bias into account when
+# selecting the proper miplevel for integer LODs (left boxes) and that
+# both linear and nearest filtering for fractional LODs work
+# correctly.
+#
+# Instead of seeing red, green, blue, and white squares, we should see
+# only green, blue, white, and again white squares.
+#
+# It does not verify anything regarding texture coordinates.
+
+[require]
+GLSL >= 1.30
+
+[fragment shader]
+#version 130
+uniform sampler2D tex;
+uniform float lod;
+void main()
+{
+gl_FragColor = textureLod(tex, vec2(0.5, 0.5), lod);
+}
+
+[vertex shader]
+#version 130
+void main()
+{
+gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+}
+
+[test]
+ortho
+clear color 0.4 0.4 0.4 0.4
+clear
+
+uniform int tex 0
+texture miptree 0
+
+# Draw the miptree: basic integer LODs.
+
+texparameter 2D lod_bias 1.0
+texparameter 2D min nearest_mipmap_nearest
+texparameter 2D mag nearest
+
+uniform float lod 0
+draw rect 10 10 32 32
+
+uniform float lod 1
+draw rect 10 52 16 16
+
+uniform float lod 2
+draw rect 10 78 8 8
+
+uniform float lod 3
+draw rect 10 96 4 4
+
+# Fractional LODs: nearest filtering between miplevels
+
+uniform float lod 0.2
+draw rect 152 42 10 10
+
+uniform float lod 0.4
+draw rect 167 42 10 10
+
+uniform float lod 0.6
+draw rect 182 42 10 10
+
+uniform float lod 0.8
+draw rect 197 42 10 10
+
+uniform float lod 1.2
+draw rect 152 68 10 10
+
+uniform float lod 1.4
+draw rect 167 68 10 10
+
+uniform float lod 1.6
+draw rect 182 68 10 10
+
+uniform float lod 1.8
+draw rect 197 68 10 10
+
+uniform float lod 2.2
+draw rect 152 86 10 10
+
+uniform float lod 2.4
+draw rect 167 86 10 10
+
+uniform float lod 2.6
+draw rect 182 86 10 10
+
+uniform float lod 2.8
+draw rect 197 86 10 10
+
+
+# Fractional LODs: linear filtering between miplevels
+
+texparameter 2D min nearest_mipmap_linear
+
+uniform float lod 0.2
+draw rect 52 42 10 10
+
+uniform float lod 0.4
+draw rect 67 42 10 10
+
+uniform float lod 0.6
+draw rect 82 42 10 10
+
+uniform float lod 0.8
+draw rect 97 42 10 10
+
+uniform float lod 1.2
+draw rect 52 68 10 10
+
+uniform float lod 1.4
+draw rect 67 68 10 10
+
+uniform float lod 1.6
+draw rect 82 68 10 10
+
+uniform float lod 1.8
+draw rect 97 68 10 10
+
+uniform float lod 2.2
+draw rect 52 86 10 10
+
+uniform float lod 2.4
+draw rect 67 86 10 10
+
+uniform float lod 2.6
+draw rect 82 86 10 10
+
+uniform float lod 2.8
+draw rect 97 86 10 10
+
+# Probes: integer LODs
+probe rgb 26 15 0.0 1.0 0.0
+probe rgb 18 57 0.0 0.0 1.0
+probe rgb 14 83 1.0 1.0 1.0
+probe rgb 12 98 1.0 1.0 1.0
+
+# Probes: nearest filtering
+probe rgb 157 47 0.0 1.0 0.0
+probe rgb 172 47 0.0 1.0 0.0
+probe rgb 189 47 0.0 0.0 1.0
+probe rgb 202 47 0.0 0.0 1.0
+
+probe rgb 157 73 0.0 0.0 1.0
+probe rgb 172 73 0.0 0.0 1.0
+probe rgb 189 73 1.0 1.0 1.0
+probe rgb 202 73 1.0 1.0 1.0
+
+probe rgb 157 91 1.0 1.0 1.0
+probe rgb 172 91 1.0 1.0 1.0
+probe rgb 189 91 1.0 1.0 1.0
+probe rgb 202 91 1.0 1.0 1.0
+
+# Probes: linear filtering (tolerance of 0.05 makes it pass on fglrx)
+tolerance 0.05 0.05 0.05 0.05
+
+probe rgb  57 47 0.0 0.8 0.2
+probe rgb  72 47 0.0 0.6 0.4
+probe rgb  89 47 0.0 0.4 0.6
+probe rgb 102 47 0.0 0.2 0.8
+

Re: [Piglit] [PATCH] aa: too sensitive at the line end points for PNV platform

2015-09-09 Thread Predut, Marius
Ping...

> -Original Message-
> From: Piglit [mailto:piglit-boun...@lists.freedesktop.org] On Behalf Of
> Eduardo Lima Mitev
> Sent: Thursday, August 27, 2015 10:19 AM
> To: piglit@lists.freedesktop.org
> Subject: Re: [Piglit] [PATCH] aa: too sensitive at the line end points for PNV
> platform
> 
> On 07/30/2015 04:51 PM, Predut, Marius wrote:
> > Still not upstream.
> >
> > -Original Message-
> > From: Predut, Marius
> > Sent: Thursday, June 04, 2015 11:53 PM
> > To: piglit@lists.freedesktop.org
> > Cc: Predut, Marius
> > Subject: [PATCH] aa: too sensitive at the line end points for PNV platform
> >
> > Adjust middles of the segments sample so that now the test pass also on PNV
> platform.
> >
> > Bspec documentation G45: Volume 2: 3D/Media Last Pixel Enable  bit of
> SF_STATE controls whether the last pixel of the last line in a LINESTRIP_xxx
> primitive or the last pixel of each line in a LINELIST_xxx primitive is
> rendered.
> >
> > Signed-off-by: Marius Predut 
> > ---
> >  tests/general/line-aa-width.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/tests/general/line-aa-width.c b/tests/general/line-aa-width.c
> index c0fd7c1..e7998c4 100644
> > --- a/tests/general/line-aa-width.c
> > +++ b/tests/general/line-aa-width.c
> > @@ -136,7 +136,7 @@ piglit_display(void)
> >  * coverage in each column
> >  */
> > for (x1 = 2; x1 < piglit_width; x1 += seg_width) {
> > -   int x2 = x1 + seg_width - 4;
> > +   int x2 = x1 + seg_width - 5;
> > int sample_x;
> > float y1, y2;
> > float avg = 0.0;
> > @@ -144,8 +144,8 @@ piglit_display(void)
> > float max = -100.0;
> > char *err = NULL;
> >
> > -   if (x2 > piglit_width - 4)
> > -   x2 = piglit_width - 4;
> > +   if (x2 > piglit_width - 5)
> > +   x2 = piglit_width - 5;
> >
> > /* If we don't have a couple of pixels to sample because we've
> >  * hit the edge of the window, we're done.
> > --
> > 1.9.1
> >
> 
> Looks fine, though I don't have available HW to confirm the test passes
> after applying corresponding Mesa patch. If somebody can confirm it,
> this patch is:
> 
> Reviewed-By: Eduardo Lima Mitev 
> 
> ___
> 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] framework/summary.py: Always print number of changes in console mode

2015-09-09 Thread Tom Stellard
The counts for changes, fixes, and regressions are now reported as zero
when no changes are detect rather than being omitted from the output.

This makes it easier for scripts to parse the output of piglit summary
console, becuase now when there are no regressions piglit always
outputs:

regressions: 0

Before when there where no regressions, piglit would either print no
regression line or it would print 'regressions: 0'
---
 framework/summary.py | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/framework/summary.py b/framework/summary.py
index 80cb181..e56c0f2 100644
--- a/framework/summary.py
+++ b/framework/summary.py
@@ -604,7 +604,10 @@ class Summary:
   "  fixes: {fixes}\n"
   "regressions: {regressions}".format(
   **{k: len(v) for k, v in self.tests.iteritems()}))
-
+else:
+print("changes: 0\n"
+  "  fixes: 0\n"
+  "regressions: 0")
 print("  total: {}".format(sum(self.totals.itervalues(
 
 # Print the name of the test and the status from each test run
-- 
2.0.4

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


Re: [Piglit] [PATCH v2 3/4] Add miptree tests for khr_texture_compression_astc

2015-09-09 Thread Chad Versace
On Fri 28 Aug 2015, Nanley Chery wrote:
> From: Nanley Chery 
> 
> These tests run through every ASTC configuration, comparing the
> render of a compressed texture against a render of the decompressed
> version of that compressed texture. The compressed and decompressed
> texture was generated with a reference codec.
> 
> Signed-off-by: Nanley Chery 


> diff --git a/tests/spec/khr_texture_compression_astc/CMakeLists.gl.txt 
> b/tests/spec/khr_texture_compression_astc/CMakeLists.gl.txt
> new file mode 100644
> index 000..a47c7d3
> --- /dev/null
> +++ b/tests/spec/khr_texture_compression_astc/CMakeLists.gl.txt
> @@ -0,0 +1,14 @@
> +include_directories(
> + ${GLEXT_INCLUDE_DIR}
> + ${OPENGL_INCLUDE_PATH}
> +)

I think you can drop the call to include_directories. And If you can,
you should. Please try rebuilding without it.

> +
> +link_libraries (
> + piglitutil_${piglit_target_api}
> + ${OPENGL_gl_LIBRARY}
> + ${OPENGL_glu_LIBRARY}
> +)

As above, I think you can drop the explicit linking to
OPENGL_gl_LIBRARY. And you can definitiely drop the explicit linking to
OPENGL_glu_LIBRARY.

> +
> +piglit_add_executable(khr_compressed_astc-miptree_${piglit_target_api} 
> khr_compressed_astc-miptree.c)
> +
> +# vim: ft=cmake:
> diff --git a/tests/spec/khr_texture_compression_astc/CMakeLists.gles2.txt 
> b/tests/spec/khr_texture_compression_astc/CMakeLists.gles2.txt
> new file mode 100644
> index 000..047b8ac
> --- /dev/null
> +++ b/tests/spec/khr_texture_compression_astc/CMakeLists.gles2.txt
> @@ -0,0 +1,8 @@
> +include_directories(
> + ${GLEXT_INCLUDE_DIR}
> + ${OPENGL_INCLUDE_PATH}
> +)

As for CMakeLists.gl.txt, I think you should drop this call
include_directories if Piglit can build without it.

> +link_libraries(piglitutil_${piglit_target_api})
> +piglit_add_executable(khr_compressed_astc-miptree_${piglit_target_api} 
> khr_compressed_astc-miptree.c)
> +
> +# vim: ft=cmake:


> diff --git 
> a/tests/spec/khr_texture_compression_astc/khr_compressed_astc-miptree.c 
> b/tests/spec/khr_texture_compression_astc/khr_compressed_astc-miptree.c
> new file mode 100644
> index 000..a804b9b
> --- /dev/null
> +++ b/tests/spec/khr_texture_compression_astc/khr_compressed_astc-miptree.c

> +/**
> + * \file
> + * \brief Test texturing from an ASTC miptree of a real image.
> + *
> + * This test is an adaptation of the oes_compressed_etc1_rgb8_textures test.
> + *
> + * This test uses eighty-four data files. The files under compressed/ contain
 ^^^
Remove "eighty-four" from the comment. It puts the comment at high risk
of becoming stale.

> + * full miptrees, in the GL_*_ASTC_* formats, of a 2D texture of waffles and
> + * fruit [1].  The base level size was shrunken to 160x106 pixels. The files
> + * under the decompressed directory contain the same miptree in GL_RGBA
> + * format. Each miplevel was obtained by decompressing the corresponding ASTC
> + * texture with astcenc [2].
> + *
> + * This test draws miplevels of the compressed textures according to the
> + * MIPLAYOUT_BELOW organization scheme. It does the same when drawing
  ^^^

MIPLAYOUT_BELOW is a term specific to Intel hardware that no one but
Intel miptree ninjas like yourself will recognize. (In several more years,
perhaps *no one* will recognize it, because
MIPLAYOUT_BELOW/MIPLAYOUT_THE_OTHER_ONE was configurable only on legacy
hardware). If you want to describe the test's image layout, draw
a little ASCII diagram instead.

> + * the decompressed texture on the right. Each miplevel of both images are
> + * compared for equality after each level is drawn.
^
drawn
> + *
> + * [1] The reference image is located at 
> http://people.freedesktop.org/~chadversary/permalink/2012-07-09/1574cff2-d091-4421-a3cf-b56c7943d060.jpg.
> + * [2] astcenc is the reference ASTC compression tool, available at 
> http://malideveloper.arm.com/develop-for-mali/tools/software-tools/astc-evaluation-codec/.
> + */
> +
> +#include "piglit-util-gl.h"
> +#include "piglit_ktx.h"
> +
> +#define num_levels 8
> +#define level0_width 160
> +#define level0_height 106
> +
> +#define num_vertices 4

To comply with Piglit's code style, the macros above should ALL_CAPS.

> +
> +static GLuint prog;
> +
> +static struct piglit_gl_test_config *piglit_config;
> +
> +typedef struct _test_data

The struct tag '_test_data' is nowhere used, and so should be removed.

> +{
> + bool hdr_test;
> + bool srgb_test;
> +} test_data;

More importantly, this struct should be converted to an enum.
Each field of the struct is already pairwise mutually exclusive. And the
struct contains an implicit 3rd field, ldr_test, which occurs when
!(hdr_test || sgrb_test). Therefore this enum is a good replacement:

enum test_type {
TEST_TYPE_LDR,
TEST_TYPE_HDR,

[Piglit] [PATCH] arb_vertex_program: Verify that unsupported functions generate errors

2015-09-09 Thread Ian Romanick
From: Ian Romanick 

Once upon a time, Mesa accidentally enable GL_ARB_vertex_program in Core
Profile.  We fixed that, but continued to export the functions.  We
eventually fixed that too.  It turns out that, especially in the piglit
framework, it's really hard to verify that a function is not there.

The piglit framework will detect that a function is being called that is
not supported by the implementation, and it will print a friendly
message.  We don't want that.  We want to call the function specifically
because we know it's not supported.  As a result, glXGetProcAddress has
to be used directly.

Using glXGetProcAddress poses two problems.  First, it can either return
NULL or it can return a pointer to a dispatch trampoile function.  Some
closed-source libGL implementations will return NULL for functions that
they and the associated drivers have never heard of.  The open-source
libGL implementations will never return NULL because the application
might later load a new driver that supports the requested function.  Try
glXGetProcAddress((const GLubyte *)"glHamsandwich") on your favorite
libGL.

Second, the trampoline function may or may not call a valid function.
Depending on the driver and the libGL the dispatch table entry used by
the trampoline function may:

1. Point at garbage.

2. Point at a default function that always sets GL_INVALID_OPERATION.

3. Point at a real implementation of the function that may or may not
set GL_INVALID_OPERATION.

The only way to determine which you've got is by calling the trampoline
function.  In case #1, this will result in some signal (probably either
SIGSEGV or SIGLL) that leads to program termination.  By the definition
of the GL spec, this is actually success, so crashing is not a good way
to reflect that.  To deal with this a combination of signal and
sigsetjmp are used.

For each function to be tested,

1. Call glXGetProcAddress on the function.  If glXGetProcAddress returns
NULL, the function passes.

2. Set signal handlers for every reasonable signal that calling outer
space might generate.  The signal handler will siglongjmp back to the
caller.

3. Use sigsetjmp to set the location to which the signal handler should
return.

4. Call the function.  If GL_INVALID_OPERATION is set, the function
passes.  If the signal handler is invoked, the call to glGetError will
never happen.  If any other condition is set, the function fails.

This particular test only calls a subset of the GL_ARB_vertex_program
functions.  The remaining functions require that a valid vertex program
be bound.  If all the functions included in this test are successful,
either the functions would be too (with possible false positives) or an
api-errors test should detect their failures.  Either way, I didn't see
much point in trying them.

Signed-off-by: Ian Romanick 
---
 tests/all.py|   1 +
 tests/spec/arb_vertex_program/CMakeLists.gl.txt |   4 +
 tests/spec/arb_vertex_program/unsupported.c | 111 
 3 files changed, 116 insertions(+)
 create mode 100644 tests/spec/arb_vertex_program/unsupported.c

diff --git a/tests/all.py b/tests/all.py
index a1eba91..a44ceb8 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -2643,6 +2643,7 @@ with profile.group_manager(
 g(['vp-address-04'], run_concurrent=False)
 g(['vp-bad-program'], run_concurrent=False)
 g(['vp-max-array'], run_concurrent=False)
+g(['arb_vertex_program-unsupported'], 'unsupported')
 
 with profile.group_manager(
 PiglitGLTest,
diff --git a/tests/spec/arb_vertex_program/CMakeLists.gl.txt 
b/tests/spec/arb_vertex_program/CMakeLists.gl.txt
index 197b20e..fb3339a 100644
--- a/tests/spec/arb_vertex_program/CMakeLists.gl.txt
+++ b/tests/spec/arb_vertex_program/CMakeLists.gl.txt
@@ -9,6 +9,10 @@ link_libraries (
${OPENGL_glu_LIBRARY}
 )
 
+IF(PIGLIT_BUILD_GLX_TESTS)
+piglit_add_executable (arb_vertex_program-unsupported unsupported.c)
+ENDIF(PIGLIT_BUILD_GLX_TESTS)
+
 piglit_add_executable (arb_vertex_program-getenv4d-with-error 
getenv4d-with-error.c)
 piglit_add_executable (arb_vertex_program-getlocal4d-with-error 
getlocal4d-with-error.c)
 piglit_add_executable (arb_vertex_program-getlocal4f-max getlocal4f-max.c)
diff --git a/tests/spec/arb_vertex_program/unsupported.c 
b/tests/spec/arb_vertex_program/unsupported.c
new file mode 100644
index 000..f2cf039
--- /dev/null
+++ b/tests/spec/arb_vertex_program/unsupported.c
@@ -0,0 +1,111 @@
+/*
+ * 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, 

Re: [Piglit] [PATCH] framework/summary.py: Always print number of changes in console mode

2015-09-09 Thread Tom Stellard
On Wed, Sep 09, 2015 at 01:23:22PM -0700, Dylan Baker wrote:
> On Wed, Sep 09, 2015 at 03:57:55PM -0400, Tom Stellard wrote:
> > On Wed, Sep 09, 2015 at 12:52:22PM -0700, Dylan Baker wrote:
> > > > I have a buildbot seti up to run piglit and the way it detects whether
> > > > or no there have been piglit regressions is by running piglit summary
> > > > console and then parsing the output.
> > > > 
> > > > The CSV summary seems to only accept a single result file, unless I'm
> > > > doing something wrong:
> > > > 
> > > > tstellar@localhost ~/piglit $ ./piglit summary csv  -o out.csv 
> > > > results/master--150727-/ results/master-BONAIRE-150223-/
> > > > usage: piglit [-h] [-o ] 
> > > > piglit: error: unrecognized arguments: results/master-BONAIRE-150223-/
> > > > 
> > > > -Tom
> > > 
> > > Are you just wanting to see if there are regressions, or do you want to
> > > get a count and the tests that regressed as well?
> > 
> > What I want is a list of changes, and yes/no for regressions.  The
> > number of regressions does not matter. `piglit/piglit summary console
> > -d` gives me a list of changes and prints the summary so I can check
> > if there were regressions.
> > 
> > Another solution I considered was to add an exit status to piglit
> > summary to indicate whether or not there were regressions.  This would
> > be the best solution, but I wasn't sure if this would break other
> > people's use cases.
> > 
> > -Tom
> 
> I think with my changes it would be trivial to add a '-r/--regressions'
> mode to piglit summary that would print only regressions in the change
> list, and could have an exit status for whether there were regressions
> or not.
> 

For me I would still like to see all changes: fixes and regressions but
have the exit code based on whether or not there are regressions.
So, I'm not sure a -r flag would be that useful for me.

-Tom

> I'll add an extra patch to my series.
> 
> Dylan


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


Re: [Piglit] [PATCH] Porting basic GL rendering tests from Glean to Piglit. Test replaces original glean tpaths.cpp test.

2015-09-09 Thread Brian Paul

The first line of the commit message should be a short summary:

"Port basic GL rendering test from Glean to Piglit"

Then, the body of the comment can have more information:

"This test replaces the original glean tpaths.cpp test."



On 09/08/2015 05:35 PM, Juliet Fru wrote:

---
  tests/all.py|   1 +
  tests/spec/gl-1.0/CMakeLists.gl.txt |   1 +
  tests/spec/gl-1.0/no-op-paths.c | 292 
  3 files changed, 294 insertions(+)
  create mode 100644 tests/spec/gl-1.0/no-op-paths.c

diff --git a/tests/all.py b/tests/all.py
index fcfc5cd..85973d6 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -1000,6 +1000,7 @@ with profile.group_manager(
  g(['gl-1.0-ortho-pos'])
  g(['gl-1.0-readpixsanity'])
  g(['gl-1.0-logicop'])
+g(['gl-1.0-no-op-paths'])

  with profile.group_manager(
  PiglitGLTest,
diff --git a/tests/spec/gl-1.0/CMakeLists.gl.txt 
b/tests/spec/gl-1.0/CMakeLists.gl.txt
index d04b835..7a7f508 100644
--- a/tests/spec/gl-1.0/CMakeLists.gl.txt
+++ b/tests/spec/gl-1.0/CMakeLists.gl.txt
@@ -22,6 +22,7 @@ piglit_add_executable (gl-1.0-front-invalidate-back 
front-invalidate-back.c)
  piglit_add_executable (gl-1.0-logicop logicop.c)
  piglit_add_executable (gl-1.0-long-dlist long-dlist.c)
  piglit_add_executable (gl-1.0-ortho-pos orthpos.c)
+piglit_add_executable (gl-1.0-no-op-paths no-op-paths.c)
  piglit_add_executable (gl-1.0-polygon-line-aa polygon-line-aa.c)
  piglit_add_executable (gl-1.0-push-no-attribs push-no-attribs.c)
  piglit_add_executable (gl-1.0-readpixsanity readpix.c)
diff --git a/tests/spec/gl-1.0/no-op-paths.c b/tests/spec/gl-1.0/no-op-paths.c
new file mode 100644
index 000..0925a8d
--- /dev/null
+++ b/tests/spec/gl-1.0/no-op-paths.c
@@ -0,0 +1,292 @@
+/*  BEGIN_COPYRIGHT -*- glean -*-
+ *
+ *  Copyright (C) 1999  Allen Akin   All Rights Reserved.
+ *  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.
+ *
+ *  END_COPYRIGHT
+ */
+/** @file paths.c
+ *
+ *  Test basic GL rendering paths.
+ *
+ *
+ * Based on the original Glean tpaths.cpp test, this test verifies
+ * that basic, trival OpenGL paths work as expected. For example,
+ * glAlphaFunc(GL_GEQUAL, 0.0) should always pass and
+ * glAlphaFunc(GL_LESS, 0.0) should always fail.  We setup trivial
+ * pass and fail conditions for each of alpha test, blending, color mask,
+ * depth test, logic ops, scissor, stencil, stipple, and texture and
+ * make sure they work as expected.  We also setup trival-pass for all
+ * these paths simultaneously and test that as well.
+ *
+ * To test for pass/fail we examine the color buffer for white or black,
+ * respectively.
+ *
+ * Authors:
+ * Brian Paul 
+ * Adapted to Piglit by Juliet Fru , August 2015.
+ */
+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN config.supports_gl_compat_version = 10;
+
+config.window_visual = PIGLIT_GL_VISUAL_RGBA |
+   PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_DEPTH |
+   PIGLIT_GL_VISUAL_STENCIL;
+
+PIGLIT_GL_TEST_CONFIG_END enum path
+{
+   ALPHA,
+   BLEND,
+   COLOR_MASK,
+   DEPTH,
+   LOGIC,
+   SCISSOR,
+   STENCIL,
+   STIPPLE,
+   TEXTURE,
+   NUM_PATHS   /* end-of-list token */
+};
+
+enum state
+{
+   DISABLE,
+   ALWAYS_PASS,
+   ALWAYS_FAIL
+};
+
+const char *
+path_name(enum path paths)
+{
+   switch (paths) {
+   case ALPHA:
+   return "Alpha Test";
+   case BLEND:
+   return "Blending";
+   case COLOR_MASK:
+   return "Color Mask";
+   case DEPTH:
+   return "Depth Test";
+   case LOGIC:
+   return "LogicOp";
+   case SCISSOR:
+   return "Scissor Test";
+   case STENCIL:
+   return 

Re: [Piglit] [PATCH] Porting arb occlusion query conformance tests from Glean to Piglit.

2015-09-09 Thread Brian Paul

On 09/08/2015 05:28 PM, Juliet Fru wrote:

---
  tests/all.py   |   1 +
  tests/spec/arb_occlusion_query/CMakeLists.gl.txt   |   1 +
  .../arb_occlusion_query/occlusion_query_conform.c  | 609 +
  3 files changed, 611 insertions(+)
  create mode 100644 tests/spec/arb_occlusion_query/occlusion_query_conform.c

diff --git a/tests/all.py b/tests/all.py
index fe088f5..748165f 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -2115,6 +2115,7 @@ with profile.group_manager(
  PiglitGLTest,
  grouptools.join('spec', 'ARB_occlusion_query')) as g:
  g(['occlusion_query'])
+g(['occlusion_query_conformance'])
  g(['occlusion_query_lifetime'])
  g(['occlusion_query_meta_fragments'])
  g(['occlusion_query_meta_no_fragments'])
diff --git a/tests/spec/arb_occlusion_query/CMakeLists.gl.txt 
b/tests/spec/arb_occlusion_query/CMakeLists.gl.txt
index 01a499d..23a19e4 100644
--- a/tests/spec/arb_occlusion_query/CMakeLists.gl.txt
+++ b/tests/spec/arb_occlusion_query/CMakeLists.gl.txt
@@ -10,6 +10,7 @@ link_libraries (
  )

  piglit_add_executable (occlusion_query occlusion_query.c)
+piglit_add_executable (occlusion_query_conformance occlusion_query_conform.c)
  piglit_add_executable (occlusion_query_lifetime occlusion_query_lifetime.c)
  piglit_add_executable (occlusion_query_meta_no_fragments 
occlusion_query_meta_no_fragments.c)
  piglit_add_executable (occlusion_query_meta_fragments 
occlusion_query_meta_fragments.c)
diff --git a/tests/spec/arb_occlusion_query/occlusion_query_conform.c 
b/tests/spec/arb_occlusion_query/occlusion_query_conform.c
new file mode 100644
index 000..94da232
--- /dev/null
+++ b/tests/spec/arb_occlusion_query/occlusion_query_conform.c
@@ -0,0 +1,609 @@
+/*  BEGIN_COPYRIGHT -*- glean -*-
+ *
+ *  Copyright (C) 1999  Allen Akin   All Rights Reserved.
+ *  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.
+ *
+ * END_COPYRIGHT
+ */
+
+/** @file occlusion_query_conform.c
+ *
+ * Conformance test on ARB_occlusion_query extension.
+ *
+ * Authors:
+ * Wei Wang 
+ * Adapted to Piglit by Juliet Fru , September 2015
+ */
+
+#include "piglit-util-gl.h"
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+PIGLIT_GL_TEST_CONFIG_BEGIN config.supports_gl_compat_version = 10;
+
+
+config.window_width = 160;
+config.window_height = 160;


Is that window size a requirement?  We've been trying to avoid 
specifying a specific window size in most tests.




+config.window_visual =
+   PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE |
+   PIGLIT_GL_VISUAL_DEPTH;
+
+PIGLIT_GL_TEST_CONFIG_END


Insert a blank line or two here.



+/* Generate a box which will be occluded by the occluder */
+   static void
+gen_box(GLfloat left, GLfloat right, GLfloat top, GLfloat btm)
+{
+   piglit_draw_rect(right, top, left + right, top + btm);
+}


How about just replacing all the calls to gen_box() with calls to 
piglit_draw_rect() instead?




+
+static GLuint
+find_unused_id(void)
+{
+   GLuint id;
+   glGenQueries(1, );
+   return id;
+
+}
+
+/* If multiple queries are issued on the same target and id prior to calling
+ * GetQueryObject[u]iVARB, the result returned will always be from the last
+ * query issued.  The results from any queries before the last one will be lost
+ * if the results are not retrieved before starting a new query on the same
+ * target and id.
+ */
+bool
+conformOQ_GetObjivAval_multi1(GLuint id)


This function and the rest can be declared static.



+{
+   GLint ready;
+   GLuint passed = 0;
+
+   glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+   glMatrixMode(GL_PROJECTION);
+   glPushMatrix();
+   glLoadIdentity();
+   glOrtho(-1.0, 1.0, -1.0, 1.0, 0.0, 25.0);
+
+   

Re: [Piglit] [PATCH] framework/summary.py: Always print number of changes in console mode

2015-09-09 Thread Dylan Baker
Reviewed-by: Dylan Baker 

On a related note, I have a series that seriously overhauls the summary
code, including fixing the console/text summary, producing a column for
each result. It does include changes, fixes, and regressions in all
cases like this patch. I'm hoping to have that cleaned up and on the
list today.

On a tangent, why are you parsing the output of this, it seems like the
CSV summary would be easier to pass to another script than this, which
is volatile.

Dylan

On Wed, Sep 09, 2015 at 12:28:21PM +, Tom Stellard wrote:
> The counts for changes, fixes, and regressions are now reported as zero
> when no changes are detect rather than being omitted from the output.
> 
> This makes it easier for scripts to parse the output of piglit summary
> console, becuase now when there are no regressions piglit always
> outputs:
> 
> regressions: 0
> 
> Before when there where no regressions, piglit would either print no
> regression line or it would print 'regressions: 0'
> ---
>  framework/summary.py | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/framework/summary.py b/framework/summary.py
> index 80cb181..e56c0f2 100644
> --- a/framework/summary.py
> +++ b/framework/summary.py
> @@ -604,7 +604,10 @@ class Summary:
>"  fixes: {fixes}\n"
>"regressions: {regressions}".format(
>**{k: len(v) for k, v in self.tests.iteritems()}))
> -
> +else:
> +print("changes: 0\n"
> +  "  fixes: 0\n"
> +  "regressions: 0")
>  print("  total: {}".format(sum(self.totals.itervalues(
>  
>  # Print the name of the test and the status from each test run
> -- 
> 2.0.4
> 
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit


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


Re: [Piglit] [PATCH] Add a biased variants of a textureLod() miplevel tests

2015-09-09 Thread Brian Paul

On 09/09/2015 03:59 AM, Krzesimir Nowak wrote:

These tests have the same purpose as the
{vs,fs}-textureLod-miplevels.shader_test ones. These are actually a
slightly modified copies of those. The modifications are setting the
lod_bias parameter to 1.0 and updating the expected colors in probes.

This exposes a bug in softpipe, where it does not take lod_bias into
account, so the colors returned in these tests are the same as in
unbiased versions.
---
  .../fs-textureLod-miplevels-biased.shader_test | 196 +
  .../vs-textureLod-miplevels-biased.shader_test | 196 +
  2 files changed, 392 insertions(+)
  create mode 100644 
tests/spec/glsl-1.30/execution/fs-textureLod-miplevels-biased.shader_test
  create mode 100644 
tests/spec/glsl-1.30/execution/vs-textureLod-miplevels-biased.shader_test



Reviewed-by: Brian Paul 

I verified that the tests pass on NVIDIA too.

I'll commit this patch for you (AFAIK, you don't have git write ability).

-Brian


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


[Piglit] [PATCH 07/14] arb_direct_state_access: Port dsa-textures to core profile

2015-09-09 Thread Ian Romanick
From: Ian Romanick 

The "supports_gl_compat_version = 13" was rubbish anyway because DSA
requires OpenGL 2.0.

Signed-off-by: Ian Romanick 
---
 tests/spec/arb_direct_state_access/dsa-textures.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/spec/arb_direct_state_access/dsa-textures.c 
b/tests/spec/arb_direct_state_access/dsa-textures.c
index 29661c0..401c29f 100644
--- a/tests/spec/arb_direct_state_access/dsa-textures.c
+++ b/tests/spec/arb_direct_state_access/dsa-textures.c
@@ -33,7 +33,8 @@
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
-   config.supports_gl_compat_version = 13;
+   config.supports_gl_core_version = 31;
+   config.supports_gl_compat_version = 20;
 
config.window_visual = PIGLIT_GL_VISUAL_RGBA |
PIGLIT_GL_VISUAL_DOUBLE;
@@ -83,7 +84,6 @@ piglit_display(void)
 
/* Draw the image */
dsa_texture_with_unit(prog, texunit);
-   glEnable(GL_TEXTURE_2D);
glUseProgram(prog);
glBindTextureUnit(texunit, name);
pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
-- 
2.1.0

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


[Piglit] [PATCH 00/14] Make nearly all the DSA tests actually run on Mesa

2015-09-09 Thread Ian Romanick
I've had these sitting in my local tree for about three and a half
months.  I guess I should send them out. :)

Mesa only exposes GL_ARB_direct_state_access in Core Profile contexts.
However, almost all of our DSA tests only run in Compatibility Profile.
This series ports almost all of the DSA tests to run on both profiles.
With these changes, a Broadwell GPU will only skip:

create-programpipelines
default TCS == 0
default TES == 0
default compute shader program == 0
gettextureimage-formats
gettextureimage-formats init-by-rendering
gettextureimage-luminance 

Tessellation shaders and compute shaders are not supported yet, so that
explains the create-programpipelines skips.  Luminance textures were
removed from Core Profile, so that explains the
gettextureimage-luminance skip.  Patch 14 explains the
gettextureimage-formats skips.

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


[Piglit] [PATCH 09/14] arb_direct_state_access: Port getcompressedtextureimage to core profile

2015-09-09 Thread Ian Romanick
From: Ian Romanick 

The "supports_gl_compat_version = 10" was rubbish anyway because DSA
requires OpenGL 2.0.

Since cube maps are required since OpenGL 1.3, the test for it is no
longer needed.  In fact, Mesa does not advertise this extension in core
profile (because duh), so checking for it is harmful.

Signed-off-by: Ian Romanick 
---
 tests/spec/arb_direct_state_access/CMakeLists.gl.txt   |  2 +-
 .../arb_direct_state_access/getcompressedtextureimage.c| 14 +-
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt 
b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
index 8ed5417..9351c66 100644
--- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
+++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
@@ -29,7 +29,7 @@ piglit_add_executable 
(arb_direct_state_access-gettextureimage-formats gettextur
 piglit_add_executable (arb_direct_state_access-gettextureimage-luminance 
gettextureimage-luminance.c)
 piglit_add_executable (arb_direct_state_access-gettextureimage-targets 
gettextureimage-targets.c)
 piglit_add_executable (arb_direct_state_access-compressedtextureimage 
compressedtextureimage.c)
-piglit_add_executable (arb_direct_state_access-getcompressedtextureimage 
getcompressedtextureimage.c)
+piglit_add_executable (arb_direct_state_access-getcompressedtextureimage 
getcompressedtextureimage.c dsa-utils.c)
 piglit_add_executable (arb_direct_state_access-texture-storage-multisample 
texture-storage-multisample.c)
 piglit_add_executable (arb_direct_state_access-texture-buffer texture-buffer.c)
 piglit_add_executable (arb_direct_state_access-create-samplers 
create-samplers.c)
diff --git a/tests/spec/arb_direct_state_access/getcompressedtextureimage.c 
b/tests/spec/arb_direct_state_access/getcompressedtextureimage.c
index 60e8d03..28e4027 100644
--- a/tests/spec/arb_direct_state_access/getcompressedtextureimage.c
+++ b/tests/spec/arb_direct_state_access/getcompressedtextureimage.c
@@ -26,11 +26,12 @@
  * @file getcompressedtextureimage.c
  */
 #include "piglit-util-gl.h"
+#include "dsa-utils.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
config.window_width = 216;
-   config.supports_gl_compat_version = 10;
+   config.supports_gl_compat_version = 20;
config.supports_gl_core_version = 31;
 
config.window_visual = PIGLIT_GL_VISUAL_RGBA |
@@ -49,15 +50,19 @@ show_image(GLubyte *data, int num_layers, const char *title)
GLuint name;
int i;
char junk[50];
+   GLuint prog = 0;
 
if (!piglit_automatic) {
+   prog = dsa_create_program(GL_TEXTURE_2D);
+   glUseProgram(prog);
+   dsa_set_xform(prog, piglit_width, piglit_height);
+
/* Create the texture handle. */
glCreateTextures(GL_TEXTURE_2D, 1, );
glTextureStorage2D(name, 1, GL_RGBA8, IMAGE_WIDTH,
IMAGE_HEIGHT);
glTextureParameteri(name, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTextureParameteri(name, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-   glEnable(GL_TEXTURE_2D);
glBindTextureUnit(0, name);
 
/* Draw the layers, separated by some space */
@@ -84,6 +89,8 @@ show_image(GLubyte *data, int num_layers, const char *title)
printf("\n");
 
glDeleteTextures(1, );
+   glUseProgram(0);
+   glDeleteProgram(prog);
}
 }
 
@@ -352,15 +359,12 @@ piglit_init(int argc, char **argv)
piglit_require_extension("GL_ARB_direct_state_access");
piglit_require_extension("GL_ARB_texture_storage");
 
-   if (!piglit_is_extension_supported("GL_ARB_texture_cube_map"))
-   clear_target_mask(GL_TEXTURE_CUBE_MAP);
if (!piglit_is_extension_supported("GL_EXT_texture_array"))
clear_target_mask(GL_TEXTURE_2D_ARRAY);
if (!piglit_is_extension_supported("GL_ARB_texture_cube_map_array"))
clear_target_mask(GL_TEXTURE_CUBE_MAP_ARRAY);
 
glClearColor(0.5, 0.5, 0.5, 1);
-   piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
 }
 
 enum piglit_result
-- 
2.1.0

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


[Piglit] [PATCH 05/14] arb_direct_state_access: Port texturesubimage to core profile

2015-09-09 Thread Ian Romanick
From: Ian Romanick 

The "supports_gl_compat_version = 10" was rubbish anyway because DSA
requires OpenGL 2.0.

Signed-off-by: Ian Romanick 
---
 tests/spec/arb_direct_state_access/CMakeLists.gl.txt |  2 +-
 tests/spec/arb_direct_state_access/texturesubimage.c | 16 +++-
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt 
b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
index 11af64e..d92eefc 100644
--- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
+++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
@@ -16,7 +16,7 @@ piglit_add_executable 
(arb_direct_state_access-gettransformfeedback gettransform
 piglit_add_executable (arb_direct_state_access-create-renderbuffers 
create-renderbuffers.c)
 piglit_add_executable (arb_direct_state_access-namedrenderbuffer 
namedrenderbuffer.c)
 piglit_add_executable (arb_direct_state_access-dsa-textures dsa-textures.c 
dsa-utils.c)
-piglit_add_executable (arb_direct_state_access-texturesubimage 
texturesubimage.c)
+piglit_add_executable (arb_direct_state_access-texturesubimage 
texturesubimage.c dsa-utils.c)
 piglit_add_executable (arb_direct_state_access-bind-texture-unit 
bind-texture-unit.c)
 piglit_add_executable (arb_direct_state_access-create-textures 
create-textures.c)
 piglit_add_executable (arb_direct_state_access-texture-storage 
texture-storage.c)
diff --git a/tests/spec/arb_direct_state_access/texturesubimage.c 
b/tests/spec/arb_direct_state_access/texturesubimage.c
index a1c1ce0..f21d9e4 100644
--- a/tests/spec/arb_direct_state_access/texturesubimage.c
+++ b/tests/spec/arb_direct_state_access/texturesubimage.c
@@ -33,10 +33,12 @@
 #include "piglit-util-gl.h"
 #include 
 #include 
+#include "dsa-utils.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
-   config.supports_gl_compat_version = 10;
+   config.supports_gl_core_version = 31;
+   config.supports_gl_compat_version = 20;
 
config.window_visual = PIGLIT_GL_VISUAL_RGBA |
   PIGLIT_GL_VISUAL_DOUBLE;
@@ -62,6 +64,9 @@ subtest(GLenum target)
 {
bool pass = true;
GLuint tex;
+   GLuint prog;
+
+   prog = dsa_create_program(target);
 
/* Draw the reference image. */
glCreateTextures(target, 1, );
@@ -85,10 +90,10 @@ subtest(GLenum target)
refImg);
}
 
+   glUseProgram(prog);
glBindTextureUnit(0, tex);
-   glEnable(target);
glClear(GL_COLOR_BUFFER_BIT);
-   piglit_draw_rect_tex(0, 0, piglit_width, piglit_height, 0, 0, 1, 1);
+   piglit_draw_rect_tex(-1.0, -1.0, 2.0, 2.0, 0.0, 0.0, 1.0, 1.0);
if (target == GL_TEXTURE_1D) {
pass = piglit_probe_image_ubyte(0, 0, piglit_width, 1,
 GL_RGBA, refImg)
@@ -100,6 +105,9 @@ subtest(GLenum target)
&& pass;
}
 
+   glUseProgram(0);
+   glDeleteProgram(prog);
+
if (!piglit_automatic)
piglit_present_results();
 
@@ -139,8 +147,6 @@ piglit_init(int argc, char **argv)
 
srand(0);
 
-   piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
-
/* Make the image data for testing. */
refImg = random_image_data(piglit_width, piglit_height, depth);
 }
-- 
2.1.0

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


[Piglit] [PATCH 10/14] arb_direct_state_access: Port texture-storage-multisample to core profile

2015-09-09 Thread Ian Romanick
From: Ian Romanick 

The "supports_gl_compat_version = 13" was rubbish anyway because DSA
requires OpenGL 2.0.  There's probably some other save/restore code in
texture_sub_image_multisample that could be removed, but I don't think
it's worth the effort right now.

Signed-off-by: Ian Romanick 
---
 .../arb_direct_state_access/texture-storage-multisample.c | 11 +++
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/tests/spec/arb_direct_state_access/texture-storage-multisample.c 
b/tests/spec/arb_direct_state_access/texture-storage-multisample.c
index 0069612..3486a21 100644
--- a/tests/spec/arb_direct_state_access/texture-storage-multisample.c
+++ b/tests/spec/arb_direct_state_access/texture-storage-multisample.c
@@ -34,7 +34,7 @@
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
-   config.supports_gl_compat_version = 13;
+   config.supports_gl_core_version = 31;
 
config.window_visual = PIGLIT_GL_VISUAL_RGBA |
   PIGLIT_GL_VISUAL_DOUBLE;
@@ -43,7 +43,7 @@ PIGLIT_GL_TEST_CONFIG_END
 
 /* This has the modelview matrix built in. */
 static const char multisample_texture_vs_source[] =
-   "#version 130\n"
+   "#version 140\n"
"in vec2 piglit_vertex;\n"
"out vec2 tex_coords;\n"
"void main()\n"
@@ -55,7 +55,7 @@ static const char multisample_texture_vs_source[] =
;
 
 static const char multisample_texture_fs_source[] =
-   "#version 130\n"
+   "#version 140\n"
"#extension GL_ARB_sample_shading : enable\n"
"in vec2 tex_coords;\n"
"uniform sampler2DArray tex;\n"
@@ -149,7 +149,6 @@ texture_sub_image_multisample(GLenum tex, GLenum target,
glGetIntegerv(GL_ACTIVE_TEXTURE, _tex);
glGetIntegerv(GL_CURRENT_PROGRAM, );
glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, _fbo);
-   glGetIntegerv(GL_CLAMP_FRAGMENT_COLOR, _fragment_color);
glGetIntegerv(GL_VIEWPORT, backup.viewport);
glGetBooleanv(GL_SAMPLE_SHADING_ARB, _sample_shading);
glGetFloatv(GL_MIN_SAMPLE_SHADING_VALUE_ARB, 
_sample_shading);
@@ -171,8 +170,6 @@ texture_sub_image_multisample(GLenum tex, GLenum target,
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo);
glViewport(0, 0, width, height);
 
-   glClampColor(GL_CLAMP_FRAGMENT_COLOR, GL_FALSE);
-
glUseProgram(prog);
glUniform1i(tex_loc, backup.active_tex - GL_TEXTURE0);
glUniform1i(tex_depth_loc, depth);
@@ -216,7 +213,6 @@ texture_sub_image_multisample(GLenum tex, GLenum target,
glViewport(backup.viewport[0], backup.viewport[1],
   backup.viewport[2], backup.viewport[3]);
glBindTexture(target, tex);
-   glClampColor(GL_CLAMP_FRAGMENT_COLOR, backup.clamp_fragment_color);
 }
 
 static bool
@@ -363,7 +359,6 @@ draw_multisampled(void)
/* Draw the image. Can't use piglit_draw_rect_tex because the OpenGL
 * 1.0 pipeline doesn't handle multisample textures.
 */
-   piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
glGenFramebuffers(1, );
glBindFramebuffer(GL_READ_FRAMEBUFFER, fbo);
glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
-- 
2.1.0

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


[Piglit] [PATCH 02/14] arb_direct_state_access: Port gettextureimage-targets to core profile

2015-09-09 Thread Ian Romanick
From: Ian Romanick 

The "supports_gl_compat_version = 10" was rubbish anyway because DSA
requires OpenGL 2.0.

Signed-off-by: Ian Romanick 
---
 tests/spec/arb_direct_state_access/gettextureimage-targets.c | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/tests/spec/arb_direct_state_access/gettextureimage-targets.c 
b/tests/spec/arb_direct_state_access/gettextureimage-targets.c
index 01ccad4..9fbe3c8 100644
--- a/tests/spec/arb_direct_state_access/gettextureimage-targets.c
+++ b/tests/spec/arb_direct_state_access/gettextureimage-targets.c
@@ -30,7 +30,7 @@
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
-   config.supports_gl_compat_version = 10;
+   config.supports_gl_compat_version = 20;
config.supports_gl_core_version = 31;
 
config.window_visual = PIGLIT_GL_VISUAL_RGBA |
@@ -256,12 +256,8 @@ piglit_init(int argc, char **argv)
piglit_require_extension("GL_ARB_direct_state_access");
piglit_require_extension("GL_ARB_texture_storage");
 
-   if (piglit_get_gl_version() < 12)
-   clear_target_mask(GL_TEXTURE_3D);
if (!piglit_is_extension_supported("GL_ARB_texture_rectangle"))
clear_target_mask(GL_TEXTURE_RECTANGLE);
-   if (!piglit_is_extension_supported("GL_ARB_texture_cube_map"))
-   clear_target_mask(GL_TEXTURE_CUBE_MAP);
if (!piglit_is_extension_supported("GL_EXT_texture_array")) {
clear_target_mask(GL_TEXTURE_1D_ARRAY);
clear_target_mask(GL_TEXTURE_2D_ARRAY);
-- 
2.1.0

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


[Piglit] [PATCH 01/14] arb_direct_state_access: Trivially port several tests to core profile

2015-09-09 Thread Ian Romanick
From: Ian Romanick 

The "supports_gl_compat_version = 13" was rubbish anyway because DSA
requires OpenGL 2.0.

Note: bind-texture-unit still fails on Mesa.

Signed-off-by: Ian Romanick 
---
 tests/spec/arb_direct_state_access/bind-texture-unit.c | 3 ++-
 tests/spec/arb_direct_state_access/create-textures.c   | 3 ++-
 tests/spec/arb_direct_state_access/get-textures.c  | 2 +-
 tests/spec/arb_direct_state_access/texture-params.c| 3 ++-
 4 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/tests/spec/arb_direct_state_access/bind-texture-unit.c 
b/tests/spec/arb_direct_state_access/bind-texture-unit.c
index fdca1bf..1ccbd36 100644
--- a/tests/spec/arb_direct_state_access/bind-texture-unit.c
+++ b/tests/spec/arb_direct_state_access/bind-texture-unit.c
@@ -32,7 +32,8 @@
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
-   config.supports_gl_compat_version = 13;
+   config.supports_gl_core_version = 31;
+   config.supports_gl_compat_version = 20;
 
config.window_visual = PIGLIT_GL_VISUAL_RGBA | 
PIGLIT_GL_VISUAL_DOUBLE;
diff --git a/tests/spec/arb_direct_state_access/create-textures.c 
b/tests/spec/arb_direct_state_access/create-textures.c
index 6ce5bb3..ca6d43c 100644
--- a/tests/spec/arb_direct_state_access/create-textures.c
+++ b/tests/spec/arb_direct_state_access/create-textures.c
@@ -32,7 +32,8 @@
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
-   config.supports_gl_compat_version = 13;
+   config.supports_gl_core_version = 31;
+   config.supports_gl_compat_version = 20;
 
config.window_visual = PIGLIT_GL_VISUAL_RGBA | 
PIGLIT_GL_VISUAL_DOUBLE;
diff --git a/tests/spec/arb_direct_state_access/get-textures.c 
b/tests/spec/arb_direct_state_access/get-textures.c
index b9441cf..98d26fc 100644
--- a/tests/spec/arb_direct_state_access/get-textures.c
+++ b/tests/spec/arb_direct_state_access/get-textures.c
@@ -31,7 +31,7 @@
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
-   config.supports_gl_compat_version = 13;
+   config.supports_gl_compat_version = 20;
config.supports_gl_core_version = 31;
 
config.window_visual = PIGLIT_GL_VISUAL_RGBA | 
diff --git a/tests/spec/arb_direct_state_access/texture-params.c 
b/tests/spec/arb_direct_state_access/texture-params.c
index d603aeb..c7eeb85 100644
--- a/tests/spec/arb_direct_state_access/texture-params.c
+++ b/tests/spec/arb_direct_state_access/texture-params.c
@@ -36,7 +36,8 @@
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
-   config.supports_gl_compat_version = 13;
+   config.supports_gl_core_version = 31;
+   config.supports_gl_compat_version = 20;
 
config.window_visual = PIGLIT_GL_VISUAL_RGBA | 
PIGLIT_GL_VISUAL_DOUBLE;
-- 
2.1.0

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


[Piglit] [PATCH 14/14] arb_direct_state_access: Port gettextureimage-formats to OpenGL 2.0

2015-09-09 Thread Ian Romanick
From: Ian Romanick 

DSA requires OpenGL 2.0, so this requirement is trivial.

I would have ported this directly to core profile / OpenGL 3.1, but the
test makes heavy use of the deprecated glDrawPixels function.  The uses
in make_texture_image() should be trivial to remove.

However, I'm not even sure why test_format() uses glDrawPixels.  It
seems like just comparing the results from glGetTextureImage for each
mip level should be sufficient.  Is the glDrawPixels just to visualize
the result?

Signed-off-by: Ian Romanick 
Cc: Brian Paul 
---
 .../spec/arb_direct_state_access/CMakeLists.gl.txt |  2 +-
 .../gettextureimage-formats.c  | 23 --
 2 files changed, 9 insertions(+), 16 deletions(-)

diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt 
b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
index 9351c66..e5f064d 100644
--- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
+++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
@@ -25,7 +25,7 @@ piglit_add_executable (arb_direct_state_access-texture-params 
texture-params.c)
 piglit_add_executable (arb_direct_state_access-copytexturesubimage 
copytexturesubimage.c dsa-utils.c)
 piglit_add_executable (arb_direct_state_access-texture-errors texture-errors.c)
 piglit_add_executable (arb_direct_state_access-get-textures get-textures.c)
-piglit_add_executable (arb_direct_state_access-gettextureimage-formats 
gettextureimage-formats.c)
+piglit_add_executable (arb_direct_state_access-gettextureimage-formats 
gettextureimage-formats.c dsa-utils.c)
 piglit_add_executable (arb_direct_state_access-gettextureimage-luminance 
gettextureimage-luminance.c)
 piglit_add_executable (arb_direct_state_access-gettextureimage-targets 
gettextureimage-targets.c)
 piglit_add_executable (arb_direct_state_access-compressedtextureimage 
compressedtextureimage.c)
diff --git a/tests/spec/arb_direct_state_access/gettextureimage-formats.c 
b/tests/spec/arb_direct_state_access/gettextureimage-formats.c
index 72a1bf3..84febe9 100644
--- a/tests/spec/arb_direct_state_access/gettextureimage-formats.c
+++ b/tests/spec/arb_direct_state_access/gettextureimage-formats.c
@@ -31,10 +31,11 @@
 
 #include "piglit-util-gl.h"
 #include "../fbo/fbo-formats.h"
+#include "dsa-utils.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
-   config.supports_gl_compat_version = 10;
+   config.supports_gl_compat_version = 20;
config.supports_gl_core_version = 31;
 
config.window_width = 600;
@@ -47,6 +48,7 @@ static const char *TestName = "gettextureimage-formats";
 
 static const GLfloat clearColor[4] = { 0.4, 0.4, 0.4, 0.0 };
 static GLuint texture_id;
+static GLuint prog;
 static bool init_by_rendering;
 
 #define TEX_SIZE 128
@@ -366,12 +368,13 @@ test_format(const struct test_desc *test,
compute_expected_color(fmt, upperRightTexel, expected, 
tolerance);
 
/* Draw with the texture */
-   glEnable(GL_TEXTURE_2D);
+   glUseProgram(prog);
+   dsa_set_xform(prog, piglit_width, piglit_height);
 #if DO_BLEND
glEnable(GL_BLEND);
 #endif
piglit_draw_rect_tex(x, y, w, h,  0.0, 0.0, 1.0, 1.0);
-   glDisable(GL_TEXTURE_2D);
+   glUseProgram(0);
glDisable(GL_BLEND);
 
x += TEX_SIZE + 20;
@@ -379,23 +382,18 @@ test_format(const struct test_desc *test,
level = 0;
while (w > 0) {
/* Get the texture image */
-   assert(!glIsEnabled(GL_TEXTURE_2D));
glGetTextureImage(texture_id, level, GL_RGBA,
  GL_FLOAT, sizeof(readback),
  readback);
 
-   assert(!glIsEnabled(GL_TEXTURE_2D));
/* Draw the texture image */
glWindowPos2iARB(x, y);
 #if DO_BLEND
glEnable(GL_BLEND);
 #endif
-   assert(!glIsEnabled(GL_TEXTURE_2D));
glDrawPixels(w, h, GL_RGBA, GL_FLOAT, readback);
glDisable(GL_BLEND);
 
-   assert(!glIsEnabled(GL_TEXTURE_2D));
-
if (level <= 2) {
GLint rx = x + w-1;
GLint ry = y + h-1;
@@ -505,11 +503,6 @@ piglit_init(int argc, char **argv)
 
piglit_require_extension("GL_ARB_direct_state_access");
 
-   if ((piglit_get_gl_version() < 14) && 
!piglit_is_extension_supported("GL_ARB_window_pos")) {
-   printf("Requires GL 1.4 or GL_ARB_window_pos");
-   piglit_report_result(PIGLIT_SKIP);
-   }
-
fbo_formats_init(1, argv, !piglit_automatic);
(void) fbo_formats_display;
 
@@ -527,9 +520,9 @@ piglit_init(int argc, char **argv)

[Piglit] [PATCH 12/14] arb_direct_state_access: Don't pretend that texture-buffer can run on less than 3.1

2015-09-09 Thread Ian Romanick
From: Ian Romanick 

The test requires GLSL 1.40, which can only be exposed on OpenGL 3.1 or
later.  Pretending that the test can run on anything less is just silly.
If the test requires 3.1, just dump compatibility profile support.

Signed-off-by: Ian Romanick 
---
 tests/spec/arb_direct_state_access/texture-buffer.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/tests/spec/arb_direct_state_access/texture-buffer.c 
b/tests/spec/arb_direct_state_access/texture-buffer.c
index a82f279..1caed8e 100644
--- a/tests/spec/arb_direct_state_access/texture-buffer.c
+++ b/tests/spec/arb_direct_state_access/texture-buffer.c
@@ -33,7 +33,6 @@
 #include "piglit-util-gl.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
-   config.supports_gl_compat_version = 10;
config.supports_gl_core_version = 31;
 
config.window_visual = PIGLIT_GL_VISUAL_DOUBLE |
@@ -97,9 +96,6 @@ void
 piglit_init(int argc, char **argv)
 {
piglit_require_extension("GL_ARB_direct_state_access");
-   piglit_require_GLSL_version(140);
-   if (piglit_get_gl_version() < 31)
-   piglit_require_extension("GL_ARB_texture_buffer_object");
 
prog = piglit_build_simple_program(vs_source, fs_source);
glUseProgram(prog);
-- 
2.1.0

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


[Piglit] [PATCH 03/14] arb_direct_state_access: Port texunits to core profile

2015-09-09 Thread Ian Romanick
From: Ian Romanick 

The "supports_gl_compat_version = 10" was rubbish anyway because DSA
requires OpenGL 2.0, and the test's piglit_init function was already
doing piglit_require_gl_version(13).

Signed-off-by: Ian Romanick 
---
 tests/spec/arb_direct_state_access/texunits.c | 25 ++---
 1 file changed, 6 insertions(+), 19 deletions(-)

diff --git a/tests/spec/arb_direct_state_access/texunits.c 
b/tests/spec/arb_direct_state_access/texunits.c
index cb78610..ccf7779 100644
--- a/tests/spec/arb_direct_state_access/texunits.c
+++ b/tests/spec/arb_direct_state_access/texunits.c
@@ -30,7 +30,8 @@
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
-   config.supports_gl_compat_version = 10;
+   config.supports_gl_core_version = 31;
+   config.supports_gl_compat_version = 20;
 
config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE;
 
@@ -153,26 +154,12 @@ piglit_display(void)
 void
 piglit_init(int argc, char *argv[])
 {
-   piglit_require_gl_version(13);
piglit_require_extension("GL_ARB_direct_state_access");
 
-   if (piglit_is_extension_supported("GL_ARB_vertex_shader")) {
-  glGetIntegerv(GL_MAX_TEXTURE_COORDS, );
-  glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, );
-  glGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, );
-  glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, 
);
-   } else if (piglit_is_extension_supported("GL_ARB_fragment_shader") ||
- piglit_is_extension_supported("GL_ARB_fragment_program")) {
-  glGetIntegerv(GL_MAX_TEXTURE_COORDS, );
-  glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, );
-  MaxTextureVertexUnits = 0;
-  MaxTextureCombinedUnits = MaxTextureImageUnits;
-   } else {
-  glGetIntegerv(GL_MAX_TEXTURE_UNITS, );
-  MaxTextureImageUnits =
-  MaxTextureCombinedUnits = MaxTextureCoordUnits;
-  MaxTextureVertexUnits = 0;
-   }
+   glGetIntegerv(GL_MAX_TEXTURE_COORDS, );
+   glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, );
+   glGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, );
+   glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, 
);
 
report_info();
 
-- 
2.1.0

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


[Piglit] [PATCH 06/14] arb_direct_state_access: Port texture-storage to core profile

2015-09-09 Thread Ian Romanick
From: Ian Romanick 

The "supports_gl_compat_version = 12" was rubbish anyway because DSA
requires OpenGL 2.0.

Signed-off-by: Ian Romanick 
---
 tests/spec/arb_direct_state_access/CMakeLists.gl.txt |  2 +-
 tests/spec/arb_direct_state_access/texture-storage.c | 19 +--
 2 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt 
b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
index d92eefc..df77fa1 100644
--- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
+++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
@@ -19,7 +19,7 @@ piglit_add_executable (arb_direct_state_access-dsa-textures 
dsa-textures.c dsa-u
 piglit_add_executable (arb_direct_state_access-texturesubimage 
texturesubimage.c dsa-utils.c)
 piglit_add_executable (arb_direct_state_access-bind-texture-unit 
bind-texture-unit.c)
 piglit_add_executable (arb_direct_state_access-create-textures 
create-textures.c)
-piglit_add_executable (arb_direct_state_access-texture-storage 
texture-storage.c)
+piglit_add_executable (arb_direct_state_access-texture-storage 
texture-storage.c dsa-utils.c)
 piglit_add_executable (arb_direct_state_access-texunits texunits.c)
 piglit_add_executable (arb_direct_state_access-texture-params texture-params.c)
 piglit_add_executable (arb_direct_state_access-copytexturesubimage 
copytexturesubimage.c)
diff --git a/tests/spec/arb_direct_state_access/texture-storage.c 
b/tests/spec/arb_direct_state_access/texture-storage.c
index d73224d..1661a9e 100644
--- a/tests/spec/arb_direct_state_access/texture-storage.c
+++ b/tests/spec/arb_direct_state_access/texture-storage.c
@@ -32,7 +32,8 @@
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
-   config.supports_gl_compat_version = 12;
+   config.supports_gl_core_version = 31;
+   config.supports_gl_compat_version = 20;
 
config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE;
 
@@ -317,6 +318,7 @@ test_2d_mipmap_rendering(void)
GLint width = 128, height = 64, levels = 8;
GLint v, l;
GLfloat vfloat;
+   GLuint prog;
 
glCreateTextures(GL_TEXTURE_2D, 1, );
glBindTextureUnit(0, tex);
@@ -397,11 +399,13 @@ test_2d_mipmap_rendering(void)
}
 
/* now do a rendering test */
-   glEnable(GL_TEXTURE_2D);
glTextureParameteri(tex, GL_TEXTURE_MIN_FILTER,
GL_NEAREST_MIPMAP_NEAREST);
glTextureParameteri(tex, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
 
+   prog = dsa_create_program(GL_TEXTURE_2D);
+   glUseProgram(prog);
+
/* draw a quad using each texture mipmap level */
for (l = 0; l < levels; l++) {
GLfloat expected[4];
@@ -432,7 +436,8 @@ test_2d_mipmap_rendering(void)
}
}
 
-   glDisable(GL_TEXTURE_2D);
+   glUseProgram(0);
+   glDeleteProgram(prog);
 
glDeleteTextures(1, );
 
@@ -589,13 +594,7 @@ piglit_display(void)
X(test_2d_mipmap_rendering(), "2D mipmap rendering");
X(test_internal_formats(), "internal formats");
X(test_immutablity(GL_TEXTURE_2D), "immutability");
-
-   if (piglit_get_gl_version() >= 13
-   || piglit_is_extension_supported("GL_ARB_texture_cube_map"))
-   X(test_cube_texture(), "cube texture");
-   else
-   piglit_report_subtest_result(PIGLIT_SKIP,
-"cube texture");
+   X(test_cube_texture(), "cube texture");
 
if (piglit_is_extension_supported("GL_ARB_texture_cube_map_array"))
X(test_cube_array_texture(), "cube array texture");
-- 
2.1.0

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


[Piglit] [PATCH 11/14] arb_direct_state_access: Don't leak resources in texture-buffer

2015-09-09 Thread Ian Romanick
From: Ian Romanick 

Every pass through piglit_display leaked a big pile of stuff.

Signed-off-by: Ian Romanick 
---
 .../spec/arb_direct_state_access/texture-buffer.c  | 59 --
 1 file changed, 32 insertions(+), 27 deletions(-)

diff --git a/tests/spec/arb_direct_state_access/texture-buffer.c 
b/tests/spec/arb_direct_state_access/texture-buffer.c
index 58015b4..a82f279 100644
--- a/tests/spec/arb_direct_state_access/texture-buffer.c
+++ b/tests/spec/arb_direct_state_access/texture-buffer.c
@@ -40,45 +40,40 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
   PIGLIT_GL_VISUAL_RGBA;
 PIGLIT_GL_TEST_CONFIG_END
 
+static const char vs_source[] =
+   "#version 140\n"
+   "in vec4 piglit_vertex;\n"
+   "void main()\n"
+   "{\n"
+   "   gl_Position = piglit_vertex;\n"
+   "}\n"
+   ;
+
+static const char fs_source[] =
+   "#version 140\n"
+   "uniform samplerBuffer s;\n"
+   "void main()\n"
+   "{\n"
+   "   gl_FragColor = texelFetch(s, 0);\n"
+   "}\n"
+   ;
+
+static GLuint prog;
+static GLuint tex;
+static GLuint bo;
+
 enum piglit_result
 piglit_display(void)
 {
-   static const char *vs_source =
-   "#version 140\n"
-   "in vec4 piglit_vertex;\n"
-   "void main()\n"
-   "{\n"
-   "   gl_Position = piglit_vertex;\n"
-   "}\n";
-
-   static const char *fs_source =
-   "#version 140\n"
-   "uniform samplerBuffer s;\n"
-   "void main()\n"
-   "{\n"
-   "   gl_FragColor = texelFetch(s, 0);\n"
-   "}\n";
 
bool pass = true;
-   GLuint tex, bo;
-   GLuint prog;
static const float green[] = {0, 1, 0, 0};
static const float blue[] =  {0, 0, 1, 0};
static const uint8_t g_rgba8[] = {0x00, 0xff, 0x00, 0x00};
static const uint8_t b_rgba8[] = {0x00, 0x00, 0xff, 0x00};
 
-   prog = piglit_build_simple_program(vs_source, fs_source);
-   glUseProgram(prog);
-
-   glGenBuffers(1, );
-   glBindBuffer(GL_TEXTURE_BUFFER, bo);
glBufferData(GL_TEXTURE_BUFFER, sizeof(g_rgba8), g_rgba8,
 GL_STREAM_DRAW);
-
-   glCreateTextures(GL_TEXTURE_BUFFER, 1, );
-   glTextureBuffer(tex, GL_RGBA8, bo);
-   glBindTextureUnit(0, tex);
-
piglit_draw_rect(-1, -1, 1, 2);
glBufferData(GL_TEXTURE_BUFFER, sizeof(b_rgba8), b_rgba8,
 GL_STREAM_DRAW);
@@ -105,4 +100,14 @@ piglit_init(int argc, char **argv)
piglit_require_GLSL_version(140);
if (piglit_get_gl_version() < 31)
piglit_require_extension("GL_ARB_texture_buffer_object");
+
+   prog = piglit_build_simple_program(vs_source, fs_source);
+   glUseProgram(prog);
+
+   glGenBuffers(1, );
+   glBindBuffer(GL_TEXTURE_BUFFER, bo);
+
+   glCreateTextures(GL_TEXTURE_BUFFER, 1, );
+   glTextureBuffer(tex, GL_RGBA8, bo);
+   glBindTextureUnit(0, tex);
 }
-- 
2.1.0

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


[Piglit] [PATCH 13/14] arb_direct_state_access: Bump texture-errors requirement to OpenGL 2.0

2015-09-09 Thread Ian Romanick
From: Ian Romanick 

The "supports_gl_compat_version = 10" was rubbish anyway because DSA
requires OpenGL 2.0... OpenGL 1.0 didn't even have texture objects!

Signed-off-by: Ian Romanick 
---
 tests/spec/arb_direct_state_access/texture-errors.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/spec/arb_direct_state_access/texture-errors.c 
b/tests/spec/arb_direct_state_access/texture-errors.c
index c1f5010..fa91d23 100644
--- a/tests/spec/arb_direct_state_access/texture-errors.c
+++ b/tests/spec/arb_direct_state_access/texture-errors.c
@@ -34,7 +34,7 @@
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
-   config.supports_gl_compat_version = 10;
+   config.supports_gl_compat_version = 20;
config.supports_gl_core_version = 31;
config.window_visual = PIGLIT_GL_VISUAL_RGB;
 
-- 
2.1.0

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


[Piglit] [PATCH 04/14] arb_direct_state_access: Make dsa-utils more general

2015-09-09 Thread Ian Romanick
From: Ian Romanick 

Future patches will make use of these utility functions.  The shaders
also need to be reduced to GLSL 1.10 because that's all that's required
by OpenGL 2.0.

Signed-off-by: Ian Romanick 
---
 tests/spec/arb_direct_state_access/dsa-textures.c |  10 +-
 tests/spec/arb_direct_state_access/dsa-utils.c| 181 +++---
 tests/spec/arb_direct_state_access/dsa-utils.h|   6 +-
 3 files changed, 171 insertions(+), 26 deletions(-)

diff --git a/tests/spec/arb_direct_state_access/dsa-textures.c 
b/tests/spec/arb_direct_state_access/dsa-textures.c
index cc519e4..29661c0 100644
--- a/tests/spec/arb_direct_state_access/dsa-textures.c
+++ b/tests/spec/arb_direct_state_access/dsa-textures.c
@@ -40,6 +40,8 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
 
 PIGLIT_GL_TEST_CONFIG_END
 
+static GLuint prog;
+
 GLfloat*
 random_image_data(void)
 {
@@ -61,7 +63,7 @@ piglit_init(int argc, char **argv)
 
printf("Using driver %s.\n", (const char *) glGetString(GL_VERSION));
 
-   dsa_init_program();
+   prog = dsa_create_program(GL_TEXTURE_2D);
 }
 
 enum piglit_result
@@ -80,12 +82,12 @@ piglit_display(void)
glTextureParameteri(name, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
 
/* Draw the image */
-   piglit_ortho_projection(piglit_width, piglit_height, false);
-   dsa_texture_with_unit(texunit);
+   dsa_texture_with_unit(prog, texunit);
glEnable(GL_TEXTURE_2D);
+   glUseProgram(prog);
glBindTextureUnit(texunit, name);
pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
-   piglit_draw_rect_tex(0, 0, piglit_width, piglit_height, 0, 0, 1, 1);
+   piglit_draw_rect_tex(-1.0, -1.0, 2.0, 2.0, 0.0, 0.0, 1.0, 1.0);
pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
 
/* Check to make sure the image was drawn correctly */
diff --git a/tests/spec/arb_direct_state_access/dsa-utils.c 
b/tests/spec/arb_direct_state_access/dsa-utils.c
index fefbae1..727751d 100644
--- a/tests/spec/arb_direct_state_access/dsa-utils.c
+++ b/tests/spec/arb_direct_state_access/dsa-utils.c
@@ -35,43 +35,184 @@
  * These duplicate fixed-function gl 1.0 pipeline shading.
  * Adapted from arb_clear_texture/3d.c.
  */
-static const char dsa_vs_source[] =
-   "#version 120\n"
+static const char vs_template[] =
+   "#version %s\n"
+   "#if __VERSION__ < 130\n"
"attribute vec4 piglit_vertex;\n"
-   "attribute vec4 piglit_texcoord;\n"
+   "attribute vec2 piglit_texcoord;\n"
"varying vec2 tex_coord;\n"
+   "#else\n"
+   "in vec4 piglit_vertex;\n"
+   "in vec2 piglit_texcoord;\n"
+   "out vec2 tex_coord;\n"
+   "#endif\n"
+   "uniform mat3 xform;\n"
"\n"
"void main()\n"
"{\n"
-   "gl_Position = gl_ModelViewProjectionMatrix\n"
-   "   * piglit_vertex;\n"
-   "tex_coord = piglit_texcoord.st;\n"
-   "}\n";
+   "gl_Position = vec4((xform * piglit_vertex.xyw).xy, 0, 1);\n"
+   "tex_coord = piglit_texcoord;\n"
+   "}\n"
+   ;
 
-static const char dsa_fs_source[] =
-   "#version 120\n"
+static const char fs_1d_template[] =
+   "#version %s\n"
+   "#if __VERSION__ < 130\n"
+   "#define piglit_color gl_FragColor\n"
+   "#define texture(s,t) texture1D(s,t)\n"
+   "varying vec2 tex_coord;\n"
+   "#else\n"
+   "out vec4 piglit_color;\n"
+   "in vec2 tex_coord;\n"
+   "#endif\n"
+   "uniform sampler1D tex;\n"
+   "\n"
+   "void main()\n"
+   "{\n"
+   "piglit_color = texture(tex, tex_coord.x);\n"
+   "}\n"
+   ;
+
+static const char fs_2d_template[] =
+   "#version %s\n"
+   "#if __VERSION__ < 130\n"
+   "#define piglit_color gl_FragColor\n"
+   "#define texture(s,t) texture2D(s,t)\n"
+   "varying vec2 tex_coord;\n"
+   "#else\n"
+   "out vec4 piglit_color;\n"
+   "in vec2 tex_coord;\n"
+   "#endif\n"
"uniform sampler2D tex;\n"
+   "\n"
+   "void main()\n"
+   "{\n"
+   "gl_FragColor = texture(tex, tex_coord);\n"
+   "}\n"
+   ;
+
+static const char fs_3d_template[] =
+   "#version %s\n"
+   "#if __VERSION__ < 130\n"
+   "#define piglit_color gl_FragColor\n"
+   "#define texture(s,t) texture3D(s,t)\n"
+   "varying vec2 tex_coord;\n"
+   "#else\n"
+   "out vec4 piglit_color;\n"
+   "in vec2 tex_coord;\n"
+   "#endif\n"
+   "uniform sampler3D tex;\n"
+   "\n"
+   "void main()\n"
+   "{\n"
+   "piglit_color = texture(tex, vec3(tex_coord, 0));\n"
+   "}\n"
+   ;
+
+static const char fs_rect_template[] =
+   "#version %s\n"
+   "#if __VERSION__ < 130\n"
+   "#define piglit_color gl_FragColor\n"
+   "#define texture(s,t) texture2DRect(s,t)\n"
"varying vec2 tex_coord;\n"
+   "#else\n"
+   "out vec4 piglit_color;\n"
+   

Re: [Piglit] [PATCH] framework/summary.py: Always print number of changes in console mode

2015-09-09 Thread Tom Stellard
On Wed, Sep 09, 2015 at 11:05:55AM -0700, Dylan Baker wrote:
> Reviewed-by: Dylan Baker 
> 
> On a related note, I have a series that seriously overhauls the summary
> code, including fixing the console/text summary, producing a column for
> each result. It does include changes, fixes, and regressions in all
> cases like this patch. I'm hoping to have that cleaned up and on the
> list today.
> 
> On a tangent, why are you parsing the output of this, it seems like the
> CSV summary would be easier to pass to another script than this, which
> is volatile.
> 

I have a buildbot seti up to run piglit and the way it detects whether
or no there have been piglit regressions is by running piglit summary
console and then parsing the output.

The CSV summary seems to only accept a single result file, unless I'm
doing something wrong:

tstellar@localhost ~/piglit $ ./piglit summary csv  -o out.csv 
results/master--150727-/ results/master-BONAIRE-150223-/
usage: piglit [-h] [-o ] 
piglit: error: unrecognized arguments: results/master-BONAIRE-150223-/

-Tom


> Dylan
> 
> On Wed, Sep 09, 2015 at 12:28:21PM +, Tom Stellard wrote:
> > The counts for changes, fixes, and regressions are now reported as zero
> > when no changes are detect rather than being omitted from the output.
> > 
> > This makes it easier for scripts to parse the output of piglit summary
> > console, becuase now when there are no regressions piglit always
> > outputs:
> > 
> > regressions: 0
> > 
> > Before when there where no regressions, piglit would either print no
> > regression line or it would print 'regressions: 0'
> > ---
> >  framework/summary.py | 5 -
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/framework/summary.py b/framework/summary.py
> > index 80cb181..e56c0f2 100644
> > --- a/framework/summary.py
> > +++ b/framework/summary.py
> > @@ -604,7 +604,10 @@ class Summary:
> >"  fixes: {fixes}\n"
> >"regressions: {regressions}".format(
> >**{k: len(v) for k, v in 
> > self.tests.iteritems()}))
> > -
> > +else:
> > +print("changes: 0\n"
> > +  "  fixes: 0\n"
> > +  "regressions: 0")
> >  print("  total: {}".format(sum(self.totals.itervalues(
> >  
> >  # Print the name of the test and the status from each test run
> > -- 
> > 2.0.4
> > 
> > ___
> > Piglit mailing list
> > Piglit@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/piglit



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

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


Re: [Piglit] [PATCH] framework/summary.py: Always print number of changes in console mode

2015-09-09 Thread Dylan Baker
On Wed, Sep 09, 2015 at 03:25:50PM -0400, Tom Stellard wrote:
> On Wed, Sep 09, 2015 at 11:05:55AM -0700, Dylan Baker wrote:
> > Reviewed-by: Dylan Baker 
> > 
> > On a related note, I have a series that seriously overhauls the summary
> > code, including fixing the console/text summary, producing a column for
> > each result. It does include changes, fixes, and regressions in all
> > cases like this patch. I'm hoping to have that cleaned up and on the
> > list today.
> > 
> > On a tangent, why are you parsing the output of this, it seems like the
> > CSV summary would be easier to pass to another script than this, which
> > is volatile.
> > 
> 
> I have a buildbot seti up to run piglit and the way it detects whether
> or no there have been piglit regressions is by running piglit summary
> console and then parsing the output.
> 
> The CSV summary seems to only accept a single result file, unless I'm
> doing something wrong:
> 
> tstellar@localhost ~/piglit $ ./piglit summary csv  -o out.csv 
> results/master--150727-/ results/master-BONAIRE-150223-/
> usage: piglit [-h] [-o ] 
> piglit: error: unrecognized arguments: results/master-BONAIRE-150223-/
> 
> -Tom

You're right. I'll fix that, it seems useful to get more than one result
out of it.

> 
> 
> > Dylan
> > 
> > On Wed, Sep 09, 2015 at 12:28:21PM +, Tom Stellard wrote:
> > > The counts for changes, fixes, and regressions are now reported as zero
> > > when no changes are detect rather than being omitted from the output.
> > > 
> > > This makes it easier for scripts to parse the output of piglit summary
> > > console, becuase now when there are no regressions piglit always
> > > outputs:
> > > 
> > > regressions: 0
> > > 
> > > Before when there where no regressions, piglit would either print no
> > > regression line or it would print 'regressions: 0'
> > > ---
> > >  framework/summary.py | 5 -
> > >  1 file changed, 4 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/framework/summary.py b/framework/summary.py
> > > index 80cb181..e56c0f2 100644
> > > --- a/framework/summary.py
> > > +++ b/framework/summary.py
> > > @@ -604,7 +604,10 @@ class Summary:
> > >"  fixes: {fixes}\n"
> > >"regressions: {regressions}".format(
> > >**{k: len(v) for k, v in 
> > > self.tests.iteritems()}))
> > > -
> > > +else:
> > > +print("changes: 0\n"
> > > +  "  fixes: 0\n"
> > > +  "regressions: 0")
> > >  print("  total: 
> > > {}".format(sum(self.totals.itervalues(
> > >  
> > >  # Print the name of the test and the status from each test run
> > > -- 
> > > 2.0.4
> > > 
> > > ___
> > > Piglit mailing list
> > > Piglit@lists.freedesktop.org
> > > http://lists.freedesktop.org/mailman/listinfo/piglit
> 
> 
> 
> > ___
> > Piglit mailing list
> > Piglit@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/piglit
> 


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


Re: [Piglit] [PATCH] framework/summary.py: Always print number of changes in console mode

2015-09-09 Thread Dylan Baker
> I have a buildbot seti up to run piglit and the way it detects whether
> or no there have been piglit regressions is by running piglit summary
> console and then parsing the output.
> 
> The CSV summary seems to only accept a single result file, unless I'm
> doing something wrong:
> 
> tstellar@localhost ~/piglit $ ./piglit summary csv  -o out.csv 
> results/master--150727-/ results/master-BONAIRE-150223-/
> usage: piglit [-h] [-o ] 
> piglit: error: unrecognized arguments: results/master-BONAIRE-150223-/
> 
> -Tom

Are you just wanting to see if there are regressions, or do you want to
get a count and the tests that regressed as well?


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


Re: [Piglit] [PATCH] framework/summary.py: Always print number of changes in console mode

2015-09-09 Thread Tom Stellard
On Wed, Sep 09, 2015 at 12:52:22PM -0700, Dylan Baker wrote:
> > I have a buildbot seti up to run piglit and the way it detects whether
> > or no there have been piglit regressions is by running piglit summary
> > console and then parsing the output.
> > 
> > The CSV summary seems to only accept a single result file, unless I'm
> > doing something wrong:
> > 
> > tstellar@localhost ~/piglit $ ./piglit summary csv  -o out.csv 
> > results/master--150727-/ results/master-BONAIRE-150223-/
> > usage: piglit [-h] [-o ] 
> > piglit: error: unrecognized arguments: results/master-BONAIRE-150223-/
> > 
> > -Tom
> 
> Are you just wanting to see if there are regressions, or do you want to
> get a count and the tests that regressed as well?

What I want is a list of changes, and yes/no for regressions.  The
number of regressions does not matter. `piglit/piglit summary console
-d` gives me a list of changes and prints the summary so I can check
if there were regressions.

Another solution I considered was to add an exit status to piglit
summary to indicate whether or not there were regressions.  This would
be the best solution, but I wasn't sure if this would break other
people's use cases.

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


[Piglit] [PATCH 2/2] arb_direct_state_access: Verify the side-effect-free operation of glGenerateTextureMipmap

2015-09-09 Thread Ian Romanick
From: Ian Romanick 

After calling glGenerateTextureMipmap, there are 3 things that

1. The texture bindings have not been modified.

2. Textures not passed to glGenerateTextureMipmap have not had their data
   modified.

3. The texture that was passed to glGenerateTextureMipmap has the correct
   data in its mipmaps.

Signed-off-by: Ian Romanick 
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91847
---
 tests/all.py   |   1 +
 .../spec/arb_direct_state_access/CMakeLists.gl.txt |   1 +
 .../generatetexturemipmap.c| 166 +
 3 files changed, 168 insertions(+)
 create mode 100644 tests/spec/arb_direct_state_access/generatetexturemipmap.c

diff --git a/tests/all.py b/tests/all.py
index a1eba91..0f42015 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4371,6 +4371,7 @@ with profile.group_manager(
 g(['arb_direct_state_access-create-programpipelines'],
   'create-programpipelines')
 g(['arb_direct_state_access-create-queries'], 'create-queries')
+g(['arb_direct_state_access-generatetexturemipmap'], 
'generatetexturemipmap')
 
 with profile.group_manager(
 PiglitGLTest,
diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt 
b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
index 4add16d..d078aa0 100644
--- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
+++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
@@ -19,6 +19,7 @@ piglit_add_executable 
(arb_direct_state_access-create-samplers create-samplers.c
 piglit_add_executable (arb_direct_state_access-create-textures 
create-textures.c)
 piglit_add_executable (arb_direct_state_access-create-transformfeedbacks 
create-transformfeedbacks.c)
 piglit_add_executable (arb_direct_state_access-dsa-textures dsa-textures.c 
dsa-utils.c)
+piglit_add_executable (arb_direct_state_access-generatetexturemipmap 
generatetexturemipmap.c dsa-utils.c)
 piglit_add_executable (arb_direct_state_access-getcompressedtextureimage 
getcompressedtextureimage.c dsa-utils.c)
 piglit_add_executable (arb_direct_state_access-gettextureimage-formats 
gettextureimage-formats.c dsa-utils.c)
 piglit_add_executable (arb_direct_state_access-gettextureimage-luminance 
gettextureimage-luminance.c)
diff --git a/tests/spec/arb_direct_state_access/generatetexturemipmap.c 
b/tests/spec/arb_direct_state_access/generatetexturemipmap.c
new file mode 100644
index 000..5a0cba8
--- /dev/null
+++ b/tests/spec/arb_direct_state_access/generatetexturemipmap.c
@@ -0,0 +1,166 @@
+/*
+ * 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.
+ */
+
+/**
+ * \file generatetexturemipmaps.c
+ * Verify the side-effect-free operation of glGenerateTextureMipmap
+ *
+ * After calling glGenerateTextureMipmap, there are 3 things that
+ *
+ * 1. The texture bindings have not been modified.
+ *
+ * 2. Textures not passed to glGenerateTextureMipmap have not had their data
+ *modified.
+ *
+ * 3. The texture that was passed to glGenerateTextureMipmap has the correct
+ *data in its mipmaps.
+ */
+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_core_version = 31;
+   config.supports_gl_compat_version = 20;
+
+   config.window_visual = PIGLIT_GL_VISUAL_RGBA | 
+   PIGLIT_GL_VISUAL_DOUBLE;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+/* 2x2 block of red pixels. */
+static const float red[2 * 2 * 4] = {
+   1.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 1.0,
+   1.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 1.0
+};
+
+/* 4x4 block of green pixels. */
+static const float green[4 * 4 * 4] = {
+   0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0,
+   0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0,
+   0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0,
+   0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0,
+   0.0, 1.0, 0.0, 1.0, 0.0, 

Re: [Piglit] [PATCH 6/9] tests.all: add arb_framebuffer_srgb-pushpop

2015-09-09 Thread Ian Romanick
On 09/02/2015 12:51 PM, Dylan Baker wrote:
> This was never added to all.py.
> 
> cc: Eric Anholt 
> Signed-off-by: Dylan Baker 
> ---
> 
> Can this be run concurrently, or should it have run_concurrent=False
> added?

It should be fine to run concurrently.

>  tests/all.py | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tests/all.py b/tests/all.py
> index b4be071..86b93ed 100644
> --- a/tests/all.py
> +++ b/tests/all.py
> @@ -2021,6 +2021,7 @@ with profile.group_manager(
>framebuffer_srgb_setting))
>  g(['framebuffer-srgb'], run_concurrent=False)
>  g(['arb_framebuffer_srgb-clear'])
> +g(['arb_framebuffer_srgb-pushpop'])
>  
>  with profile.group_manager(
>  PiglitGLTest,

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


Re: [Piglit] [PATCH 8/9] tests/all.py: add arb_robustness_draw-vbo-bounds

2015-09-09 Thread Ian Romanick
On 09/02/2015 01:27 PM, Jose Fonseca wrote:
> On 02/09/15 20:51, Dylan Baker wrote:
>> This was never added to all.py
> 
> Yes, that was because the test uses random numbers, hence might yield
> variable results (fail once, pass another).
> 
> Rather than all.py, it probably makes sense to move this sort of tests
> to a new stress.py test-list.
> 
> The other alternative is use reproduceable pseudo-random numbers, or a
> pre-generated set of data from a plaintext file.

There is such a random number generator in piglit, but it looks like
it's only available for C++ tests (tests/util/mersenne.hpp).  It should
be easy enough to make it available to C tests.

> Jose
> 
>> cc: José Fonseca 
>> Signed-off-by: Dylan Baker 
>> ---
>>
>> Does this actually need run_concurrent=False?
>>
>>   tests/all.py | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/tests/all.py b/tests/all.py
>> index 9c55dd7..ca72b65 100644
>> --- a/tests/all.py
>> +++ b/tests/all.py
>> @@ -2249,6 +2249,7 @@ with profile.group_manager(
>>   PiglitGLTest,
>>   grouptools.join('spec', 'ARB_robustness')) as g:
>>   g(['arb_robustness_client-mem-bounds'], run_concurrent=False)
>> +g(['arb_robustness_draw-vbo-bounds'], run_concurrent=False)
>>
>>   # Group ARB_shader_texture_lod
>>   with profile.group_manager(
> 
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit

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


Re: [Piglit] [PATCH v2 1/4] arb_texture_compression/invalid-formats: add ASTC to list of formats

2015-09-09 Thread Nanley Chery
On Tue, Sep 8, 2015 at 10:59 AM, Chad Versace 
wrote:

> On Tue 08 Sep 2015, Dylan Baker wrote:
> > This is extending an existing test, does it really need to be added?
>
> If I interpreted correctly the output of `grep
> arb_texture_compression-invalid-formats tests/all.py`, then yes.
>
> Nanley, without adding your ASTC invalid format tests to all.py, do they
> still get run during a full Piglit run?
>
>
They do not get run. It turns out that this test doesn't cycle through
every format it knows about, but instead requires passing in an argument
specifying which format to test. I'll add this change to my v2.

> > On Sep 8, 2015 09:50, "Chad Versace"  wrote:
> >
> > > On Tue 08 Sep 2015, Chad Versace wrote:
> > > > On Fri 28 Aug 2015, Nanley Chery wrote:
> > > > > From: Nanley Chery 
> > > > >
> > > > > ASTC formats are added to the list of formats that should not be
> > > returned by the
> > > > > COMPRESSED_TEXTURE_FORMATS query.
> > > > >
> > > > > Signed-off-by: Nanley Chery 
> > > > > ---
> > > > >  .../spec/arb_texture_compression/invalid-formats.c | 51
> > > +-
> > > > >  1 file changed, 50 insertions(+), 1 deletion(-)
> > > >
> > > > Patch 1 is
> > > > Reviewed-by: Chad Versace 
> > >
> > > Oops. I retract the rb. You need to add the test to all.py.
> > > ___
> > > 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_shader_storage_buffer_object: fix TOP_LEVEL_ARRAY_STRIDE expected value for std430 case

2015-09-09 Thread Ian Romanick
This patch is

Reviewed-by: Ian Romanick 

On 09/09/2015 03:41 AM, Samuel Iglesias Gonsalvez wrote:
> struct B has a size of 52. Interface packing layout qualifier std430 says that
> the array of structures are not rounded up a multiple of the base alignment of
> a vec4 but to the next multiple of the base alignment of the structure.
> 
> The base alignment of a structure is N, where N is the largest base
> alignment value of any of its members.
> 
> In this case the largest base alignment is 8 (which is mat2's base alignment
> following std430 rules), so 52 is rounded up to 56, not to 64.
> 
> Tested on NVIDIA proprietary driver version 352.21.
> 
> Signed-off-by: Samuel Iglesias Gonsalvez 
> ---
>  tests/spec/arb_shader_storage_buffer_object/program-interface-query.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git 
> a/tests/spec/arb_shader_storage_buffer_object/program-interface-query.c 
> b/tests/spec/arb_shader_storage_buffer_object/program-interface-query.c
> index 2044898..68cbbff 100644
> --- a/tests/spec/arb_shader_storage_buffer_object/program-interface-query.c
> +++ b/tests/spec/arb_shader_storage_buffer_object/program-interface-query.c
> @@ -110,7 +110,7 @@ piglit_init(int argc, char **argv)
>   const int expected_std140[NUM_QUERIES] =
>   { 0, 112, GL_FLOAT_MAT2, 3, 0, 16, 32, 16, 1, 1, 0 };
>   const int expected_std430[NUM_QUERIES] =
> - { 2, 64, GL_FLOAT_MAT2, 3, 2, 16, 16, 8, 0, 0, 1 };
> + { 2, 56, GL_FLOAT_MAT2, 3, 2, 16, 16, 8, 0, 0, 1 };
>   int i;
>  
>   piglit_require_extension("GL_ARB_shader_storage_buffer_object");
> 

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