[Mesa-dev] [PATCH 0/6] Final clipping series for i965 Gen6+

Paul Berry stereotype441 at gmail.com
Mon Oct 3 15:11:14 PDT 2011


To the best of my knowledge, this patch series completes my work on
clipping for i965 Gen6 and beyond.  Most of this is clean-up work,
though there is one minor bug fix (patch 3/6).

The only patch which might be controversial is patch 6/6, which
"de-compacts" the clip planes for Gen6 and beyond.  In previous chip
generations, if the user enabled a nonconsecutive set of clip planes
(or a set of clip planes that didn't start at zero), we compacted them
down to a consecutive set starting at 0.  This was IMHO a dubious
optimization, and it was incompatible with gl_ClipDistance.

When I implemented gl_ClipDistance, I added logic to continue
compacting when using clip planes, but not compact when using
gl_ClipDistance.  This introduced a clumsy dependency where the
configuration of the clipper depended on the vertex shader's
"UsesClipDistance" flag, which seems like it should be a private
implementation detail of the vertex shader.  Patch 6/6 changes things
so that in Gen6 and beyond, we no longer compact clip planes at all.
Gen4 and Gen5 still compact clip planes since it would be a lot of
trouble to change their clipping logic.

After this patch series (and the gl_ClipVertex series which I sent to
the list in the last hour), i965 Gen6 passes all Piglit tests with
"clip" in the name.



More information about the mesa-dev mailing list