[Mesa-dev] [PATCH] nvc0: fix line width on GM20x+

Rhys Perry pendingchaos02 at gmail.com
Fri Apr 20 22:16:57 UTC 2018


Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
---
 src/gallium/drivers/nouveau/nvc0/nvc0_state.c    | 9 +++++----
 src/gallium/drivers/nouveau/nvc0/nvc0_stateobj.h | 2 +-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
index 99d45a238a..9e23340d6e 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
@@ -233,10 +233,11 @@ 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)
-       SB_BEGIN_3D(so, LINE_WIDTH_SMOOTH, 1);
-    else
-       SB_BEGIN_3D(so, LINE_WIDTH_ALIASED, 1);
+    /* On GM20x+, LINE_WIDTH_SMOOTH controls both aliased and smooth
+     * rendering, so set set both */
+    SB_BEGIN_3D(so, LINE_WIDTH_SMOOTH, 1);
+    SB_DATA    (so, fui(cso->line_width));
+    SB_BEGIN_3D(so, LINE_WIDTH_ALIASED, 1);
     SB_DATA    (so, fui(cso->line_width));
 
     SB_IMMED_3D(so, LINE_STIPPLE_ENABLE, cso->line_stipple_enable);
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_stateobj.h b/src/gallium/drivers/nouveau/nvc0/nvc0_stateobj.h
index 3006ed6195..d4f8af4e75 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_stateobj.h
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_stateobj.h
@@ -23,7 +23,7 @@ struct nvc0_blend_stateobj {
 struct nvc0_rasterizer_stateobj {
    struct pipe_rasterizer_state pipe;
    int size;
-   uint32_t state[43];
+   uint32_t state[45];
 };
 
 struct nvc0_zsa_stateobj {
-- 
2.14.3



More information about the mesa-dev mailing list