fbo: test that swizzle doesn't affect mipmap generation

This is a regression test for a mesa meta bug fix whereby a swizzle set
via GL_ARB_texture_swizzle was being applied while iteratively
generating a mipmap. This meant the swizzle would be applied twice by
the time the application sampled those generated layers.

The bug was originally noticed with code that used a swizzle to emulate
a component alpha texture via a component red texture. In this case the
texture internally only had one component and applying the swizzle
effectively discarded that component. The test follows a similar
pattern, but swizzles from red to green instead of to alpha.

Reviewed-by: Brian Paul <brianp@vmware.com>
.gitignore: ignore ninja files not in the root directory as well

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
arb_shader_atomic_counters: get log from the right shader

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
arb_shader_atomic_counters: gs/tes/tcs all need version 150

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
gl-3.0: Don't query GL_TEXTURE_{LUMINANCE,INTENSITY}_* outside compat profile

There are no queries for GL_TEXTURE_LUMINANCE_SIZE,
GL_TEXTURE_INTENSITY_SIZE, GL_TEXTURE_LUMINANCE_TYPE, or
GL_TEXTURE_INTENSITY_TYPE in any version of OpenGL ES or desktop OpenGL
core profile.

v2: Move call to glGetTexLevelParameteriv to a separate function.
Suggested by Brian.

v3: Move compat_profile to GetTexLevelParameteriv too.  Suggested by
Brian.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
fbo-generatemipmap-1d: Remove unused variables.

Fix clang unused-const-variable warnings.

tests/fbo/fbo-generatemipmap-1d.c:44:20: warning: unused variable 'red' [-Wunused-const-variable]
static const float red[] =   {1, 0, 0, 0};
                   ^
tests/fbo/fbo-generatemipmap-1d.c:45:20: warning: unused variable 'green' [-Wunused-const-variable]
static const float green[] = {0, 1, 0, 0};
                   ^
tests/fbo/fbo-generatemipmap-1d.c:46:20: warning: unused variable 'blue' [-Wunused-const-variable]
static const float blue[] =  {0, 0, 1, 0};
                   ^
tests/fbo/fbo-generatemipmap-1d.c:47:20: warning: unused variable 'white' [-Wunused-const-variable]
static const float white[] = {1, 1, 1, 1};
                   ^

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
glsl-1.50: Don't try to use embedded struct definitions

Interface blocks may contain instances of predeclared structs,
but not embedded definitions.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
ubo: Don't try to use embedded struct definitions.

This isn't explicitly disallowed in the ARB_ubo spec or the GLSL 1.40
spec, but is very clear in the 1.50 spec. I believe this is a
clarification, not a change.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
glsl-1.40: Don't try to use embedded struct definitions

This isn't explicitly disallowed in the ARB_ubo spec or the GLSL
1.40 spec, but is very clear in the 1.50 spec. I believe this is a
clarification, not a change.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Test GL_ARB_clear_texture using 3D textures

This adds a test for glClearTexSubImage when clearing a sub-region of
a 3D texture. Two sub-regions are cleared, one using a NULL data
parameter and one providing a colour. Both regions have a depth
greater than 1. All of the images of the texture are then rendered to
the window and probed for the correct results.

Reviewed-by: Brian Paul <brianp@vmware.com>
Test GL_ARB_clear_texture using cube map textures

This adds a test for glClearTexSubImage when clearing a sub-region of
a cube map texture. Each face of the cube map is cleared to a separate
colour and then one pixel of each face is rendered using points. The
colours are then probed to check whether the clear worked. This is
important to test because glClearTexSubImage has some unusual
semantics in that the zoffset parameter is used to select the cube
face.

Reviewed-by: Brian Paul <brianp@vmware.com>
Test GL_ARB_clear_texture using a range of base formats

This adds a test for glClearTexSubImage when clearing a sub-region of
a 2D texture using a range of formats that are supported in basic GL.
A utility function is added to test a format combination so that
further tests can be added with other formats that need an extension.

For each format a texture is created and two sub-regions are cleared.
One region is set to all zeroes using NULL as the clear value and the
other is set to a known value. The texture is then retrieved with
glGetTexImage and compared against the expected values.

Reviewed-by: Brian Paul <brianp@vmware.com>
Test GL_ARB_clear_texture using depth-stencil textures

This adds a test for glClearTexSubImage when clearing a sub-region of
a depth-stencil texture. This is important to test because it hits a
separate code path in Mesa.

Reviewed-by: Brian Paul <brianp@vmware.com>
Test GL_ARB_clear_texture using a range of sized formats

This adds a test for glClearTexSubImage when clearing a sub-region of
a texture using a range of sized internal formats.

Reviewed-by: Brian Paul <brianp@vmware.com>
Test GL_ARB_clear_texture using a range of float formats

This adds a test for glClearTexSubImage when clearing a sub-region of
a texture using a range of float formats.

Reviewed-by: Brian Paul <brianp@vmware.com>
Test GL_ARB_clear_texture using 1- and 2- component textures

This adds a test for glClearTexSubImage when clearing a sub-region of
textures using an internal format of GL_RED and GL_RG.

Reviewed-by: Brian Paul <brianp@vmware.com>
shader_runner: Add 'atomic counters' command

This command initializes the specified number of atomic counters all
containing an initial value of 0.

For example, 'atomic counters 2' creates an zeroed 8 byte buffer
for 2 atomic counters.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
shader_runner: Add 'probe atomic counter' command

This command allows a test to probe the value of an atomic counter.

For example 'probe atomic counter 0 == 512' will read the atomic
counter at offset 0, and compare for equality with 512.

Since atomic counters are 32-bit unsigned integers, the probed counter
is located at a multiple of 4 offset within the atomic counters
buffer.

'probe atomic counter 1 > 512' will read the atomic counter at offset
4, and ensure the value is greater than 512.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
arb_compute_shader: Add simple compute shader with atomic counters

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
shader_runner: Allow tests to require an OpenGL CORE profile

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Anuj Phogat <anuj.phogat@gmail.com>