gallivm: Display message instead of crashing when sampler generator was not supplied for tgsi translation.

This commit is contained in:
José Fonseca 2010-05-03 13:16:09 +01:00
parent 9ab3df4ebb
commit 9db4a211e9
1 changed files with 8 additions and 0 deletions

View File

@ -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;