summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/formatquery.c
diff options
context:
space:
mode:
authorAntia Puentes <apuentes@igalia.com>2015-11-10 13:53:45 +0100
committerEduardo Lima Mitev <elima@igalia.com>2016-03-03 15:14:06 +0100
commitc22ceb08bb4340b8f6e13e5b94fb288ce1bfeefa (patch)
treecab6952a886f7b7db58479a210e70c5dad4d108e /src/mesa/main/formatquery.c
parente976a30db8f24ec81259140f157a224c49aa373e (diff)
downloadexternal_mesa3d-c22ceb08bb4340b8f6e13e5b94fb288ce1bfeefa.zip
external_mesa3d-c22ceb08bb4340b8f6e13e5b94fb288ce1bfeefa.tar.gz
external_mesa3d-c22ceb08bb4340b8f6e13e5b94fb288ce1bfeefa.tar.bz2
mesa/formatquery: Added {COLOR,DEPTH,STENCIL}_COMPONENTS <pname> queries
Reviewed-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/mesa/main/formatquery.c')
-rw-r--r--src/mesa/main/formatquery.c30
1 files changed, 27 insertions, 3 deletions
diff --git a/src/mesa/main/formatquery.c b/src/mesa/main/formatquery.c
index ef2b270..5d7df15 100644
--- a/src/mesa/main/formatquery.c
+++ b/src/mesa/main/formatquery.c
@@ -965,15 +965,39 @@ _mesa_GetInternalformativ(GLenum target, GLenum internalformat, GLenum pname,
}
case GL_COLOR_COMPONENTS:
- /* @TODO */
+ /* The ARB_internalformat_query2 spec says:
+ *
+ * "- COLOR_COMPONENTS: If the internal format contains any color
+ * components (R, G, B, or A), TRUE is returned in <params>.
+ * If the internal format is unsupported or contains no color
+ * components, FALSE is returned."
+ */
+ if (_mesa_is_color_format(internalformat))
+ buffer[0] = GL_TRUE;
break;
case GL_DEPTH_COMPONENTS:
- /* @TODO */
+ /* The ARB_internalformat_query2 spec says:
+ *
+ * "- DEPTH_COMPONENTS: If the internal format contains a depth
+ * component (D), TRUE is returned in <params>. If the internal format
+ * is unsupported or contains no depth component, FALSE is returned."
+ */
+ if (_mesa_is_depth_format(internalformat) ||
+ _mesa_is_depthstencil_format(internalformat))
+ buffer[0] = GL_TRUE;
break;
case GL_STENCIL_COMPONENTS:
- /* @TODO */
+ /* The ARB_internalformat_query2 spec says:
+ *
+ * "- STENCIL_COMPONENTS: If the internal format contains a stencil
+ * component (S), TRUE is returned in <params>. If the internal format
+ * is unsupported or contains no stencil component, FALSE is returned.
+ */
+ if (_mesa_is_stencil_format(internalformat) ||
+ _mesa_is_depthstencil_format(internalformat))
+ buffer[0] = GL_TRUE;
break;
case GL_COLOR_RENDERABLE: