bufferstorage-persistent: new test for ARB_buffer_storage

I hacked up the glapi support, because spec files with this extension don't
exist.
arb_gpu_shader5: add compiler/invocations_count_too_large test

This test makes sure that a compile error is generated if
the invocations count is too large.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
max-texture-size: Make error checking in proxy/3D case like the others.

For some reason this was written differently than all the other cases.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
max-texture-size: Split ValidateTexSize into proxy/non-proxy functions.

The proxy and non-proxy cases shared...the skeleton of a switch statement,
some variable declarations...and return true.  Otherwise, they had nothing
in common at all.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
max-texture-size: Delete copy and pasted error checking from proxy test.

The exact same code appeared in every single case of the switch
statement.  Moving it after the switch statement has the same effect
without all the duplication.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
max-texture-size: Use "goto out" to avoid duplicating clean up code.

In general, "goto" should be avoided.  One commonly accepted use is to
jump to the bottom of the function before returning, so all the
necessary clean up code/memory freeing can be done in one place.

This avoids even more duplication in the next patch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
max-texture-size: Move texture creation into non-proxy case.

Every non-proxy case needs to create a texture, so the non-proxy testing
function may as well just do it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
max-texture-size: Remove loop over boolean value.

I don't particularly care for this pattern:

   for (boolean = 1; boolean >= 0; boolean--)

This patch pulls the body of that loop out into a helper function, and
calls it twice.  One could argue that my use of function pointers is a
bit arcane and ugly, too, but I think I prefer it in this case.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
max-texture-size: Convert to using subtests.

This test currently checks 30 different subcases.  Prior to this patch,
if one of them failed, the whole test would fail.  Running it and
examining the output would tell you which subcases had trouble, but
there was nothing in the actual Piglit summary.

Currently, this reports 'fail' for a legitimate fail, and 'pass'
otherwise.  The next commits will refine this.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
max-texture-size: Report SKIP and stop on GL_OUT_OF_MEMORY errors.

Previously, the test would call TexImage to create the texture image.
If it received a GL_OUT_OF_MEMORY error, it would continue on and call
TexSubImage to try and overwrite a part of the image...which doesn't
exist, because the GL ran out of memory when trying to create it.

Marek tried to work around this by making it accept INVALID_VALUE for
the TexSubImage calls, but Mesa can also report INVALID_OPERATION in
some cases.  Rather than quibbling about error codes, we should step
back and take a sensible action: if a texture image doesn't exist,
don't try and write to it.

When we receive a GL_OUT_OF_MEMORY error, we now report a subtest
result of "skip" and move on.  We can't realistically claim "pass" or
"fail", since we have no idea whether the implementation works or not.

For other errors, we report "fail" and stop.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
max-texture-size: Change variable to uint64_t rather than casting.

Every single usage of this variable cast it to uint64_t.  Clearly the
function parameter should be uint64_t, and we should have the compiler
automatically convert values when passed in.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
max-texture-size: Fix weird formatting.

Normally closing curly braces aren't indented like this, and normally
function parameters follow the opening ( and line up below that.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
max-texture-size: Cut SubImage data allocation by 1/4.

I honestly have no idea why, but the original test calls TexSubImage
with a width and height of *half* the texture size.  Yet it allocates
enough temporary pixel data for a full texture.  This makes no sense,
and clearly one or the other should change.

Without understanding why the existing test does what it does, I chose
to not change it and simply cut the memory allocation.  Cutting memory
usage also may reduce the likelihood of GL_OUT_OF_MEMORY errors.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>