summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/formatquery.c
diff options
context:
space:
mode:
authorEduardo Lima Mitev <[email protected]>2015-12-19 17:03:18 +0100
committerEduardo Lima Mitev <[email protected]>2016-03-03 15:14:06 +0100
commiteacb2c971ed2aa0a2f51f47d8b1667a5edf97a00 (patch)
tree252d7198f6d1ace79b8f9a6dfe47c294f3e2ab33 /src/mesa/main/formatquery.c
parent56ec2dfcb1b9e2756d550dfad9008597b1951997 (diff)
mesa/formatquery: Added INTERNALFORMAT_PREFERRED pname
Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/mesa/main/formatquery.c')
-rw-r--r--src/mesa/main/formatquery.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/mesa/main/formatquery.c b/src/mesa/main/formatquery.c
index 00abe399ed2..2037e84e17b 100644
--- a/src/mesa/main/formatquery.c
+++ b/src/mesa/main/formatquery.c
@@ -582,6 +582,10 @@ _mesa_query_internal_format_default(struct gl_context *ctx, GLenum target,
params[0] = GL_TRUE;
break;
+ case GL_INTERNALFORMAT_PREFERRED:
+ params[0] = internalFormat;
+ break;
+
default:
_set_default_response(pname, params);
break;
@@ -665,7 +669,16 @@ _mesa_GetInternalformativ(GLenum target, GLenum internalformat, GLenum pname,
break;
case GL_INTERNALFORMAT_PREFERRED:
- /* @TODO */
+ /* The ARB_internalformat_query2 spec says:
+ *
+ * "- INTERNALFORMAT_PREFERRED: The implementation-preferred internal
+ * format for representing resources of the specified <internalformat> is
+ * returned in <params>.
+ *
+ * Therefore, we let the driver answer.
+ */
+ ctx->Driver.QueryInternalFormat(ctx, target, internalformat, pname,
+ buffer);
break;
case GL_INTERNALFORMAT_RED_SIZE: