Summary: | R600: Doesn't correctly handle glFrontFace(GL_CW) | ||
---|---|---|---|
Product: | Mesa | Reporter: | Rafael Monica <monraaf> |
Component: | Drivers/DRI/R600 | Assignee: | Default DRI bug account <dri-devel> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | medium | ||
Version: | git | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
program draws triangle with clockwise winding
select proper front/back face in polygon mode |
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.
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.