On Sat, 20 Dec 2003 08:01:07 -0500
Keith Whitwell <[EMAIL PROTECTED]> wrote:

> Felix Kühling wrote:
> > Hi,
> > 
> > while working on the savage driver I found two problems. One with
> > tnl/t_vb_render.c, the other one with tnl_dd/t_dd_tritmp.h. Both started
> > since I use different hardware primitives for quads and
> > triangles/polygons.
> > 
> > TAG(quad) in t_dd_tritmp.h calls RASTERIZE( GL_TRIANGLES ) directly
> > before QUAD( (v[0]), (v[1]), (v[2]), (v[3]) ). RASTERIZE should be
> > called with GL_QUADS so that the driver selects the correct hardware
> > primitive. Also I believe that we could use the same condition as in
> > TAG(triangle), namely
> > 
> >       if (DO_UNFILLED)
> >      RASTERIZE( GL_QUADS );
> 
> This looks ok.
> 
> > I wonder when this condition will be true anyway. But without this
> > RASTERIZE is called for every single quad!
> > 
> > The second problem is in t_vb_render.c with clipped primitives. When a
> > clipped primitive is rendered the PrimitiveNotify callback gets called
> > with GL_POLYGON. When the next unclipped primitive is drawn we have to
> > call PrimitiveNotify again with the original primitive type.
> > 
> 
> I think this is a misunderstanding.  Although at a hardware level, you may be 
> rendering with who knows what primitive, at a GL level, you are still 
> attempting to render a TRIANGLE, QUAD, whatever.
> 
> The only time a difference between TRIANGLES, QUADS and POLYGONS emerges is if 
> flat shading is active, in which case a different vertex is choosen to provide 
> the color for the whole primitive.  Is this the problem you're seeing, or is 
> it something less subtle?

I am aware of the flat shading issue, but this is not the problem here.

Polygons are rendered using triangles. I use a different hardware
primitive for Quads. So after rendering a clipped quad as a polygon
(using triangles as hardware primitve) I have to tell the driver that
the next primitive is going to be a quad again and that it has to select
the right hardware primitive. Without this some quads got rendered as
triangles with half the quad missing after a clipped quad was rendered
as a polygon.

Thinking about it again, this is only a problem with quads, so the calls
to PrimitiveNotify after clipped triangles and lines could be removed
from the patch.

> 
> Keith

------------    __\|/__    ___     ___       -------------------------
 Felix       ___\_e -_/___/ __\___/ __\_____   You can do anything,
   Kühling  (_____\Ä/____/ /_____/ /________)  just not everything
 [EMAIL PROTECTED]       \___/   \___/   U        at the same time.


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
--
_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to