Bug 15194

Summary: glPolygonOffset has no effect on glPolygonMode(GL_LINE)
Product: Mesa Reporter: WuNian <nian.wu>
Component: Drivers/DRI/i965Assignee: haihao <haihao.xiang>
Status: VERIFIED INVALID QA Contact:
Severity: normal    
Priority: medium CC: dri-devel
Version: git   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: test case

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.