diff options
author | Jason Ekstrand <[email protected]> | 2015-11-11 08:31:29 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-11-18 12:28:32 -0800 |
commit | 9fbd390dd4b60746c2ce60fb20c61c45c0e8a022 (patch) | |
tree | 3cb3b6307c8e85779a107d1f328e25bae6e32aff /src/glsl/nir/nir.c | |
parent | 9ff71b649b4b3808a9e17ce69743c6037fd6603c (diff) |
nir: Add support for cloning shaders
This commit is heavily based on one by Rob Clark <[email protected]> but
reworked to re-use nir_create functions and do less hashing.
Signed-off-by: Jason Ekstrand <[email protected]>
Reviewed-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/glsl/nir/nir.c')
-rw-r--r-- | src/glsl/nir/nir.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c index bb7a5fa5835..93c18fbaea5 100644 --- a/src/glsl/nir/nir.c +++ b/src/glsl/nir/nir.c @@ -312,6 +312,14 @@ nir_block_create(nir_shader *shader) block->predecessors = _mesa_set_create(block, _mesa_hash_pointer, _mesa_key_pointer_equal); block->imm_dom = NULL; + /* XXX maybe it would be worth it to defer allocation? This + * way it doesn't get allocated for shader ref's that never run + * nir_calc_dominance? For example, state-tracker creates an + * initial IR, clones that, runs appropriate lowering pass, passes + * to driver which does common lowering/opt, and then stores ref + * which is later used to do state specific lowering and futher + * opt. Do any of the references not need dominance metadata? + */ block->dom_frontier = _mesa_set_create(block, _mesa_hash_pointer, _mesa_key_pointer_equal); |