We were previously not doing at least some of the checks. This uses the
same logic that is used in glTexImage*.
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
return GL_TRUE;
}
+ if (!texture_formats_agree(texImage->InternalFormat, format)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "%s(incompatible internalFormat = %s, format = %s)",
+ callerName,
+ _mesa_enum_to_string(texImage->InternalFormat),
+ _mesa_enum_to_string(format));
+ return GL_TRUE;
+ }
+
GLenum internalFormat = _mesa_is_gles(ctx) ?
oes_float_internal_format(ctx, texImage->InternalFormat, type) :
texImage->InternalFormat;