Mesa (master): r600g: Start a new TEX clause if the texture lookup address was fetched in the current clause

Dave Airlie airlied at kemper.freedesktop.org
Fri Feb 18 00:05:07 UTC 2011


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

Author: Fabian Bieler <der.fabe at gmx.net>
Date:   Wed Feb 16 10:02:47 2011 +0100

r600g: Start a new TEX clause if the texture lookup address was fetched in the current clause

Signed-off-by: Dave Airlie <airlied at redhat.com>

---

 src/gallium/drivers/r600/r600_asm.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_asm.c b/src/gallium/drivers/r600/r600_asm.c
index f8835f0..de79618 100644
--- a/src/gallium/drivers/r600/r600_asm.c
+++ b/src/gallium/drivers/r600/r600_asm.c
@@ -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 ||




More information about the mesa-commit mailing list