freedreno/a3xx: deal with optimized tex instructions
authorRob Clark <robclark@freedesktop.org>
Tue, 8 Apr 2014 18:14:43 +0000 (14:14 -0400)
committerRob Clark <robclark@freedesktop.org>
Tue, 8 Apr 2014 20:06:49 +0000 (16:06 -0400)
commitee839cc6ef92d37ec6a44e6036e7a2c46172a16a
tree1beee770dbd351c36b1f398f691d0b4ce1acce19
parentcb4ad1368551b64756c7b6e2007588e34739b188
freedreno/a3xx: deal with optimized tex instructions

Keep track of whether we actually have any sam instructions in the
resulting shader, rather than using TGSI SAMP declarations.  If the sam
instruction is optimized out, because the result is not used, we don't
want to emit texture state, etc.  In fact emitting sampler state and/or
setting PIXLODENABLE bit when there are no texture fetches seems to
cause lockup.

In theory this should never happen for a "normal" shader, unless the
state tracker is wonky.  But it is a very real possibility for binning
pass shaders.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/drivers/freedreno/a3xx/fd3_compiler.c
src/gallium/drivers/freedreno/a3xx/fd3_compiler_old.c
src/gallium/drivers/freedreno/a3xx/fd3_emit.c
src/gallium/drivers/freedreno/a3xx/fd3_program.c
src/gallium/drivers/freedreno/a3xx/fd3_program.h
src/gallium/drivers/freedreno/a3xx/ir3.h
src/gallium/drivers/freedreno/a3xx/ir3_ra.c