How to get the texture XY resolution and assign it to values of a component?

I’ve solved it with a custom HLSL snippet, see here: