threadpool.py: Completely rewrite threadpool.py

This patch completely rewrites the threadpool module. This new
implementation is less complicated than the previous version. It also is
not an external project pulled in, but an original implementation.

This tries to be largely API compatible with the previous ThreadPool
implementation. And for piglit's use case it is, however, it does not
implement the full API supported by the previous implementation.

v2: - fix some comments

Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Run all tests out of a ThreadPool

This patch removes the ConcurrentThreadPool singleton and opts instead
for creating two ThreadPools, one with multiple threads and a second one
that contains only one thread.

The reasoning for this change is two fold, first it gets rid of a rather
questionable use of a singleton, and second it cleans up the Test
derived classes. since they don't have to have a method to add
themselves to the ThreadPool, instead the ThreadPool has a method for
adding tests to itself.

v2: - Only add concurrent tests to the concurrent ThreadPool
    - Correct typos in comments

Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
KHR_debug: test ObjectLabel(), GetObjectLabel(), ObjectPtrLabel() and GetObjectPtrLabel()

v10: Clean up whitespace nits, fix up naming and concurrency in the
     tests list (changes by anholt).

V9: replace array index magic numbers with enums

V8: make sure all each object is available in the OpenGL
implementation before doing get/set tests
fix copy and paste mistake with framebuffer/renderbuffer tests

V7: be defensive when testing max label, use fprintf for errors,
code tidy ups, and added get/set tests for each object type

V6: fix spelling of generated in multiple places

V5: Removed unneeded assignment that was also out of bounds

V4: Removed failure test that will never be true

V3: changed indentation to tabs, use test label constants
and remove unused variable

V2: fixed whitespaces, broke tests into subtests,
added missing build dir, and tidied up fail messages

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Eric Anholt <eric@anholt.net>
gles2: Add a test for the "No linking without a VS or FS" requirement.

I didn't see an existing test for this when I thought there was a bug.
It was working correctly in Mesa already, though.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
core.py: Fix bug in TestrunResult.__repairFile()

For some reason this code was looking for 12 spaces followed by '}',
when it should have been looking for eight paces followed by '}'

Tested-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
gl3.2/glsl1.50: test that uniform variables in a named uniform block cannot be accessed or modified by glUniform* commands

Section 2.11.4 (Uniform Variables) of the GL 3.2 spec says:
 "Uniforms in a named uniform block are not assigned a location and may
  not be modified using the Uniform* commands."

v2 (Paul Berry <stereotype441@gmail.com>): Fix incorrect filename in
all.tests.  Drop unnecessary glUniform* calls.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
GS: Test that geometry ins/outs can have flat/smooth/noperspective qualifiers

v2: Modify test to also test for correct interpolation of data being passed

Reviewed-by: Paul Berry <stereotype441@gmail.com>
GS: Tests that varying arrays can only be passed between VS and GS within blocks

v2: Fix comments and also modify vs-gs-arrays-within-blocks-pass.shader_test
so that all vertices have different values to be checked

Reviewed-by: Paul Berry <stereotype441@gmail.com>
GS: Test that varyings of the same name between VS and GS must match types

Reviewed-by: Paul Berry <stereotype441@gmail.com>
GS: Test that EndPrimitive() is optional for geometry output layout of "points"

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Test that invariant qualifier is available to all shaders

 GLSL 1.50 section 4.6.1 (The Invariant Qualifier) says:
   To ensure that a particular output variable is invariant, it is necessary
   to use the invariant qualifier. It can either be used to qualify a
   previously declared variable as being invariant
       invariant gl_Position; // make existing gl_Position be invariant
       out vec3 Color; // make existing Color be invariant
       invariant Color;
   or as part of a declaration when a variable is declared
       invariant centroid out vec3 Color;
   The invariant qualifier must appear before any interpolation qualifiers or
   storage qualifiers when combined with a declaration. Only variables output
   from a shader (including those that are then input to a subsequent shader)
   can be candidates for invariance. This includes user-defined output variables
   and the built-in output variables. For variables leaving one shader and coming
   into another shader, the invariant keyword has to be used in both shaders,
   or a link error will result.

v2 (Paul Berry <stereotype441@gmail.com): Add missing write to
extra01.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
GLSL: Test that input layout qualifiers cannot be used on variable declarations

Reviewed-by: Paul Berry <stereotype441@gmail.com>
khr_debug: Do not use dynamically sized arrays.

This patch fixes MSVC build errors introduced with commit
6a1250d27ee56afdddf532afe3edbc4e436355c7.

debug-object-label.c
debug-object-label.c(49) : error C2057: expected constant expression
debug-object-label.c(49) : error C2466: cannot allocate an array of constant size 0
debug-object-label.c(49) : error C2133: 'label' : unknown size
debug-object-label.c(112) : error C2057: expected constant expression
debug-object-label.c(112) : error C2466: cannot allocate an array of constant size 0
debug-object-label.c(112) : error C2133: 'length' : unknown size
debug-object-label.c(113) : error C2057: expected constant expression
debug-object-label.c(113) : error C2466: cannot allocate an array of constant size 0
debug-object-label.c(113) : error C2087: 'label' : missing subscript
debug-object-label.c(113) : error C2133: 'label' : unknown size
debug-object-label.c(282) : error C2057: expected constant expression
debug-object-label.c(282) : error C2466: cannot allocate an array of constant size 0
debug-object-label.c(282) : error C2133: 'label' : unknown size
debug-object-label.c(368) : error C2057: expected constant expression
debug-object-label.c(368) : error C2466: cannot allocate an array of constant size 0
debug-object-label.c(368) : error C2133: 'buffers' : unknown size
debug-object-label.c(370) : error C2057: expected constant expression
debug-object-label.c(370) : error C2466: cannot allocate an array of constant size 0
debug-object-label.c(370) : error C2133: 'label' : unknown size

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70248
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
piglit: silence piglit_report_subtest_result() format warnings

silences a bunch of warnings such as:
"tests/fbo/fbo-alphatest-formats.c:184:3: warning: format not
a string literal and no format arguments [-Wformat-security]"
fbo-gl_pointcoord: clean up shader formatting
glean: silence unused var compiler warning
layered-2d-texture-render: add const qualifiers to silence warnings
max-texture-size: improve error message info
Test that struct names may not begin with "gl_" prefix.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Test illegal usages of "gl_" prefix in interface blocks.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>