nv50: avoid unnecessary vp/gp/fp state changes
authorBen Skeggs <bskeggs@redhat.com>
Wed, 3 Mar 2010 23:52:47 +0000 (09:52 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Wed, 10 Mar 2010 06:29:59 +0000 (16:29 +1000)
src/gallium/drivers/nv50/nv50_program.c

index 50bb982076e54a8623e92f2cc205a2a2e1dc1ea6..c857816b31a70a2cad7063aba3a1a3c78fa3d89c 100644 (file)
@@ -4286,6 +4286,9 @@ nv50_vertprog_validate(struct nv50_context *nv50)
        nv50_program_validate_data(nv50, p);
        nv50_program_validate_code(nv50, p);
 
+       if (!(nv50->dirty & NV50_NEW_VERTPROG))
+               return NULL;
+
        so = so_new(5, 7, 2);
        so_method(so, tesla, NV50TCL_VP_ADDRESS_HIGH, 2);
        so_reloc (so, p->bo, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_RD |
@@ -4320,6 +4323,9 @@ nv50_fragprog_validate(struct nv50_context *nv50)
        nv50_program_validate_data(nv50, p);
        nv50_program_validate_code(nv50, p);
 
+       if (!(nv50->dirty & NV50_NEW_FRAGPROG))
+               return NULL;
+
        so = so_new(6, 7, 2);
        so_method(so, tesla, NV50TCL_FP_ADDRESS_HIGH, 2);
        so_reloc (so, p->bo, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_RD |
@@ -4355,6 +4361,9 @@ nv50_geomprog_validate(struct nv50_context *nv50)
        nv50_program_validate_data(nv50, p);
        nv50_program_validate_code(nv50, p);
 
+       if (!(nv50->dirty & NV50_NEW_GEOMPROG))
+               return NULL;
+
        so = so_new(6, 7, 2);
        so_method(so, tesla, NV50TCL_GP_ADDRESS_HIGH, 2);
        so_reloc (so, p->bo, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_RD |