diff options
author | Eduardo Lima Mitev <[email protected]> | 2015-12-22 19:19:32 +0100 |
---|---|---|
committer | Eduardo Lima Mitev <[email protected]> | 2016-03-03 15:14:07 +0100 |
commit | 23f94146c987c380bcdebb0d787dc71e808afc27 (patch) | |
tree | 65dc4417d3672cf86d27f642bc3a4e4a62036726 /src/mesa/main/formatquery.c | |
parent | 020671f2a3d47ff35e9937b4db3fa09df6f6d488 (diff) |
mesa/formatquery: Add (GET_)TEXTURE_IMAGE_FORMAT pnames
Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/mesa/main/formatquery.c')
-rw-r--r-- | src/mesa/main/formatquery.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/mesa/main/formatquery.c b/src/mesa/main/formatquery.c index 32f8cf42953..d9dc5b41630 100644 --- a/src/mesa/main/formatquery.c +++ b/src/mesa/main/formatquery.c @@ -654,6 +654,21 @@ _mesa_query_internal_format_default(struct gl_context *ctx, GLenum target, break; } + case GL_TEXTURE_IMAGE_FORMAT: + case GL_GET_TEXTURE_IMAGE_FORMAT: { + GLenum format = GL_NONE; + GLenum base_format = _mesa_base_tex_format(ctx, internalFormat); + if (base_format > 0) { + if (_mesa_is_enum_format_integer(internalFormat)) + format = _mesa_base_format_to_integer_format(base_format); + else + format = base_format; + } + + params[0] = format; + break; + } + case GL_MANUAL_GENERATE_MIPMAP: case GL_AUTO_GENERATE_MIPMAP: case GL_SRGB_READ: @@ -1135,17 +1150,15 @@ _mesa_GetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, break; case GL_TEXTURE_IMAGE_FORMAT: - /* @TODO */ + case GL_GET_TEXTURE_IMAGE_FORMAT: + ctx->Driver.QueryInternalFormat(ctx, target, internalformat, pname, + buffer); break; case GL_TEXTURE_IMAGE_TYPE: /* @TODO */ break; - case GL_GET_TEXTURE_IMAGE_FORMAT: - /* @TODO */ - break; - case GL_GET_TEXTURE_IMAGE_TYPE: /* @TODO */ break; |