return (error != GL_TRUE);
}
+bool
+_mesa_is_valid_generate_texture_mipmap_internalformat(struct gl_context *ctx,
+ GLenum internalformat)
+{
+ return (!_mesa_is_enum_format_integer(internalformat) &&
+ !_mesa_is_depthstencil_format(internalformat) &&
+ !_mesa_is_astc_format(internalformat) &&
+ !_mesa_is_stencil_format(internalformat));
+}
+
/**
* Implements glGenerateMipmap and glGenerateTextureMipmap.
* Generates all the mipmap levels below the base level.
return;
}
- if (_mesa_is_enum_format_integer(srcImage->InternalFormat) ||
- _mesa_is_depthstencil_format(srcImage->InternalFormat) ||
- _mesa_is_astc_format(srcImage->InternalFormat) ||
- _mesa_is_stencil_format(srcImage->InternalFormat)) {
+ if (!_mesa_is_valid_generate_texture_mipmap_internalformat(ctx,
+ srcImage->InternalFormat)) {
_mesa_unlock_texture(ctx, texObj);
_mesa_error(ctx, GL_INVALID_OPERATION,
"glGenerate%sMipmap(invalid internal format)", suffix);
bool
_mesa_is_valid_generate_texture_mipmap_target(struct gl_context *ctx,
GLenum target);
+bool
+_mesa_is_valid_generate_texture_mipmap_internalformat(struct gl_context *ctx,
+ GLenum internalformat);
extern void GLAPIENTRY
_mesa_GenerateMipmap(GLenum target);