http://bugs.winehq.org/show_bug.cgi?id=27145
--- Comment #46 from Stefan Dösinger stefan@codeweavers.com 2011-12-11 13:39:10 CST --- Created attachment 37930 --> http://bugs.winehq.org/attachment.cgi?id=37930 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.
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.
My d3d program shows a moving green area on the nvidia driver, and a static one on fglrx(Radeon HD 5770) and OSX Lion(Radeon X1600). I'd be happy if people could test it on various Mesa drivers, my Mesa setup is still broken. You can compile the app with gcc polygonoffset.c -o polygonoffset -lGL -lglut .