getting texture dimensions from inside a shader


I would like to get texture’s width height and depth from within the shader. Is that possible? I read some previous posts on how there is no way to do this except sending the dimension values as uniform variables into the shader. Is this still the case?

I have code where the texture is bound to a texture unit in a different location and then the shader’s sampler is attached to the texture unit (all the shader binding etc in a different location). I would like to keep all things together instead of decoupling properties of a texture in different variables, samplers etc in different locations and then loosing track of these and messing up.


Look here: