OSDN Git Service

gallium/ttn: add support for temp arrays
authorRob Clark <robclark@freedesktop.org>
Tue, 7 Apr 2015 15:38:23 +0000 (11:38 -0400)
committerRob Clark <robclark@freedesktop.org>
Sat, 11 Apr 2015 14:41:45 +0000 (10:41 -0400)
commit96c0f9328d315d6a5a0e83f920ad27791fd91b4f
tree9e57d60e2ea9ff6ba983096c52d2619a20da0ebc
parentb91d987140ce54969cbf9e0a10ad6b3ad5d5a75d
gallium/ttn: add support for temp arrays

Since the rest of NIR really would rather have these as variables rather
than registers, create a nir_variable per array.  But rather than
completely re-arrange ttn to be variable based rather than register
based, keep the registers.  In the cases where there is a matching var
for the reg, ttn_emit_instruction will append the appropriate intrinsic
to get things back from the shadow reg into the variable.

NOTE: this doesn't quite handle TEMP[ADDR[]] when the DCL doesn't give
an array id.  But those just kinda suck, and should really go away.
AFAICT we don't get those from glsl.  Might be an issue for some other
state tracker.

v2: rework to use load_var/store_var with deref chains
v3: create new "burner" reg for temporarily holding the (potentially
writemask'd) dest after each instruction; add load_var to initialize
temporary dest in case not all components are overwritten
v4: review comments: asserts and use ttn_src_for_indirect() in
ttn_array_deref() so we can drop later patch converting to use vec1 for
addr reg (since ttn_src_for_indirect() handles the imov to vec1 from
tgsi addr component that we want)
v5: rebase: new requirements about parent mem ctx for derefs

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/gallium/auxiliary/nir/tgsi_to_nir.c