Bug 10571 - [PATCH] Line clipping sometimes produces unexpected results
Summary: [PATCH] Line clipping sometimes produces unexpected results
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Eric Anholt
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-08 16:24 UTC by David Moore
Modified: 2009-08-24 12:26 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Patch to correct line clipping for i965 (1.71 KB, patch)
2007-04-08 16:28 UTC, David Moore
Details | Splinter Review
Test case that demonstrates the missing lines (916 bytes, text/x-csrc)
2007-08-08 00:03 UTC, David Moore
Details

Description David Moore 2007-04-08 16:24:51 UTC
When drawing long lines that extend well off the edge of the screen, some of these lines disappear completely instead of being clipped in the usual way.

I am using a G965 with the latest git version of Mesa DRI.

The problem seems to lie in the generated clip program.  In the case that _both_ dot products are positive (meaning that the line should not be clipped against that particular plane), an erroneous clip is sometimes generated.
Comment 1 David Moore 2007-04-08 16:28:43 UTC
Created attachment 9518 [details] [review]
Patch to correct line clipping for i965

I see some chatter about a "-ve rhw" workaround in the code that might have something to do with this bug.  Regardless, the attached patch seems to work.
Comment 2 David Moore 2007-08-08 00:03:46 UTC
Created attachment 11044 [details]
Test case that demonstrates the missing lines

Here is a sample program that demonstrates the bug.  This program draws 10 long lines at a slightly askew angle.  However, only 7 lines appear on screen.  If the angle of the glRotatef() command is modified slightly, all 10 lines will appear.  I would be very appreciative if an engineer from Intel could try to reproduce this on their end.  Thanks.
Comment 3 Michael Fu 2007-08-27 17:56:30 UTC
Eric, would you please review the patch? 
Comment 4 Eric Anholt 2007-08-30 14:44:59 UTC
Committed.  Thanks!
Comment 5 Adam Jackson 2009-08-24 12:26:23 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.