Current pixel in Compute Shader?

Is it possible to refer to the current pixel of a compute shader?

Every example I’ve seen that refers to individual pixels uses a declaration like

void MyComputeFunc(uint2 tid : SV_DispatchThreadID)

and then uses tid to calculate the current pixel, but this only works if you have more threads than you have pixels in your texture. What am I missing?

EDIT: Turns out I was wrong

If I use
[numthreads(1, 1, 1)]

in my compute shader and then use X by Y thread groups where x and y are my texture dimensions, everything works fine.

It might work faster if instead, for example

[numthreads(1, 1, 1)] and shader.Dsipatch(ki, 1024, 1024, 1)

you spread the numbers between groups and threads by going

[numthreads(32, 32, 1)] and shader.Dsipatch(ki, 32, 32, 1)

It will still be 1024x1024 threads.