Mesa (master): r300g: handle polygon offset correctly

Marek Olšák mareko at kemper.freedesktop.org
Tue Aug 3 13:53:50 UTC 2010


Module: Mesa
Branch: master
Commit: 57438adf3217955f16491ef8deeffafe05c2f7f8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=57438adf3217955f16491ef8deeffafe05c2f7f8

Author: Marek Olšák <maraeo at gmail.com>
Date:   Tue Aug  3 14:15:24 2010 +0200

r300g: handle polygon offset correctly

https://bugs.freedesktop.org/show_bug.cgi?id=29372

---

 src/gallium/drivers/r300/r300_state.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c
index bc0c86d..a3383c3 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -744,7 +744,7 @@ static void
     r300_mark_fb_state_dirty(r300, R300_CHANGED_FB_STATE);
 
     /* Polygon offset depends on the zbuffer bit depth. */
-    if (state->zsbuf && r300->polygon_offset_enabled) {
+    if (state->zsbuf) {
         switch (util_format_get_blocksize(state->zsbuf->texture->format)) {
             case 2:
                 zbuffer_bpp = 16;
@@ -756,7 +756,9 @@ static void
 
         if (r300->zbuffer_bpp != zbuffer_bpp) {
             r300->zbuffer_bpp = zbuffer_bpp;
-            r300->rs_state.dirty = TRUE;
+
+            if (r300->polygon_offset_enabled)
+                r300->rs_state.dirty = TRUE;
         }
     }
 
@@ -1095,9 +1097,7 @@ static void r300_bind_rs_state(struct pipe_context* pipe, void* state)
     }
 
     if (rs) {
-        r300->polygon_offset_enabled = (rs->rs.offset_point ||
-                                        rs->rs.offset_line ||
-                                        rs->rs.offset_tri);
+        r300->polygon_offset_enabled = rs->polygon_offset_enable;
         r300->sprite_coord_enable = rs->rs.sprite_coord_enable;
         r300->two_sided_color = rs->rs.light_twoside;
     } else {




More information about the mesa-commit mailing list