The Slang README seems to imply that external texture sizes are available to shaders:
Builtin texture size uniform variables
If a member of a UBO or a push constant block is called ???Size# where ???# is the name of a texture variable, that member must be a vec4, which will receive these values:
- X: Horizontal size of texture
- Y: Vertical size of texture
- Z: 1.0 / (Horizontal size of texture)
- W: 1.0 / (Vertical size of texture)
It is valid to use a size variable without declaring the texture itself. This is useful for vertex shading. It is valid (although probably not useful) for a variable to be present in both a push constant block and a UBO block at the same time.
However, when I tried this it didn’t work. It seems like this section only applies to the pre-defined textures and things like feedback. Is that correct?