Rasterization: How does hardware disambiguate identical Z values at silhouette edges?
If you are taking about this occurring within a single draw call for a single object then you are talking about rasterization not Z fighting.  So the real question is, &quot;how are two triangles rasterized that are right next to each other&quot;. And the answer to that question boils down to rasterization rules. Which must be enforced, on GPU's that happens in hardware, for your software rasterizer you need to pick a rule set, then enforce it in code. Generically a rasterizer can leave no holes, and each pixel is only drawn once. You may want to always add colors when drawing your triangles, start with a color of zero and just add new colors drawn to that pixel, this will make your overdraw stand out like a sore thumb.
The most widely know rule set for handling this is the &quot;top left rule&quot; which states: The center of every pixel must lie completely inside the triangle, (you are computing pixel centers right?) or it center lies exactly on a triangle edge or on multiple edges in the case of corners, and a left edge is a non-horizontal edge that is on the left side of the triangle.
This last bit is directly from Wikipedia.