glsl_to_tgsi: add SVIEW decl support
authorRob Clark <robclark@freedesktop.org>
Mon, 8 Jun 2015 17:20:30 +0000 (13:20 -0400)
committerRob Clark <robclark@freedesktop.org>
Sun, 21 Jun 2015 11:52:22 +0000 (07:52 -0400)
commitcb258c1dec1ff348d508a6b02fbc9aa11eb9f829
tree8a42dd85f4c4de3719a65f502e0cbabd7edf370c
parent93379748f7e4f5ab22040cdb7a4cccdcfb7954c1
glsl_to_tgsi: add SVIEW decl support

Freedreno needs sampler type information to deal with int/uint textures.
To accomplish this, start creating sampler-view declarations, as
suggested here:

 http://lists.freedesktop.org/archives/mesa-dev/2014-November/071583.html

create a sampler-view with index matching the sampler, to encode the
texture type (ie. SINT/UINT/FLOAT).  Ie:

   DCL SVIEW[n], 2D, UINT
   DCL SAMP[n]
   TEX OUT[1], IN[1], SAMP[n]

For tgsi texture instructions which do not take an explicit SVIEW
argument, the SVIEW index is implied by the SAMP index.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/mesa/state_tracker/st_glsl_to_tgsi.cpp