This is more of a sanity check question. Suppose I have a 512x512 image. I dispatch a down sampling compute shader with 256x256 threads total. I want to use hardware bilinear filtering, so for each thread with indices threadXY, I compute:
float2 uv = (threadXY*2 + 1) / 512;
float4 downsampledValue = tex.SampleLevel(linearSampler, uv, 0.0f);
I just want to make sure the +1 is correct, and not +0.5. The idea is if the image was 2x2, only one thread with indices (0,0) would get kicked off, and uv = (0.5, 0.5), which would be in the center of the 4 neighbor texels.