http://bugs.winehq.org/show_bug.cgi?id=27145
--- Comment #53 from Henri Verbeet hverbeet@gmail.com 2012-02-16 06:36:34 CST --- (In reply to comment #46)
Created attachment 37930 [details] glPolygonOffset vs clipping GL demo
I am not sure if this is a bug in the drivers or a difference between the GL spec and d3d behavior. The attached program tests if the polygon offset influences clipping. It draws a green quad that is clipped on the left and right side and changes the polygon offset. If the driver behaves like d3d the green area doesn't move, otherwise it does.
Afaik clipping is conceptually supposed to happen before polygon offset in OpenGL. Polygon offset making a difference for clipping sounds questionable to me, you might want to ask the relevant driver developers about that.
Page 188 of the OpenGL 4.2 Core Profile says that with fixed-point depth buffers are "limited to the range [0;1] by clamping after offset addition is performed". As I understand it that means that GL should behave like d3d does, and the drivers get it wrong. However, the spec has apparently been edited. Also it is unclear what should happen to depth values that are outside [0;1] *before* the polygon offset is added.
Probably nothing specific, although it should be noted that you're not supposed to have any unless they're explicitly generated by a fragment shader. Regular vertex depth values would be clipped to [-Wc;+Wc] and then mapped to [0;1] by the W divide and depth range transform.
Is there any chance D3DRS_ZENABLE is disabled when the gun is drawn?