Mesa (master): nv50: cannot exit shaders on a control flow instruction

Christoph Bumiller chrisbmr at kemper.freedesktop.org
Mon Jan 18 18:55:16 UTC 2010


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

Author: Christoph Bumiller <e0425955 at student.tuwien.ac.at>
Date:   Mon Jan 18 16:22:59 2010 +0100

nv50: cannot exit shaders on a control flow instruction

Fixes lockup triggered by this ingenious shader:
   1: CALL :3
   2: END
   3: BGNSUB ...

---

 src/gallium/drivers/nv50/nv50_program.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/nv50/nv50_program.c b/src/gallium/drivers/nv50/nv50_program.c
index 22fa6e6..20db510 100644
--- a/src/gallium/drivers/nv50/nv50_program.c
+++ b/src/gallium/drivers/nv50/nv50_program.c
@@ -477,6 +477,12 @@ is_join(struct nv50_program_exec *e)
 	return FALSE;
 }
 
+static INLINE boolean
+is_control_flow(struct nv50_program_exec *e)
+{
+	return (e->inst[0] & 2);
+}
+
 static INLINE void
 set_pred(struct nv50_pc *pc, unsigned pred, unsigned idx,
 	 struct nv50_program_exec *e)
@@ -3166,7 +3172,9 @@ nv50_program_tx_insn(struct nv50_pc *pc,
 		if (!is_long(pc->p->exec_tail))
 			convert_to_long(pc, pc->p->exec_tail);
 		else
-		if (is_immd(pc->p->exec_tail) || is_join(pc->p->exec_tail))
+		if (is_immd(pc->p->exec_tail) ||
+		    is_join(pc->p->exec_tail) ||
+		    is_control_flow(pc->p->exec_tail))
 			emit_nop(pc);
 
 		pc->p->exec_tail->inst[1] |= 1; /* set exit bit */




More information about the mesa-commit mailing list