mesa/formatquery: support for IMAGE_FORMAT_COMPATIBILITY_TYPE
authorAlejandro Piñeiro <apinheiro@igalia.com>
Sat, 19 Dec 2015 10:02:21 +0000 (11:02 +0100)
committerEduardo Lima Mitev <elima@igalia.com>
Thu, 3 Mar 2016 14:14:06 +0000 (15:14 +0100)
commitb750144b0a5be87b5ed3008f3373b1f96722b9bd
tree5038c5c5c648b02bcb508fab37801fca077df989
parente98a3c799f5db65966f87c5d59552ae22a001084
mesa/formatquery: support for IMAGE_FORMAT_COMPATIBILITY_TYPE

From arb_internalformat_query2 spec:

 "IMAGE_FORMAT_COMPATIBILITY_TYPE: The matching criteria use for the
  resource when used as an image textures is returned in
  <params>. This is equivalent to calling GetTexParameter with <value>
  set to IMAGE_FORMAT_COMPATIBILITY_TYPE."

Current implementation of GetTexParameter for this case returns a
field of a texture object, so the support of this pname was
implemented creating a temporal texture object and returning that
value.

It is worth to mention that right now that field is not reassigned
after initialization. So it is somehow hardcoded. An alternative
option would be return that value. That doesn't seems really scalable
though.

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

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