[Mesa-dev] ARB_cull_distance support v4?

Roland Scheidegger sroland at vmware.com
Fri May 13 15:12:52 UTC 2016

Am 13.05.2016 um 06:41 schrieb Dave Airlie:
> This is just the core patches, as I think the lowering was pretty
> broken in the last couple of reposts.
> The lowering now lowers to one array of 8 or whatever. I need
> to recheck the gallium and llvmpipe bits on top of this, as I think
> llvmpipe will be broken.
Maybe. draw expects separate clip and cull dists, each packed as vec4s
(it could probably handle up to 2 vec4 for each).

> I think I'm going to rip out the CULLDIST semantic from gallium,
> it really isn't what the hw wants.

I can't really see how the output is going to look like from your
change, but there's reasons things are the way they are. This is, of
course, all inspired by d3d10 (this even predates the gl cull dist
extension) - d3d10 has these weirdo packed vec4. The problem is, in
d3d10, you can have a vec4 output declared, with x component being a
ordinary output, yz being a clipdist, and w being a cull dist. But in
gallium, we can't really have different semantics per output - hence
clip and cull must be in different outputs (and nothing else can be
packed into the same vars).
A single array for clip and cull dist each probably would have been
cleaner, but we didn't have input/output arrays for system values
neither at that time, so gallium's design is something which looks like
neither what gl, d3d10 nor probably hw wants, but was simple enough to
translate and worked.


More information about the mesa-dev mailing list