summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2015-12-23 13:13:54 -0800
committerJason Ekstrand <jason.ekstrand@intel.com>2015-12-23 13:49:56 -0800
commit5b301323880e13b4aaf449ea9eb1ccbd05694cc0 (patch)
treecaf24a6dbdd5f7eb4af46871b4a4f7282d58670d /src
parent66168a798ba95c606f33a99f569949260dfa5086 (diff)
downloadexternal_mesa3d-5b301323880e13b4aaf449ea9eb1ccbd05694cc0.zip
external_mesa3d-5b301323880e13b4aaf449ea9eb1ccbd05694cc0.tar.gz
external_mesa3d-5b301323880e13b4aaf449ea9eb1ccbd05694cc0.tar.bz2
nir/spirv: Fix some mem_ctx issues with create_vec
Diffstat (limited to 'src')
-rw-r--r--src/glsl/nir/spirv_to_nir.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/glsl/nir/spirv_to_nir.c b/src/glsl/nir/spirv_to_nir.c
index 5c94573..d258f23 100644
--- a/src/glsl/nir/spirv_to_nir.c
+++ b/src/glsl/nir/spirv_to_nir.c
@@ -2273,7 +2273,7 @@ vtn_handle_image(struct vtn_builder *b, SpvOp opcode,
}
static nir_alu_instr *
-create_vec(void *mem_ctx, unsigned num_components)
+create_vec(nir_shader *shader, unsigned num_components)
{
nir_op op;
switch (num_components) {
@@ -2284,7 +2284,7 @@ create_vec(void *mem_ctx, unsigned num_components)
default: unreachable("bad vector size");
}
- nir_alu_instr *vec = nir_alu_instr_create(mem_ctx, op);
+ nir_alu_instr *vec = nir_alu_instr_create(shader, op);
nir_ssa_dest_init(&vec->instr, &vec->dest.dest, num_components, NULL);
vec->dest.write_mask = (1 << num_components) - 1;
@@ -2301,7 +2301,8 @@ vtn_transpose(struct vtn_builder *b, struct vtn_ssa_value *src)
vtn_create_ssa_value(b, glsl_transposed_type(src->type));
for (unsigned i = 0; i < glsl_get_matrix_columns(dest->type); i++) {
- nir_alu_instr *vec = create_vec(b, glsl_get_matrix_columns(src->type));
+ nir_alu_instr *vec = create_vec(b->shader,
+ glsl_get_matrix_columns(src->type));
if (glsl_type_is_vector_or_scalar(src->type)) {
vec->src[0].src = nir_src_for_ssa(src->def);
vec->src[0].swizzle[0] = i;
@@ -2392,7 +2393,7 @@ vtn_matrix_multiply(struct vtn_builder *b,
*/
for (unsigned i = 0; i < src1_columns; i++) {
- nir_alu_instr *vec = create_vec(b, src0_rows);
+ nir_alu_instr *vec = create_vec(b->shader, src0_rows);
for (unsigned j = 0; j < src0_rows; j++) {
vec->src[j].src =
nir_src_for_ssa(nir_fdot(&b->nb, src0_transpose->elems[j]->def,