[Mesa-dev] [PATCH] draw: handle nan clipdistance

Zack Rusin zackr at vmware.com
Thu Aug 15 11:27:13 PDT 2013


> I realize this function isn't used but it looks unnecessarily
> complicated - two constants one AND plus one comparison when you could
> simply do a single comparison (compare x with x with unordered not
> equal). This is actually doubly bad with AVX because the int comparison
> is going to use 4 instructions instead of 1 (extract/2 cmp/1 insert),
> well if this runs 8-wide at least.

I'm going to kill that function, we already have lp_build_isnan that does the correct thing.

> Otherwise looks good. Though I'm not sure you really need to kill the
> prims if the clip distances are infinite?

The d3d10 spec says "Coordinates coming in to clipping with infinites at x, y, z may or may not result in a discarded primitive.". I liked handling them the same way as nan, otherwise we're just generating pointless primitives. I don't have a strong opinion though, wlk doesn't seem to test infinites.

z


More information about the mesa-dev mailing list