summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorChristoph Bumiller <[email protected]>2010-04-29 22:48:00 +0200
committerChristoph Bumiller <[email protected]>2010-04-30 22:50:31 +0200
commit6df1e5c4aa980d52e98b991e6cdbd20a3c746845 (patch)
tree9418bfd2ef83a62f01d31916583a3e067c0991e3 /src/gallium
parentd225221e7084a1e8e22c41cbd3c58775d6f298a1 (diff)
nv50: don't segfault on OPCODE_END for empty programs
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/nv50/nv50_program.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gallium/drivers/nv50/nv50_program.c b/src/gallium/drivers/nv50/nv50_program.c
index b8b6b12120b..98f60821fc6 100644
--- a/src/gallium/drivers/nv50/nv50_program.c
+++ b/src/gallium/drivers/nv50/nv50_program.c
@@ -3169,15 +3169,16 @@ nv50_program_tx_insn(struct nv50_pc *pc,
if (pc->p->type == PIPE_SHADER_FRAGMENT)
nv50_fp_move_results(pc);
- /* last insn must be long so it can have the exit bit set */
- if (!is_long(pc->p->exec_tail))
- convert_to_long(pc, pc->p->exec_tail);
- else
- if (is_immd(pc->p->exec_tail) ||
+ if (!pc->p->exec_tail ||
+ is_immd(pc->p->exec_tail) ||
is_join(pc->p->exec_tail) ||
is_control_flow(pc->p->exec_tail))
emit_nop(pc);
+ /* last insn must be long so it can have the exit bit set */
+ if (!is_long(pc->p->exec_tail))
+ convert_to_long(pc, pc->p->exec_tail);
+
pc->p->exec_tail->inst[1] |= 1; /* set exit bit */
terminate_mbb(pc);