glsl-es-1.00: Move contents of glsl-1.00 to glsl-es-1.00

Move contents of glsl-1.00 to the glsl-es-1.00 directory.

Remove a few blank lines at the end of 4 tests so that git is happy.

Last fix up all.tests so that all shader and glslparser tests for
glsl-es-1.00 are listed and referenced in the new directory.

V2: patch squashed and generated with --find-renames

Signed-off-by: Tom Gall <tom.gall@linaro.org>

V3 (Paul Berry <stereotype441@gmail.com>): Add missing initialization
of spec['glsl-es-1.00']['execution'] to all.tests.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
shader_runner: remove explicit #version directive from generated_tests.

It is instead inserted by shader_runner based on the GLSL requirement.

Tested with all.tests - glean: same number of passes.

Signed-off-by: Stuart Abercrombie <sabercrombie@chromium.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
sso-user-varying: Remove probes for undefined values.

If it's undefined, you can't expect it to (not) be any particular
value.
glx-multithread-makecurrent-*: Write the expected value for alpha

The tests would previously write 0.0 to the alpha and expect to read 1.0
back.  If the test got a visual without alpha (and it doesn't request
alpha), this would happen to work.  However, drivers are not required to
expose visuals without alpha, so the test might get an RGBA visual
afterall.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59738
Reviewed-by: Brian Paul <brianp@vmware.com>
Accept array uniform names with or without [0] from glGetActiveUniform

This is required by OpenGL ES 3.0 and desktop OpenGL 4.2.  Previous
version were ambiguous.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: Frank Henigman <fjhenigman@google.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59688
Reviewed-by: Carl Worth <cworth@cworth.org>
GL_ARB_ubo/getintegeri_v: Respect implementation value of GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: Vinson Lee <vlee@freedesktop.org>
Cc: Fredrik Höglund <fredrik@kde.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59331
gles2: add fbo_discard_gles2 testcase

tests GL_EXT_discard_framebuffer implementation

v2: changed to use piglit_check_gl_error instead of own macro
v3: use correct enums, def_attach <-> usr_attach
v4: quote errors section from extension specification
v5: - [chadv] Minor whitespace fixes.
    - [chadv] Check for GL_NO_ERROR after each call to
      glDiscardFramebufferEXT on a valid enum.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Test transform feedback of varying structs.

The test may be run either against GLSL ES 3.00 or against desktop
GLSL 1.50.  When desktop GLSL is tested, the test verifies proper
functioning both with and without the use of interface blocks.

This test is slightly meaner than what's currently necessary to verify
proper functionality in Mesa (in particular, it tests a variety of
different nestings of structs and arrays, even though no extra
implementation effort was necessary to make these tests pass).  I have
two reasons for wanting to write such a mean test:

- Varying structs in Mesa are currently implemented using a naive
  layout that packs structure and array contents in order with no gaps
  (in much the same way that structs are laid out in memory in C).
  It's likely that in the future we will need to replace this with a
  more sophisticated mechanism that "flattens" varying structs to
  their constituent fields.  Such an implementation will have
  important corner cases involving complex nesting of structs and
  arrays.

- During my implementation of this feature in Mesa (and my development
  of this test), I cross-checked against a competing implementation
  and found several bugs, particularly in cases involving complex
  nesting of structs and arrays.  It seemed worthwhile to write a test
  capable of detecting these bugs.

v2: Use asprintf to concatenate strings.  Dump shaders if there is a
failure.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
ARB_shading_language_packing: fix exact tests

Commit 78435fe (ARB_shading_language_packing: Allow some imprecision
in unpackUnorm4x8) inadvertently introduced a regression to the
unpackHalf2x16 tests.  In those tests, the "exact" uniform wasn't
being initialized, resulting in the tests being run in inexact
fashion.

Surprisingly, this actually produced a failure, because inexact
testing uses "distance(actual, expect) < 0.00001" as the pass/fail
criterion, and this doesn't work when actual == expect == Infinity
(because distance(Inf, Inf) == NaN).

We always intended to test unpackHalf2x16 in exact fashion anyhow, so
the fix is to go ahead and initialize the "exact" uniform to 1 for
this case.

Reviewed-by: Matt Turner <mattst88@gmail.com>
ARB_uniform_buffer_object/row_major: Reference another missed UBO member.

Makes the test pass on Mesa master.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59957
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
layout-std140-base-size-and-alignment: Fix running the test.

The shaders compile failed as of
10628a004e18190b015bacf7640b638c51db82d0

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59648
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
ext_transform_feedback: Do not use empty initializers.

Fixes these MSVC build errors.

structs.c(499) : error C2059: syntax error : '}'
structs.c(504) : error C2059: syntax error : '}'
structs.c(567) : error C2059: syntax error : ','
structs.c(623) : error C2059: syntax error : ','
structs.c(696) : error C2059: syntax error : ','

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
util/waffle: Print message when falling back to compatibility context

Some tests declare in their config block that they support running under
both core and compatibility contexts. In this case, Piglit first attempts
to use a core context; if core context creation fails, then Piglit falls
back to the compatibility context.

This patch prints a diagnostic when the fallback occurs.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
util/waffle: Refactor make_context_current()

This refactor makes the function body more readable.

Understanding the function no longer requires the reader to track the
value of `ok` throughout the function body. Also, some conditional
branches have been removed by using early returns.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
util/waffle: More wisely handle compat context versions > 1.0

The commit below caused many shader_runner tests to skip on drivers that
lack GLX_ARB_create_context and EGL_KHR_create_context.  This patch fixes
those regressions buy changing the way that Piglit handles requests for
compatibility contexts.

    commit 3a92ffa0eb1efff8ccbe65b5c51710cea8ef0c5c
    Author: Paul Berry <stereotype441@gmail.com>
    Date:   Fri Feb 8 13:04:13 2013 -0800

	shader_runner and glslparsertest: choose GL version more accurately.

The regressing commit set test_config->supports_gl_compat_version to the
least version that is guaranteed to support the GLSL version used by the
test. If supports_gl_compat_version > 10, then a code path was taken in
Waffle that requires the driver to support GLX_ARB_create_context or
EGL_KHR_create_context.

This patch changes piglit_wfl_framework to *not* specify a GL version when
creating a compatibility waffle_context. If context creation succeeds,
Piglit checks that the actual context version satifies the requested
version and skips the test accordingly.

CC: Paul Berry <stereotype441@gmail.com>
Tested-by: Michel Dänzer <michel@daenzer.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
scissor-polygon: a replacement for the glean scissor test
remove glean scissor test

Replaced by new piglit scissor-polygon test.
piglit: add piglit_get_prim_name() helper

Reviewed-by: Eric Anholt <eric@anholt.net>
longprim: use piglit_get_prim_name() function

Reviewed-by: Eric Anholt <eric@anholt.net>
shader_runner: use piglit_get_prim_name()

Reviewed-by: Eric Anholt <eric@anholt.net>