summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-10-19 09:56:22 -0700
committerJason Ekstrand <[email protected]>2017-12-02 08:07:35 -0800
commitf5aad36d2e5bd7d699cd6bbbfc8c9866c815f52e (patch)
treef5d1e9f29e03cc26a38adb4ac97fd11150756514 /src/compiler
parentfc033742d2128ccfda6bf4c92254f632b9445b0c (diff)
spirv: Drop the impl field from vtn_builder
We have a nir_builder and it has an impl field. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/spirv/spirv_to_nir.c9
-rw-r--r--src/compiler/spirv/vtn_cfg.c2
-rw-r--r--src/compiler/spirv/vtn_private.h1
-rw-r--r--src/compiler/spirv/vtn_variables.c2
4 files changed, 6 insertions, 8 deletions
diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c
index 027efab88d7..c58cf5cbfdf 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -117,7 +117,7 @@ vtn_const_ssa_value(struct vtn_builder *b, nir_constant *constant,
load->value = constant->values[0];
- nir_instr_insert_before_cf_list(&b->impl->body, &load->instr);
+ nir_instr_insert_before_cf_list(&b->nb.impl->body, &load->instr);
val->def = &load->def;
} else {
assert(glsl_type_is_matrix(type));
@@ -133,7 +133,7 @@ vtn_const_ssa_value(struct vtn_builder *b, nir_constant *constant,
load->value = constant->values[i];
- nir_instr_insert_before_cf_list(&b->impl->body, &load->instr);
+ nir_instr_insert_before_cf_list(&b->nb.impl->body, &load->instr);
col_val->def = &load->def;
val->elems[i] = col_val;
@@ -1410,7 +1410,7 @@ vtn_handle_function_call(struct vtn_builder *b, SpvOp opcode,
/* Make a temporary to store the argument in */
nir_variable *tmp =
- nir_local_variable_create(b->impl, arg_ssa->type, "arg_tmp");
+ nir_local_variable_create(b->nb.impl, arg_ssa->type, "arg_tmp");
call->params[i] = nir_deref_var_create(call, tmp);
vtn_local_store(b, arg_ssa, call->params[i]);
@@ -1420,7 +1420,7 @@ vtn_handle_function_call(struct vtn_builder *b, SpvOp opcode,
nir_variable *out_tmp = NULL;
assert(res_type->type == callee->return_type);
if (!glsl_type_is_void(callee->return_type)) {
- out_tmp = nir_local_variable_create(b->impl, callee->return_type,
+ out_tmp = nir_local_variable_create(b->nb.impl, callee->return_type,
"out_tmp");
call->return_deref = nir_deref_var_create(call, out_tmp);
}
@@ -3367,7 +3367,6 @@ spirv_to_nir(const uint32_t *words, size_t word_count,
vtn_build_cfg(b, words, word_end);
foreach_list_typed(struct vtn_function, func, node, &b->functions) {
- b->impl = func->impl;
b->const_table = _mesa_hash_table_create(b, _mesa_hash_pointer,
_mesa_key_pointer_equal);
diff --git a/src/compiler/spirv/vtn_cfg.c b/src/compiler/spirv/vtn_cfg.c
index 25ff254bcec..13f02217710 100644
--- a/src/compiler/spirv/vtn_cfg.c
+++ b/src/compiler/spirv/vtn_cfg.c
@@ -606,7 +606,7 @@ vtn_emit_cf_list(struct vtn_builder *b, struct list_head *cf_list,
if ((*block->branch & SpvOpCodeMask) == SpvOpReturnValue) {
struct vtn_ssa_value *src = vtn_ssa_value(b, block->branch[1]);
vtn_local_store(b, src,
- nir_deref_var_create(b, b->impl->return_var));
+ nir_deref_var_create(b, b->nb.impl->return_var));
}
if (block->branch_type != vtn_branch_type_none) {
diff --git a/src/compiler/spirv/vtn_private.h b/src/compiler/spirv/vtn_private.h
index 6b4645acc8b..173a7b3d7c7 100644
--- a/src/compiler/spirv/vtn_private.h
+++ b/src/compiler/spirv/vtn_private.h
@@ -464,7 +464,6 @@ struct vtn_builder {
nir_builder nb;
nir_shader *shader;
- nir_function_impl *impl;
const struct nir_spirv_supported_extensions *ext;
struct vtn_block *block;
diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c
index 9a69b4f6fc2..c57f5541319 100644
--- a/src/compiler/spirv/vtn_variables.c
+++ b/src/compiler/spirv/vtn_variables.c
@@ -1731,7 +1731,7 @@ vtn_create_variable(struct vtn_builder *b, struct vtn_value *val,
if (var->mode == vtn_variable_mode_local) {
assert(var->members == NULL && var->var != NULL);
- nir_function_impl_add_variable(b->impl, var->var);
+ nir_function_impl_add_variable(b->nb.impl, var->var);
} else if (var->var) {
nir_shader_add_variable(b->shader, var->var);
} else if (var->members) {