[Mesa-dev] [PATCH 0/2 v2] Add support for clip distances in Gallium

Jose Fonseca jfonseca at vmware.com
Tue Dec 13 12:58:24 PST 2011



----- Original Message -----
> On 12/13/2011 09:11 PM, Jose Fonseca wrote:
> > 
> > 
> > ----- Original Message -----
> >> This is an updated version of the patch set I sent to the list a
> >> few
> >> hours
> >> ago.
> > 
> > 
> >> There is now a TGSI property called
> >> TGSI_PROPERTY_NUM_CLIP_DISTANCES
> >> that drivers can use to determine how many of the 8 available clip
> >> distances
> >> are actually used by a shader.
> > 
> > Can't the info in TGSI_PROPERTY_NUM_CLIP_DISTANCES be easily
> > derived from the shader, and queried through
> > src/gallium/auxiliary/tgsi/tgsi_scan.h ?
> > 
> > 
> > Could you also elaborate on why TGSI_SEMANTIC_CLIPDIST is useful
> > for the drivers? I personally don't have nothing against it, but
> > just like to understand why it makes a difference.
> > 
> 
> Why does TGSI_SEMANTIC_*POSITION* make a difference ?
> 
> Right, because the position values are consumed by the fixed function
> rasterizer. So are the clip distances.
> 
> This is not about pipe_clip_state.ucp but about what this legacy
> cruft
> has to be turned into if GL_CLIP_PLANEi is used instead of GLSL 1.3's
> gl_ClipDistance[i].

I'm just surprised because I thought there was no more fixed function clipping.

Can you give an example of such legacy cruft?

> The same mentality ("What's information useful for ?") cost me
> TGSI_SEMANTIC_TEXCOORD and now I have to rely on a hack to make point
> coordinate replacement work on nvc0
> (http://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/drivers/nvc0/nvc0_program.c#n29).
>
> I'm sorry I'm a bit sensitive on the issue of dropping information at
> the gallium threshold.

Please don't vent it on me.  As I explicitly said, I don't oppose (I imagined there was a good reason), and I'm asking for my own education.

And these are questions that always need to be asked.  Or even better, should be answered from the start -- commit messages in general, and interface changes in particular, should not just summarize what its being changed, but also _why_ it changed. The patch series included no pipe driver changes, so it's not possible even to induce from them.


Concerning TGSI_SEMANTIC_TEXCOORD I can't remember/comment if/what/why it was decided like that.  Please start a new thread and a link to any previous thread if you wanna revisit it.

I'm sorry the choices done in gallium cause you so much grief. But dropping information is a trade off between simple interface and a rich interface, and not inherently bad or good. The only question is have the right trade offs been made. And there's always room for improvement.


Jose


More information about the mesa-dev mailing list