nv50: update FP linkage state on one/two-sided lighting switch
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Sun, 8 Apr 2012 15:33:08 +0000 (17:33 +0200)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Sat, 14 Apr 2012 19:54:04 +0000 (21:54 +0200)
src/gallium/drivers/nv50/nv50_shader_state.c
src/gallium/drivers/nv50/nv50_state_validate.c

index 46835c672d6e5abce03326fc2fb809524d7f5673..aef3f129c81de4f72a78bae953f6b010dcf8cec6 100644 (file)
@@ -344,6 +344,17 @@ nv50_fp_linkage_validate(struct nv50_context *nv50)
    uint32_t lin[4];
    uint8_t map[64];
 
+   if (!(nv50->dirty & (NV50_NEW_VERTPROG |
+                        NV50_NEW_FRAGPROG |
+                        NV50_NEW_GMTYPROG))) {
+      uint8_t bfc, ffc;
+      ffc = (nv50->state.semantic_color & NV50_3D_SEMANTIC_COLOR_FFC0_ID__MASK);
+      bfc = (nv50->state.semantic_color & NV50_3D_SEMANTIC_COLOR_BFC0_ID__MASK)
+         >> 8;
+      if (nv50->rast->pipe.light_twoside == ((ffc == bfc) ? 0 : 1))
+         return;
+   }
+
    memset(lin, 0x00, sizeof(lin));
 
    /* XXX: in buggy-endian mode, is the first element of map (u32)0x000000xx
index d89556447abd372a9f4c93cdf78daa3ccc23c8a3..c19acf6c426e194e5acd4003910c9d60bc297faf 100644 (file)
@@ -351,7 +351,7 @@ static struct state_validate {
     { nv50_gmtyprog_validate,      NV50_NEW_GMTYPROG },
     { nv50_fragprog_validate,      NV50_NEW_FRAGPROG },
     { nv50_fp_linkage_validate,    NV50_NEW_FRAGPROG | NV50_NEW_VERTPROG |
-                                   NV50_NEW_GMTYPROG },
+                                   NV50_NEW_GMTYPROG | NV50_NEW_RASTERIZER },
     { nv50_gp_linkage_validate,    NV50_NEW_GMTYPROG | NV50_NEW_VERTPROG },
     { nv50_validate_derived_rs,    NV50_NEW_FRAGPROG | NV50_NEW_RASTERIZER |
                                    NV50_NEW_VERTPROG | NV50_NEW_GMTYPROG },