diff options
author | Christoph Bumiller <[email protected]> | 2010-07-26 00:56:12 +0200 |
---|---|---|
committer | Christoph Bumiller <[email protected]> | 2010-07-26 11:20:52 +0200 |
commit | e1ad3bd2f25832147814fcfe72166898bc07f11a (patch) | |
tree | 4dbb8ec32799f08515c7346cf17be9f9b2fb572f | |
parent | a3ba99b3037bad629622766d4e08d48ab6d20aae (diff) |
nv50: permit usage of undefined TGSI TEMPs
-rw-r--r-- | src/gallium/drivers/nv50/nv50_tgsi_to_nc.c | 8 |
1 files changed, 7 insertions, 1 deletions
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: |