tests/igt.py: check all tests for subtests

All the tests should now be able to respond to --list-subtests, so there
is no need to distinguish between single and multi-tests.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
util: add piglit_array_texture() function

For creating 1D/2D array textures.  Each slice of the array is a
solid color (red, green, blue, white, etc.)

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
shader_runner: add support for rgbw 1D/2DArray texture setup

And remove the previous glEnable(GL_TEXTURE_2D_ARRAY) call.  It's
never legal.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
ext_texture_array: add simple 1D/2D array rendering tests

Check that we're sampling from the expected array slices.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
util: don't minify height for 1D textures in piglit_depth_texture()

This was never hit since no callers create 1D mipmapped depth textures.
But fix it anyway.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
shader_runner: fix 1D array depth texture setup

The second parameter should be the number of 1D slices, not the 3rd.
As it was, piglit_depth_texture() was only initializing the first
slice's data and not the other slices.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Replace [vertex/fragment shader file] sections in shader_test files.

This replaces sections like:

[fragment shader file]
glsl-color.frag

with [fragment shader] and the contents of that file.

The majority of shader_test files include all their shaders in a single
file, which is nice: you can read and understand them all at a glance,
without having to open multiple files.  You also don't need to worry
about extra data files that live in some path.

In roughly 60% of these cases, the shader file being included was a
a single line (such as gl_FragColor = gl_Color), so just importing it
into the shader_test doesn't even add much extra data.  The other 40%
were shadow tests where it added a bit more, but it's still not
horrible.

This commit was autogenerated by a python script, with extra 'git rm's
for the unnecessary .vert/.frag files after the conversion.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Delete [<stage> shader file] support from shader_runner.

This hasn't proven to be terribly useful; most tests don't use it.

Dropping it allows us to drop code for:
- Loading shaders from files
- Determining where to look for said files (platform specific)
- A bunch of per-shader stage enums
- compile_glsl parameter for whether or not to free the shader string

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Add test to verify glTexSubImage2D() with depth formats

This test verifies the bug fix in i965 drivers in mesa commit 984a02b.
Reproduces another bug in the driver with GL_DEPTH_COMPONENT16
internal format.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
attribs: add support for the SNORM equation 2.3

Reviewed-by: Brian Paul <brianp@vmware.com>
draw-vertices-2101010: add support for the SNORM equation 2.3

Reviewed-by: Brian Paul <brianp@vmware.com>
oes_compressed_etc2_texture-miptree: fix the R11 test

Clearing a buffer with masked channels results in not clearing anything
in those channels, so there is always random garbage. No wonder that
the test was always failing. Apparently, i965 ignores the colormask,
otherwise it wouldn't have been unnoticed.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
egl-create-context-valid-flag-debug-gles: Add missing break.

Fixes Coverity "Missing break in switch" defect.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
arb_shader_atomic_counters-unique-id: Fix memory leak.

Fixes Coverity "Resource leak" defect.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
glsl-1.10/fragdepth: add new, simple test of gl_FragDepth

v2: incorporate fixes suggested by Anuj Phogat.
tex-miplevel-selection: use GL_CLAMP_TO_EDGE instead of GL_REPEAT

GL_REPEAT is not legal for the rectangle targets, and because the test uses
sampler objects the default GL_REPEAT value will be used even for rectangle
target because unlike texture objects they can't be initialized to the legal
CLAMP_TO_EDGE value. According to the spec the texture actually should be
treated as incomplete in this case which mesa does not do (and I don't know if
anyone bothers enough to fix this) but some drivers (like llvmpipe) might
not treat unnormalized coords correctly in this case.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
arb_gpu_shader_fp64: add preprocessor define tests

v2: import tests in tests/all.py

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
arb_gpu_shader_fp64: add vs input and fs output tests

Both of these tests are expected to fail as double cannot
be used as vs input or fs output.

v2: make sure we only fail because of wrong type

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Dave Airlie <airlied@redhat.com>
exectest.py: Remove {'result': 'skip'} from get_command_result()

Since 1012d68c an exception in Popen is no longer sent to
interpret_result(), instead it returns early, making this dead code.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
exectest.py: Add message to out when is_skip() is True

This adds a note so that one knows why a specific test skipped.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>