summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/formatquery.c
diff options
context:
space:
mode:
authorEduardo Lima Mitev <[email protected]>2015-12-22 18:38:06 +0100
committerEduardo Lima Mitev <[email protected]>2016-03-03 15:14:07 +0100
commitbec286f7246bedba9f7f34185f2e1e29befec3ab (patch)
treed3c36a1d491cc30129f74db5ffad4dfafbf8fd4a /src/mesa/main/formatquery.c
parent09550c16a51e89dbf64b0864d3fb4ddb6accac52 (diff)
mesa/formatquery: Add READ_PIXELS_FORMAT pname
Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/mesa/main/formatquery.c')
-rw-r--r--src/mesa/main/formatquery.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/mesa/main/formatquery.c b/src/mesa/main/formatquery.c
index 28d82a206eb..a5f7c774a9d 100644
--- a/src/mesa/main/formatquery.c
+++ b/src/mesa/main/formatquery.c
@@ -598,9 +598,7 @@ _mesa_query_internal_format_default(struct gl_context *ctx, GLenum target,
GLenum internalFormat, GLenum pname,
GLint *params)
{
- (void) ctx;
(void) target;
- (void) internalFormat;
switch (pname) {
case GL_SAMPLES:
@@ -616,6 +614,26 @@ _mesa_query_internal_format_default(struct gl_context *ctx, GLenum target,
params[0] = internalFormat;
break;
+ case GL_READ_PIXELS_FORMAT: {
+ GLenum base_format = _mesa_base_tex_format(ctx, internalFormat);
+ switch (base_format) {
+ case GL_STENCIL_INDEX:
+ case GL_DEPTH_COMPONENT:
+ case GL_DEPTH_STENCIL:
+ case GL_RED:
+ case GL_RGB:
+ case GL_BGR:
+ case GL_RGBA:
+ case GL_BGRA:
+ params[0] = base_format;
+ break;
+ default:
+ params[0] = GL_NONE;
+ break;
+ }
+ break;
+ }
+
case GL_MANUAL_GENERATE_MIPMAP:
case GL_AUTO_GENERATE_MIPMAP:
case GL_SRGB_READ:
@@ -1090,14 +1108,11 @@ _mesa_GetInternalformativ(GLenum target, GLenum internalformat, GLenum pname,
break;
case GL_READ_PIXELS:
+ case GL_READ_PIXELS_FORMAT:
ctx->Driver.QueryInternalFormat(ctx, target, internalformat, pname,
buffer);
break;
- case GL_READ_PIXELS_FORMAT:
- /* @TODO */
- break;
-
case GL_READ_PIXELS_TYPE:
/* @TODO */
break;