summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/formatquery.c
diff options
context:
space:
mode:
authorAntia Puentes <[email protected]>2015-12-19 19:10:51 +0100
committerEduardo Lima Mitev <[email protected]>2016-03-03 15:14:07 +0100
commite88cbb7a51051da66bf142515bc028559f999a64 (patch)
tree2e9f77ea82288fd74225fb05aa45fcdc7b885ba2 /src/mesa/main/formatquery.c
parentb1755535ecfb5bacf21c3118c359196ad81b5e68 (diff)
mesa/formatquery: Added COLOR_ENCODING <pname> query.
From the ARB_internalformat_query2 specification: "- COLOR_ENCODING: The color encoding for the resource is returned in <params>. Possible values for color buffers are LINEAR or SRGB, for linear or sRGB-encoded color components, respectively. For non-color formats (such as depth or stencil), or for unsupported resources, the value NONE is returned." Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/mesa/main/formatquery.c')
-rw-r--r--src/mesa/main/formatquery.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mesa/main/formatquery.c b/src/mesa/main/formatquery.c
index aeed46f7259..bd69ea8f677 100644
--- a/src/mesa/main/formatquery.c
+++ b/src/mesa/main/formatquery.c
@@ -1099,7 +1099,13 @@ _mesa_GetInternalformativ(GLenum target, GLenum internalformat, GLenum pname,
break;
case GL_COLOR_ENCODING:
- /* @TODO */
+ if (!_mesa_is_color_format(internalformat))
+ goto end;
+
+ if (_mesa_is_srgb_format(internalformat))
+ buffer[0] = GL_SRGB;
+ else
+ buffer[0] = GL_LINEAR;
break;
case GL_SRGB_READ: