gallium: fix SSE shadow texture instructions

When sampling a 2D shadow map we need 3 texcoord components, not 2.
The third component (distance from light source) is compared against
the texture sample to return the result (visible vs. occluded).

Also, enable proper handling of TGSI_TEXTURE_SHADOW targets in Mesa->TGSI
translation.  There's a possibility for breakage in gallium drivers if
they fail to handle the TGSI_TEXTURE_SHADOW1D / TGSI_TEXTURE_SHADOW2D /
TGSI_TEXTURE_SHADOWRECT texture targets for TGSI_OPCODE_TEX/TXP instructions,
but that should be easy to fix.

With these changes, progs/demos/shadowtex.c renders properly again with
softpipe.
2 files changed