I am processing videos with metal and swift. I have a vertex shader that scales the frames to aspect fit inside my view. In my fragment shader it works well if I sample with textureCoordinates like so:
inputTexture.sample(sampler, inputFragment.textureCoordinates);
But if I use read with position instead, it returns the unscaled frame:
inputTexture.read(uint2(inputFragment.position.xy));
I am assuming that this is usual behavior, I just don't know why so I was wondering if someone could explain the difference between the two. Thanks!