From e1ad3bd2f25832147814fcfe72166898bc07f11a Mon Sep 17 00:00:00 2001 From: Christoph Bumiller Date: Mon, 26 Jul 2010 00:56:12 +0200 Subject: [PATCH] nv50: permit usage of undefined TGSI TEMPs --- src/gallium/drivers/nv50/nv50_tgsi_to_nc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/nv50/nv50_tgsi_to_nc.c b/src/gallium/drivers/nv50/nv50_tgsi_to_nc.c index 5b69d520bc0..3d5843ee0ef 100644 --- a/src/gallium/drivers/nv50/nv50_tgsi_to_nc.c +++ b/src/gallium/drivers/nv50/nv50_tgsi_to_nc.c @@ -174,7 +174,8 @@ bld_fetch_global(struct bld_context *bld, struct bld_value_stack *stack) fetch_by_bb(stack, vals, &n, bld->pc->current_block); - assert(n); + if (n == 0) + return NULL; if (n == 1) return vals[0]; @@ -606,6 +607,7 @@ bld_export_outputs(struct bld_context *bld) if (!bld_is_output_written(bld, i, c)) continue; vals[n] = bld_fetch_global(bld, &bld->ovs[i][c]); + assert(vals[n]); vals[n] = bld_insn_1(bld, NV_OP_MOV, vals[n]); vals[n++]->reg.id = bld->ti->output_map[i][c]; } @@ -734,6 +736,10 @@ emit_fetch(struct bld_context *bld, const struct tgsi_full_instruction *insn, abort(); break; } + if (!res) { + debug_printf("WARNING: undefined source value in TGSI instruction\n"); + return bld_load_imm_u32(bld, 0); + } switch (tgsi_util_get_full_src_register_sign_mode(src, chan)) { case TGSI_UTIL_SIGN_KEEP: -- 2.30.2