main/formatquery: support for MAX_{WIDTH/HEIGHT/DEPTH/LAYERS}
authorAlejandro Piñeiro <apinheiro@igalia.com>
Sat, 19 Dec 2015 10:54:32 +0000 (11:54 +0100)
committerEduardo Lima Mitev <elima@igalia.com>
Thu, 3 Mar 2016 14:14:06 +0000 (15:14 +0100)
commit4e33278b39f5292b5ca82281f7b364d402ba48b2
treea954b0436a0137e00aecdbee78b86d033fbb777b
parentb750144b0a5be87b5ed3008f3373b1f96722b9bd
main/formatquery: support for MAX_{WIDTH/HEIGHT/DEPTH/LAYERS}

Implemented by calling GetIntegerv with the equivalent pname and
handling individually the exceptions related to dimensions.

All those pnames are used to get the maximum value for each dimension
of the given target. The only difference between this calls and
calling GetInteger with pnames like GL_MAX_TEXTURE_SIZE,
GL_MAX_3D_TEXTURE_SIZE, etc is that GetInternalformat allows to
specify a internalformat.

But at this moment, there is no reason to think that the values would
be different based on the internalformat. The spec already take that
into account, using these specific pnames as example on Issue 7 of
arb_internalformat_query2 spec.

So this seems like a hook to allow to return different values based on
the internalformat in the future.

It is worth to note that the piglit test associated to those pnames
are checking the returned values of GetInternalformat against the
values returned by GetInteger, and the test is passing with NVIDIA
proprietary drivers.

main/formatquery: support for MAX_{WIDTH/HEIGHT/DEPTH/LAYERS}

Implemented by calling GetIntegerv with the equivalent pname and
handling individually the exceptions related to dimensions.

All those pnames are used to get the maximum value for each dimension
of the given target. The only difference between this calls and
calling GetInteger with pnames like GL_MAX_TEXTURE_SIZE,
GL_MAX_3D_TEXTURE_SIZE, etc is that GetInternalformat allows to
specify a internalformat.

But at this moment, there is no reason to think that the values would
be different based on the internalformat. The spec already take that
into account, using these specific pnames as example on Issue 7 of
arb_internalformat_query2 spec.

So this seems like a hook to allow to return different values based on
the internalformat in the future.

It is worth to note that the piglit test associated to those pnames
are checking the returned values of GetInternalformat against the
values returned by GetInteger, and the test is passing with NVIDIA
proprietary drivers.

v2: use _mesa_has## instead of direct ctx->Extensions access (Nanley Chery)

Reviewed-by: Dave Airlie <airlied@redhat.com>
src/mesa/main/formatquery.c