summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-03-26 08:40:07 -0600
committerBrian Paul <brianp@vmware.com>2009-03-26 08:40:07 -0600
commit3673189326e348eb91e354017703fdfd9d6d8184 (patch)
tree0d365550618c32512977f75054e2ac1f2407b384 /src/gallium/auxiliary
parenta2f52f500cdff2ffd5aec039cafaaa3bc2273595 (diff)
tgsi: pass zero vector to texture sampler for 1D case instead of NULL
Fixes segfault when sampling 1D textures.
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_exec.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c
index ba807e498f..259877b500 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c
@@ -123,6 +123,10 @@
#define UPDATE_EXEC_MASK(MACH) \
MACH->ExecMask = MACH->CondMask & MACH->LoopMask & MACH->ContMask & MACH->FuncMask
+
+static const union tgsi_exec_channel ZeroVec =
+ { { 0.0, 0.0, 0.0, 0.0 } };
+
/**
* Initialize machine state by expanding tokens to full instructions,
* allocating temporary storage, setting up constants, etc.
@@ -1643,7 +1647,7 @@ exec_tex(struct tgsi_exec_machine *mach,
lodBias = 0.0;
fetch_texel(mach->Samplers[unit],
- &r[0], NULL, NULL, lodBias, /* S, T, P, BIAS */
+ &r[0], &ZeroVec, &ZeroVec, lodBias, /* S, T, P, BIAS */
&r[0], &r[1], &r[2], &r[3]); /* R, G, B, A */
break;