Created attachment 31480 [details] program draws triangle with clockwise winding The R600 driver doesn't correctly handle glFrontFace(GL_CW) I attached a small program to demonstrate the problem. The attached program: - sets the mode of back-facing polygons to GL_LINE, so one can see the visual difference between the front-facing and back-facing polygons. - selects polygons with clockwise winding as front-facing - draws a triangle with clockwise winding When the program is run with the software renderer it renders the front-facing polygons as expected, but the R600 driver renders the back-facing polygons.
Created attachment 31633 [details] [review] select proper front/back face in polygon mode This patch seems to fix the issue here.
Hmm, with the patch the test program runs correctly, but if I comment out glFrontFace(GL_CW) in the test program, the situation is reversed. It will render a solid triangle while the software renderer renders an outline triangle.
I think I found the problem. The hardware already makes the right decision based on the FACE_bit. This code in r700UpdatePolygonMode actually reverses it when using clockwise winding: if (ctx->Polygon.FrontFace == GL_CCW) { f = ctx->Polygon.FrontMode; b = ctx->Polygon.BackMode; } else { f = ctx->Polygon.BackMode; b = ctx->Polygon.FrontMode; } Changing it to: f = ctx->Polygon.FrontMode; b = ctx->Polygon.BackMode; seems to fix it and render everything correctly.
fixed in master
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.