st/mesa: copy sampler_array_size field when copying instructions
authorBrian Paul <brianp@vmware.com>
Mon, 17 Nov 2014 21:29:45 +0000 (14:29 -0700)
committerBrian Paul <brianp@vmware.com>
Mon, 17 Nov 2014 22:07:54 +0000 (15:07 -0700)
commit11abd7b2bc49455bb8c5b2f9e60f92d4284ae6c2
treec2f28457def03394d2da5238f70c82f2b36a13ef
parent920f8751322f65c63c78974628e3ed223ab4e064
st/mesa: copy sampler_array_size field when copying instructions

The sampler_array_size field was added by "mesa/st: add support for
dynamic sampler offsets".  But the field wasn't getting copied in
the get_pixel_transfer_visitor() or get_bitmap_visitor() functions.

The count_resources() function then didn't properly compute the
glsl_to_tgsi_visitor::samplers_used bitmask.  Then, we didn't declare
all the sampler registers in st_translate_program().  Finally, we
asserted when we tried to emit a tgsi ureg src register with File =
TGSI_FILE_UNDEFINED.

Add the missing assignments and some new assertions to catch the
invalid register sooner.

Cc: "10.3, 10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/mesa/state_tracker/st_glsl_to_tgsi.cpp