http://cgit.freedesktop.org/~airlied/mesa/commit/?h=gallium-stencil-export&id=136bffc4e5c10ff4f2f4c240f552e8bff0b783e5 is my initial patch, but I know its wrong, so I'm wondering how to I add per-extension builtin-variables, or any example of this that exists already. Dave.