Extend max level to include i for writing and so fb is complete and avoid resulting errors like:
"Framebuffer is incomplete: Attachment level is not in the [base level, max level] range".
(cherry picked from commit e9bbe6fc784658f1e7116cb44f3f70e16aae09fd)