summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nvc0
diff options
context:
space:
mode:
authorChristoph Bumiller <[email protected]>2011-03-31 19:04:17 +0200
committerChristoph Bumiller <[email protected]>2011-04-10 14:06:52 +0200
commit843d5391c3b7b80ff2087ce7e6440417aab623cc (patch)
treec6a3d888748c51721447885ec11219c5398e244d /src/gallium/drivers/nvc0
parentd546df4d9c090656c506e8a959646a48ed00efc2 (diff)
nv50,nvc0: identify some line rasterization state
Fixes width of non-smooth (aliased) lines on nvc0.
Diffstat (limited to 'src/gallium/drivers/nvc0')
-rw-r--r--src/gallium/drivers/nvc0/nvc0_3d.xml.h8
-rw-r--r--src/gallium/drivers/nvc0/nvc0_screen.c6
-rw-r--r--src/gallium/drivers/nvc0/nvc0_state.c8
3 files changed, 17 insertions, 5 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_3d.xml.h b/src/gallium/drivers/nvc0/nvc0_3d.xml.h
index 94fa081ad7e..9a64e3ff6af 100644
--- a/src/gallium/drivers/nvc0/nvc0_3d.xml.h
+++ b/src/gallium/drivers/nvc0/nvc0_3d.xml.h
@@ -82,6 +82,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define NVC0_3D_SERIALIZE 0x00000110
+#define NVC0_3D_LINE_WIDTH_SEPARATE 0x0000020c
+
#define NVC0_3D_EARLY_FRAGMENT_TESTS 0x00000210
#define NVC0_3D_MEM_BARRIER 0x0000021c
@@ -651,7 +653,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define NVC0_3D_SCREEN_Y_CONTROL_Y_NEGATE 0x00000001
#define NVC0_3D_SCREEN_Y_CONTROL_TRIANGLE_RAST_FLIP 0x00000010
-#define NVC0_3D_LINE_WIDTH 0x000013b0
+#define NVC0_3D_LINE_WIDTH_SMOOTH 0x000013b0
+
+#define NVC0_3D_LINE_WIDTH_ALIASED 0x000013b4
#define NVC0_3D_GP_VERTEX_OUTPUT_COUNT 0x00001420
#define NVC0_3D_GP_VERTEX_OUTPUT_COUNT__MIN 0x00000001
@@ -977,6 +981,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define NVC0_3D_CULL_FACE_BACK 0x00000405
#define NVC0_3D_CULL_FACE_FRONT_AND_BACK 0x00000408
+#define NVC0_3D_LINE_LAST_PIXEL 0x00001924
+
#define NVC0_3D_VIEWPORT_TRANSFORM_EN 0x0000192c
#define NVC0_3D_VIEW_VOLUME_CLIP_CTRL 0x0000193c
diff --git a/src/gallium/drivers/nvc0/nvc0_screen.c b/src/gallium/drivers/nvc0/nvc0_screen.c
index e98a4c0fd42..17f42e6fc6c 100644
--- a/src/gallium/drivers/nvc0/nvc0_screen.c
+++ b/src/gallium/drivers/nvc0/nvc0_screen.c
@@ -294,8 +294,6 @@ nvc0_magic_3d_init(struct nouveau_channel *chan)
OUT_RING (chan, 1 << 12);
BEGIN_RING(chan, RING_3D_(0x151c), 1);
OUT_RING (chan, 1);
- BEGIN_RING(chan, RING_3D_(0x020c), 1);
- OUT_RING (chan, 1);
BEGIN_RING(chan, RING_3D_(0x030c), 1);
OUT_RING (chan, 0);
BEGIN_RING(chan, RING_3D_(0x0300), 1);
@@ -448,6 +446,10 @@ nvc0_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev)
OUT_RING (chan, NVC0_3D_MULTISAMPLE_MODE_1X);
BEGIN_RING(chan, RING_3D(MULTISAMPLE_CTRL), 1);
OUT_RING (chan, 0);
+ BEGIN_RING(chan, RING_3D(LINE_WIDTH_SEPARATE), 1);
+ OUT_RING (chan, 1);
+ BEGIN_RING(chan, RING_3D(LINE_LAST_PIXEL), 1);
+ OUT_RING (chan, 0);
nvc0_magic_3d_init(chan);
diff --git a/src/gallium/drivers/nvc0/nvc0_state.c b/src/gallium/drivers/nvc0/nvc0_state.c
index c482b25f6b6..db3b78f10b8 100644
--- a/src/gallium/drivers/nvc0/nvc0_state.c
+++ b/src/gallium/drivers/nvc0/nvc0_state.c
@@ -161,6 +161,7 @@ nvc0_blend_state_delete(struct pipe_context *pipe, void *hwcso)
FREE(hwcso);
}
+/* NOTE: ignoring line_last_pixel, using FALSE (set on screen init) */
static void *
nvc0_rasterizer_state_create(struct pipe_context *pipe,
const struct pipe_rasterizer_state *cso)
@@ -187,9 +188,12 @@ nvc0_rasterizer_state_create(struct pipe_context *pipe,
SB_BEGIN_3D(so, FRAG_COLOR_CLAMP_EN, 1);
SB_DATA (so, cso->clamp_fragment_color ? 0x11111111 : 0x00000000);
- SB_BEGIN_3D(so, LINE_WIDTH, 1);
- SB_DATA (so, fui(cso->line_width));
SB_IMMED_3D(so, LINE_SMOOTH_ENABLE, cso->line_smooth);
+ if (cso->line_smooth)
+ SB_BEGIN_3D(so, LINE_WIDTH_SMOOTH, 1);
+ else
+ SB_BEGIN_3D(so, LINE_WIDTH_ALIASED, 1);
+ SB_DATA (so, fui(cso->line_width));
SB_BEGIN_3D(so, LINE_STIPPLE_ENABLE, 1);
if (cso->line_stipple_enable) {