From: José Fonseca Date: Mon, 3 May 2010 12:16:09 +0000 (+0100) Subject: gallivm: Display message instead of crashing when sampler generator was not supplied... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9db4a211e96356deb963223038eea074a5fe0eda;p=mesa.git gallivm: Display message instead of crashing when sampler generator was not supplied for tgsi translation. --- diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c index faf491fc3c7..d9983862375 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;