summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/gallivm
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2010-05-03 13:16:09 +0100
committerJosé Fonseca <[email protected]>2010-05-03 13:18:53 +0100
commit9db4a211e96356deb963223038eea074a5fe0eda (patch)
tree9f67891e731d5d04b4c3a7c8e4d0632af5907c44 /src/gallium/auxiliary/gallivm
parent9ab3df4ebbcb5fe7a65e6cf05b3a6671392ba929 (diff)
gallivm: Display message instead of crashing when sampler generator was not supplied for tgsi translation.
Diffstat (limited to 'src/gallium/auxiliary/gallivm')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c8
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 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;