glFramebufferTexture2D mipLevel problem


So I ran into a problem when trying to render to a certain miplevel with my framebuffer.
For some strange reason it writes to 3 levels below the mipLevel I choose. for example if I type 5 into miplevel I get my result in level 2 of my texture. Could anyone think of a reason as to why this would happen?

I get no errors with my framebuffer and no glErrors, only that I get results in the wrong miplevel. I could just write mipLevel + 3 but I’d rather find the solution as to why this is happening.

Nevermind. Turns out I was simply using the “texture” sampler function instead of “textureLod” in the shader which caused the strange results.