nvc0: fix line width on GM20x+
authorRhys Perry <pendingchaos02@gmail.com>
Fri, 20 Apr 2018 22:32:05 +0000 (23:32 +0100)
committerIlia Mirkin <imirkin@alum.mit.edu>
Sat, 21 Apr 2018 00:43:59 +0000 (20:43 -0400)
This has the side-effect of fixing polygon-offset piglit test failures.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/nvc0/nvc0_state.c

index 99d45a238aec5afbb23bf1c7c79f4ffaa4f959ed..3e204f09a4dba0730c0b66b35ac5eec256a93349 100644 (file)
@@ -233,7 +233,10 @@ nvc0_rasterizer_state_create(struct pipe_context *pipe,
     SB_IMMED_3D(so, MULTISAMPLE_ENABLE, cso->multisample);
 
     SB_IMMED_3D(so, LINE_SMOOTH_ENABLE, cso->line_smooth);
-    if (cso->line_smooth || cso->multisample)
+    /* On GM20x+, LINE_WIDTH_SMOOTH controls both aliased and smooth
+     * rendering and LINE_WIDTH_ALIASED seems to be ignored
+     */
+    if (cso->line_smooth || cso->multisample || class_3d >= GM200_3D_CLASS)
        SB_BEGIN_3D(so, LINE_WIDTH_SMOOTH, 1);
     else
        SB_BEGIN_3D(so, LINE_WIDTH_ALIASED, 1);