gallivm: fix opcode and function nesting
authorZack Rusin <zackr@vmware.com>
Tue, 28 Jan 2014 21:34:18 +0000 (16:34 -0500)
committerZack Rusin <zackr@vmware.com>
Mon, 3 Feb 2014 18:29:14 +0000 (13:29 -0500)
commit9bace99d77642f8fbd46b1f0be025ad758f83f5e
tree73d7f8c8086352aa2143eb7f7720bd035ba4ce44
parent595bcf38a6620cc6b69b170bd5c48ace720dd607
gallivm: fix opcode and function nesting

gallivm soa code supported only a single level of nesting for
control flow opcodes (if, switch, loops...) but the d3d10 spec
clearly states that those are nested within functions. To support
nesting of conditionals inside functions we need to store the
nesting data inside function contexts and keep a stack of those.
Furthermore we make sure that if nesting for subroutines is deeper
than 32 then we simply ignore all subsequent 'call' invocations.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/gallium/auxiliary/gallivm/lp_bld_tgsi.h
src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c