diff options
author | Rob Clark <[email protected]> | 2015-10-21 10:57:15 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2015-11-06 11:15:41 -0500 |
commit | 99597d033a62bdfa31148714f4d2c40f84655a5a (patch) | |
tree | bd5f284a8afb43da81401191a7ff61db19907db4 /src/glsl/nir/nir.c | |
parent | d68226087cf5f2f686d6c8f3377c5a1dec3d8bc4 (diff) |
nir: some small cleanups
The various cf nodes all get allocated w/ shader as their ralloc_parent,
so lets make this more explicit. Plus couple other corrections/
clarifications.
Signed-off-by: Rob Clark <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/glsl/nir/nir.c')
-rw-r--r-- | src/glsl/nir/nir.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c index 5f03095d673..bb7a5fa5835 100644 --- a/src/glsl/nir/nir.c +++ b/src/glsl/nir/nir.c @@ -302,9 +302,9 @@ nir_function_impl_create(nir_function_overload *overload) } nir_block * -nir_block_create(void *mem_ctx) +nir_block_create(nir_shader *shader) { - nir_block *block = ralloc(mem_ctx, nir_block); + nir_block *block = ralloc(shader, nir_block); cf_init(&block->cf_node, nir_cf_node_block); @@ -330,19 +330,19 @@ src_init(nir_src *src) } nir_if * -nir_if_create(void *mem_ctx) +nir_if_create(nir_shader *shader) { - nir_if *if_stmt = ralloc(mem_ctx, nir_if); + nir_if *if_stmt = ralloc(shader, nir_if); cf_init(&if_stmt->cf_node, nir_cf_node_if); src_init(&if_stmt->condition); - nir_block *then = nir_block_create(mem_ctx); + nir_block *then = nir_block_create(shader); exec_list_make_empty(&if_stmt->then_list); exec_list_push_tail(&if_stmt->then_list, &then->cf_node.node); then->cf_node.parent = &if_stmt->cf_node; - nir_block *else_stmt = nir_block_create(mem_ctx); + nir_block *else_stmt = nir_block_create(shader); exec_list_make_empty(&if_stmt->else_list); exec_list_push_tail(&if_stmt->else_list, &else_stmt->cf_node.node); else_stmt->cf_node.parent = &if_stmt->cf_node; @@ -351,13 +351,13 @@ nir_if_create(void *mem_ctx) } nir_loop * -nir_loop_create(void *mem_ctx) +nir_loop_create(nir_shader *shader) { - nir_loop *loop = ralloc(mem_ctx, nir_loop); + nir_loop *loop = ralloc(shader, nir_loop); cf_init(&loop->cf_node, nir_cf_node_loop); - nir_block *body = nir_block_create(mem_ctx); + nir_block *body = nir_block_create(shader); exec_list_make_empty(&loop->body); exec_list_push_tail(&loop->body, &body->cf_node.node); body->cf_node.parent = &loop->cf_node; |