Module: Mesa Branch: master Commit: 9db4a211e96356deb963223038eea074a5fe0eda URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9db4a211e96356deb963223038eea074a5fe0eda
Author: José Fonseca <[email protected]> Date: Mon May 3 13:16:09 2010 +0100 gallivm: Display message instead of crashing when sampler generator was not supplied for tgsi translation. --- src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c index faf491f..d998386 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c @@ -606,6 +606,14 @@ emit_tex( struct lp_build_tgsi_soa_context *bld, unsigned num_coords; unsigned i; + if (!bld->sampler) { + _debug_printf("warning: found texture instruction but no sampler generator supplied\n"); + for (i = 0; i < 4; i++) { + texel[i] = bld->base.undef; + } + return; + } + switch (inst->Texture.Texture) { case TGSI_TEXTURE_1D: num_coords = 1; _______________________________________________ mesa-commit mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-commit
