summaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-12-18 11:45:59 -0800
committerJason Ekstrand <[email protected]>2015-12-23 13:49:56 -0800
commit23cfa683d5496bdbf8b014c095059c36be7ab149 (patch)
treeaa74f1e0a7a667a9ca2dcc6b955173156380f618 /src/glsl
parent4aac03fe61c8d353df08c0d1b95308396bb4f116 (diff)
nir: move nir_copy_var from anv_nir_builder to nir_builder
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/nir/nir_builder.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/glsl/nir/nir_builder.h b/src/glsl/nir/nir_builder.h
index cb7787f1006..cbbc26d1cc6 100644
--- a/src/glsl/nir/nir_builder.h
+++ b/src/glsl/nir/nir_builder.h
@@ -353,6 +353,16 @@ nir_store_var(nir_builder *build, nir_variable *var, nir_ssa_def *value)
nir_builder_instr_insert(build, &store->instr);
}
+static inline void
+nir_copy_var(nir_builder *build, nir_variable *dest, nir_variable *src)
+{
+ nir_intrinsic_instr *copy =
+ nir_intrinsic_instr_create(build->shader, nir_intrinsic_copy_var);
+ copy->variables[0] = nir_deref_var_create(copy, dest);
+ copy->variables[1] = nir_deref_var_create(copy, src);
+ nir_builder_instr_insert(build, &copy->instr);
+}
+
static inline nir_ssa_def *
nir_load_system_value(nir_builder *build, nir_intrinsic_op op, int index)
{