diff options
author | Anuj Phogat <[email protected]> | 2012-11-02 10:47:33 -0700 |
---|---|---|
committer | Anuj Phogat <[email protected]> | 2012-11-05 10:17:48 -0800 |
commit | c0a78d7d7b51e125d143e693fdfc78b90f2d68cf (patch) | |
tree | 7015e67526629705ee7300189c8ed4b85d4af868 /src/mesa | |
parent | 3700bd115841958cc9c211475d3069298e4ff266 (diff) |
mesa: Generate invalid operation in glGenerateMipMap for integer textures
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
Note: This is a candidate for stable branches.
Signed-off-by: Anuj Phogat <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | 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 fc5681ccc05..2be61fb3c80 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)"); + return; + } + if (target == GL_TEXTURE_CUBE_MAP) { GLuint face; for (face = 0; face < 6; face++) |