RenderTexture synchronization issues.

Both ComputeShader.Dispatch and Graphics.Blip is not awaited, their execution time is nearly zero. And I need either compute shader or fragment shader to generate precomputed texture in a LOT of passes (O=n^2, where n is input texture texels).

When I’m calling generation at one iteration per call, it takes way too much time, hundreds or even thousands times more that it would be if I’d generate everything in single call. But I can’t generate everything in a single call, because it’d take too long so OS would restart graphics drivers.
So, I’m trying to dynamically get shader execution time to determine how many passes it should execute at once so that single execution would take about 0.5 seconds.

But I can’t find a convenient way to determine execution time. For compute shader as a workaround I have to use dummy buffer which I access after calling Dispatch. And for Blit I can’t even find any workarounds. And I’d prefer to use Blit, because it seems that compute shader has slightly worse performance for whatever reason.

I had to resolve it by measuring update time between frames, so, no debugging allowed.