[Mesa-dev] [PATCH 1/2] mesa: Generate invalid operation in glGenerateMipMap for integer textures

Brian Paul brianp at vmware.com
Fri Nov 2 11:35:05 PDT 2012


On 11/02/2012 12:29 PM, Anuj Phogat wrote:
> Khronos has reached a conclusion and disallowed following texture formats in
> glGenerateMipMap():
>   (a) ASTC textures
>   (b) integer internal formats (e.g., RGBA8UI, RG16I)
>   (c) textures with stencil formats (e.g., STENCIL_INDEX8)
>   (d) textures with packed depth/stencil formats (e.g, DEPTH24_STENCIL8)
>
> https://cvs.khronos.org/bugzilla/show_bug.cgi?id=9471
>
> Signed-off-by: Anuj Phogat<anuj.phogat at gmail.com>
> ---
>   src/mesa/main/fbobject.c |    9 +++++++++
>   1 files changed, 9 insertions(+), 0 deletions(-)
>
> diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
> index 9cde52a..e781d84 100644
> --- a/src/mesa/main/fbobject.c
> +++ b/src/mesa/main/fbobject.c
> @@ -2637,6 +2637,15 @@ _mesa_GenerateMipmapEXT(GLenum target)
>         return;
>      }
>
> +   if (_mesa_is_enum_format_integer(srcImage->InternalFormat) ||
> +       _mesa_is_depthstencil_format(srcImage->InternalFormat) ||
> +       _mesa_is_stencil_format(srcImage->InternalFormat)) {
> +      _mesa_unlock_texture(ctx, texObj);
> +      _mesa_error(ctx, GL_INVALID_OPERATION,
> +                  "glGenerateMipmap(invalid internal format)");

Maybe "(stencil or integer format)"


> +      return;
> +   }
> +
>      if (target == GL_TEXTURE_CUBE_MAP) {
>         GLuint face;
>         for (face = 0; face<  6; face++)

For both: Reviewed-by: Brian Paul <brianp at vmware.com>

Candidates for the stable branches?

-Brian


More information about the mesa-dev mailing list