Bug 2066

Summary: Polygons with parts outside the window gets misrendered.
Product: Mesa Reporter: Thomas Hellström <thomas>
Component: Drivers/DRI/UnichromeAssignee: Yann Vernier <yann-freedesktop-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: high    
Version: git   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Python Tk+OpenGL program demonstrating clipping bug
change GET_VERTEX_SIZE() to return vertex stride

Description Thomas Hellström 2004-12-12 14:11:13 UTC
Polygons which have parts outside the window will get misrendered with the
Unichrome driver. 

To reproduce, launch glxgears and resize the window so that a gear is partly
outside the window. Then the vertex coordinates that are outside the visible
area apparently gets clamped to the opposite border of the window, and the
triangle is drawn right across the window. Seems to be an easy thing to fix, but
I don't know where to look.

/Thomas
Comment 1 Yann Vernier 2004-12-17 00:48:35 UTC
Created attachment 1559 [details]
Python Tk+OpenGL program demonstrating clipping bug

This interactive program nicely demonstrates such a bug. It uses a texture
(NeHe.bmp) and is based on the PyGL versions of NeHe's sample OpenGL code.

Correctly drawn, this has a background with a blue square in the center, red
left side, and magenta right side. It contains a single textured (2x2) quad
movable with the left mouse button. Drag it to the lower left corner, and the
top right corner snaps to the left edge. I do not know why this does not happen
if the quad is not textured, and this isn't the simplest possible test case,
but at least it is consistent.
Comment 2 Yann Vernier 2004-12-17 04:35:10 UTC
the problem occurs somewhere in CopyPV called from via_vb_cliptmp.h, still
investigating
Comment 3 Yann Vernier 2004-12-17 04:36:27 UTC
didn't mean to assign it to the mailing list..
Comment 4 Yann Vernier 2004-12-17 06:30:22 UTC
Created attachment 1560 [details] [review]
change GET_VERTEX_SIZE() to return vertex stride

This macro caused the pointer arithmetic in tnl_dd to go wrong when accessing
the vertex buffers. The patch appears to solve the problem for both the test
case and glxgears.
Comment 5 Thomas Hellström 2004-12-18 04:18:41 UTC
Yes, this fixes the problem and also a hardlock problem I have been having with
a CFD mesh drawing application when parts of the mesh gets outside the window.
Great.

I've commited this.

/Thomas
Comment 6 Adam Jackson 2009-08-24 12:22:54 UTC
Mass version move, cvs -> git

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.