r600g: Start a new TEX clause if the texture lookup address was fetched in the curren...
authorFabian Bieler <der.fabe@gmx.net>
Wed, 16 Feb 2011 09:02:47 +0000 (10:02 +0100)
committerDave Airlie <airlied@redhat.com>
Fri, 18 Feb 2011 00:04:41 +0000 (10:04 +1000)
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/r600/r600_asm.c

index f8835f020d984fb29e18743e9fcbdbc0e01efadc..de796188fdec8f71f371d2463de3ac7bee2e65de 100644 (file)
@@ -1282,6 +1282,18 @@ int r600_bc_add_tex(struct r600_bc *bc, const struct r600_bc_tex *tex)
                return -ENOMEM;
        memcpy(ntex, tex, sizeof(struct r600_bc_tex));
 
+       /* we can't fetch data und use it as texture lookup address in the same TEX clause */
+       if (bc->cf_last != NULL &&
+               bc->cf_last->inst == V_SQ_CF_WORD1_SQ_CF_INST_TEX) {
+               struct r600_bc_tex *ttex;
+               LIST_FOR_EACH_ENTRY(ttex, &bc->cf_last->tex, list) {
+                       if (ttex->dst_gpr == ntex->src_gpr) {
+                               bc->force_add_cf = 1;
+                               break;
+                       }
+               }
+       }
+
        /* cf can contains only alu or only vtx or only tex */
        if (bc->cf_last == NULL ||
                bc->cf_last->inst != V_SQ_CF_WORD1_SQ_CF_INST_TEX ||