r600g: fix polygon mode for points and lines and point/line fill modes
authorMarek Olšák <marek.olsak@amd.com>
Thu, 23 Oct 2014 11:44:14 +0000 (13:44 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 28 Oct 2014 22:20:45 +0000 (23:20 +0100)
Fixes piglit/polygon-mode-offset.

Cc: 10.2 10.3 mesa-stable@lists.freedesktop.org
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
src/gallium/drivers/r600/evergreen_state.c
src/gallium/drivers/r600/r600_state.c

index f74dd918b0868e030b3f4ed870b13221f1f5bc85..36b86aa6d8fa8facf7c5cf24ea8dc6982304d53a 100644 (file)
@@ -542,9 +542,9 @@ static void *evergreen_create_rs_state(struct pipe_context *ctx,
                               S_028814_CULL_FRONT((state->cull_face & PIPE_FACE_FRONT) ? 1 : 0) |
                               S_028814_CULL_BACK((state->cull_face & PIPE_FACE_BACK) ? 1 : 0) |
                               S_028814_FACE(!state->front_ccw) |
-                              S_028814_POLY_OFFSET_FRONT_ENABLE(state->offset_tri) |
-                              S_028814_POLY_OFFSET_BACK_ENABLE(state->offset_tri) |
-                              S_028814_POLY_OFFSET_PARA_ENABLE(state->offset_tri) |
+                              S_028814_POLY_OFFSET_FRONT_ENABLE(util_get_offset(state, state->fill_front)) |
+                              S_028814_POLY_OFFSET_BACK_ENABLE(util_get_offset(state, state->fill_back)) |
+                              S_028814_POLY_OFFSET_PARA_ENABLE(state->offset_point || state->offset_line) |
                               S_028814_POLY_MODE(state->fill_front != PIPE_POLYGON_MODE_FILL ||
                                                  state->fill_back != PIPE_POLYGON_MODE_FILL) |
                               S_028814_POLYMODE_FRONT_PTYPE(r600_translate_fill(state->fill_front)) |
index 8dc25da8089e3be5b02653e9ca7de4b640a073e7..61f5c5ad001d4f6ad7bd8a92046b10af5810b52c 100644 (file)
@@ -536,9 +536,9 @@ static void *r600_create_rs_state(struct pipe_context *ctx,
                                 S_028814_CULL_FRONT(state->cull_face & PIPE_FACE_FRONT ? 1 : 0) |
                                 S_028814_CULL_BACK(state->cull_face & PIPE_FACE_BACK ? 1 : 0) |
                                 S_028814_FACE(!state->front_ccw) |
-                                S_028814_POLY_OFFSET_FRONT_ENABLE(state->offset_tri) |
-                                S_028814_POLY_OFFSET_BACK_ENABLE(state->offset_tri) |
-                                S_028814_POLY_OFFSET_PARA_ENABLE(state->offset_tri) |
+                                S_028814_POLY_OFFSET_FRONT_ENABLE(util_get_offset(state, state->fill_front)) |
+                                S_028814_POLY_OFFSET_BACK_ENABLE(util_get_offset(state, state->fill_back)) |
+                                S_028814_POLY_OFFSET_PARA_ENABLE(state->offset_point || state->offset_line) |
                                 S_028814_POLY_MODE(state->fill_front != PIPE_POLYGON_MODE_FILL ||
                                                                         state->fill_back != PIPE_POLYGON_MODE_FILL) |
                                 S_028814_POLYMODE_FRONT_PTYPE(r600_translate_fill(state->fill_front)) |