piglit/util: re-order cubemap faces and coords.

This reflects the order they are requires for ARB_texture_cube_map_array,

I've tested that this causes no regressions here.

Signed-off-by: Dave Airlie <airlied@redhat.com>
textureSize: add GL_ARB_texture_cube_map_array support.

This one is wierd since you give glTexImage3D layers * 6, but
textureSize reports back layers on its own.

Tested and passes on nvidia 295.59.

Signed-off-by: Dave Airlie <airlied@redhat.com>
arb_texture_cube_map_array: basic cubemap test (v2)

This creates a cube map array of 2 cubes, and tests the upload via
glTexImage3D and rendering of each layer happens correctly.

note it needs to redefine the common cubemap stuff as they are in the
wrong order for cubemap arrays.

v2: fixup Brian's review

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
arb_texture_cube_map_array: check for teximage3d invalid values.

This tests teximage3d returns invalid values for width != height
and depth not divisible by 6.

Signed-off-by: Dave Airlie <airlied@redhat.com>
arb_texture_cube_map_array: test getting binding.

test the getintegerv addition from the spec.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
arb_texture_cube_map_array: add cube array shadow sampler

This tests cubemap array shadow support, these are different as we have
to pass the compare value not in the texture coord but in a separate attribute.

Tested against NVIDIA 295 series.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
arb_texture_cube_map_array: add fbo test

This tests the glFramebufferTextureLayer interface.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
arb_texture_cube_map_array: add to all.tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
arb_texture_cube_map_array: fix assorted compiler warnings

Fix const correctness warnings.  Remove unused label.  Use program name
in error messages.

Signed-off-by: Dave Airlie <airlied@gmail.com>
arb_texture_cube_map_array: add a bunch of compiler tests for new functions

This was originally generated by a script until I realised the script
was actually nearly just the contents of the files (there really is
that little overlap), so drop the script and just push the files.

This should test (non-textureSize ones)

      gvec4 texture(gsamplerCubeArray sampler, vec4 coord
                    [, float bias])
      gvec4 textureLod(gsamplerCubeArray sampler, vec4 coord, float lod)
      float texture(samplerCubeArrayShadow sampler, vec4 coord, float compare)
      gvec4 textureGrad(gsamplerCubeArray sampler, vec4 coord,
                        vec3 ddx, vec3 ddy);

work at the compiler level.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Add a test for EXT_texture_swizzle and DEPTH_TEXTURE_MODE together.

This tests every possible DEPTH_TEXTURE_MODE with a random smattering of
EXT_texture_swizzle modes.  While it could be more exhaustive (or use a
more logically ordered layout), it does catch the bugs I wanted to
detect.

v2: Fix probing bug, minor cleanups based on Brian's feedback.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
glsl-fs-shadow2D-clamp-z: test clamping of Z in shadow2D

Reviewed-by: Brian Paul <brianp@vmware.com>
Clean up depth-tex-modes-glsl a bit.

1. It doesn't use sampler2DRect, so don't require ARB_texture_rectangle
2. Remove pointless glFinish() before piglit_present_results()
3. Use Piglit utility functions for compiling/linking shaders.
4. Print the description of what you're seeing in *non*-automatic mode.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
piglit: add piglit_rgbw_image() helper

Create an image buffer with red, green, blue, white quadrants.
This code was extracted out of the piglit_rgbw_texture() function.
The piglit_rgbw_texture() function is then rewritten to use the new
piglit_rgbw_image() function.
s3tc-errors: test GL error checking with s3tc textures

Check for expected OpenGL errors related to texture compression.  For
example, glCompresedTexSubImage2D() offset/size values must be multiples
of four.

This test could be expanded to cover other compression formats in the future.

Also, this test contains some texture compression helper functions that could
be made into piglit utility functions.

Verified with NVIDIA's driver.  One error found in Mesa, to be fixed soon.
util: add a comment to explain piglit_depth_texture()
teximage-errors: use piglit_check_gl_error() helper
teximage-errors: fix a couple mistakes, add two new test cases

Fix incorrect texture height (16, not 15).
Fix incorrect width, height for glCopyTexSubImage2D() test.
Add two new SubImage tests for non-existant mipmap levels.
piglit gl: convert gl extension checking to use an array of strings

This better matches the interface of glGetStringi, which should be used
for GL >= 3.0.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
piglit gl: use glGetStringi for GL >= 3.0

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>