Bug 15194 - glPolygonOffset has no effect on glPolygonMode(GL_LINE)
Summary: glPolygonOffset has no effect on glPolygonMode(GL_LINE)
Status: VERIFIED INVALID
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: git
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: haihao
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-25 00:46 UTC by WuNian
Modified: 2009-08-24 12:29 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
test case (1.85 KB, text/plain)
2008-03-25 00:46 UTC, WuNian
Details

Description WuNian 2008-03-25 00:46:29 UTC
Created attachment 15441 [details]
test case

The attached test case enables POLYGON_OFFSET_LINE, and calls
 glPolygonOffset(0.0, 3000.0);

When run with i915 and i965 driver, all of the edge pixels' depth value is 0.
If run with soft rendering, the edge pixels' depth value is  0.045777.
Comment 1 Eric Anholt 2008-03-27 15:46:08 UTC
I played with this a bit, and noted that making apply_offset do arbitrary changes to the vertex data had no effect, so we're probably writing to the wrong place or just not reaching that part of the loop.
Comment 2 haihao 2008-03-27 18:04:09 UTC
depth offset is only applied to TRIANGLE object in WM state. The CLIP thread tries to do that for glPolygonMode(GL_LINE). Unfortunately it doesn't take effect.
Comment 3 haihao 2008-03-30 18:06:22 UTC
The issue on 965 is fixed in mesa 184cf464f4183a664fa0358fe118735e6fd98afe.
Comment 4 haihao 2008-03-30 22:57:24 UTC
I don't see this issue on 915
Comment 5 WuNian 2008-04-10 19:33:50 UTC
Still has one edge is incorrect, Reopen this bug.

with 965 and 915 driver, the output is:
[root@x-g965 mycase]# ./fpmisc_15194 
get depth values: 0.000000 0.045777 0.045777 0.045777

[root@x-945gm mycase]# ./fpmisc_15194 
get depth values: 0.000000 0.000358 0.000358 0.000358

With soft rendering, the output is:
[root@x-945gm mycase]# $SW ./fpmisc_15194
get depth values: 0.045777 0.045777 0.045777 0.045777
Comment 6 haihao 2008-04-10 20:13:13 UTC
(In reply to comment #5)
> Still has one edge is incorrect, Reopen this bug.
> 
> with 965 and 915 driver, the output is:
> [root@x-g965 mycase]# ./fpmisc_15194 
> get depth values: 0.000000 0.045777 0.045777 0.045777
> 
> [root@x-945gm mycase]# ./fpmisc_15194 
> get depth values: 0.000000 0.000358 0.000358 0.000358
> 
> With soft rendering, the output is:
> [root@x-945gm mycase]# $SW ./fpmisc_15194
> get depth values: 0.045777 0.045777 0.045777 0.045777
> 
This is a new problem. In fact, if draw a polygon without depth offset, and set the depth value to 0.5, you  will also get 0.00, 0.5, 0.5, 0.5.  

It seems there is one pixel bias.   glReadPixels(24, 50, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &buf[0]) can get the depth values. 

Please open a new bug to track this new issue and I close this bug.

Comment 7 WuNian 2008-04-11 00:22:11 UTC
Open bug #15444. Close this one.
Comment 8 Adam Jackson 2009-08-24 12:29:45 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.