invariant keyword (in short and unlike the more detailed Bahbar answer) is more about the very subtle computational differences that may appear, as you already mentioned, about several passes of the geometry.
Here's an example: you draw an arbitrary, strange (to make it harder) triangle on the screen. The rasterizer gets the normalized vertices and calculates all the fragments that it occupies, and then runs the fragment shader on it. Now imagine that you would like to draw another triangle exactly on top of it, but after 3 hours, while your computer is immersed in water, the temperature drops, and you eat lunch at this time. Then you recompile the shaders, and bam ...
Everyone can potentially affect the rasterizer. Shader optimization can lead to minor changes in output. While still technically correct, the result does not have to be exactly the same as the first triangle, and the โproblemsโ will represent some pixel from the first remaining.
invariant provides a possible slower approach. I am not a driver architect, mind you, but in general this can mean a few additional reset, cleanup, or sometimes full-time push / pops. Only then will you be left with a "clean" computing state, and while your equipment is in order, the result should be exactly the same.
Bartek banachewicz
source share