OK, I think I got that:
The parameter levels
of glTexStorage
is indeed stored in the texture object, but as GL_TEXTURE_IMMUTABLE_LEVELS
, not as GL_TEXTURE_MAX_LEVEL
, as I thought.
The parameter GL_TEXTURE_MAX_LEVEL
hence remains at the default large value. (It's possible to change it manually: the immutable flag of texture object only relates to the texture buffer and its format, but not buffer data or parameters).
The texture immutability should affect LOD calculation in the following way according to the spec:
if TEXTURE_IMMUTABLE_FORMAT is TRUE, then levelbase is clamped
to the range [0; levelimmut - 1]
So leaving GL_TEXTURE_MAX_LEVEL
intact (= 1000) for an immutable texture shall have the same effect as setting it to levels-1
.
Verdict: driver bug; the driver apparently omits this clamping step.