mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-02 06:40:22 +01:00
tgsi: pass zero vector to texture sampler for 1D case instead of NULL
Fixes segfault when sampling 1D textures.
This commit is contained in:
parent
a2f52f500c
commit
3673189326
1 changed files with 5 additions and 1 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue