depthstencil-render-miplevels: Refactor parse_args()

Subsequent patches will add extra command line arguments. So we need to
refactor parse_args() to make it more flexible.

Stop assuming that miplevel0_size and buffer_combination are at fixed
locations in argv.  Instead, walk through argv with new function
pop_arg0().

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
depthstencil-render-miplevels: Require tex target on cmd line

Require the user to supply the texture target on the command line.
This test currently supports only one texture target, GL_TEXTURE_2D,
however, and that target is hardcoded throughout the test.

Future patches will add support for GL_TEXTURE_2D_ARRAY.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
depthstencil-render-miplevels: Skip immediately when internal format is unsupported

Pre-patch, when a texture internal format was unsupported,
create_mipmapped_tex() returned NULL, no useful error message was
emitted, and the callers of create_mipmapped_tex() needed to check for
the returned NULL. However, the final result was that the test skipped.

Post-patch, as soon as we detect that the internal format is
unsupported, then print a useful error message and skip the test.
Callers of create_mipmapped_tex() no longer need to check for NULL.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
depthstencil-render-miplevels: Add data types to represent texture miptree

Add the following new types to represent a miptree:
    struct texture
    struct texture_level
    struct texture_layer

Also add constructors and accessors for them. The new types and
functions are not yet used. Later pateches will incrementally convert
the test to use them.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
depthstencil-render-miplevels: Use the new miptree structures

The previous patch defined new datatypes to represent the miptree under
test. This patch rewrites all the testcode to use them.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
depthstencil-render-miplevels: Remove some global vars

Now that the test uses the new miptree structures, the variables
'depth_format' and 'miplevel0_size' no longer need to be global.
This patch moves those globals to become local vars in main(), and
refactors parse_args() to return them as out parameters.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
depthstencil-render-miplevels: Refactor how texture is displayed

This affects only non-auto mode.

TODO: Comment new func.
TODO: Commit message.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
depthstencil-render-miplevels: Use shaders

TODO: commit message

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
wip! depthstencil-render-miplevels: Change layout, dynamically resize to window

TODO: commit message
depthstencil-render-miplevels: Give width0 and height0 separately on cmdline
wip! depthstencil-render-miplevels: Add cases for GL_TEXTURE_2D_ARRAY