summaryrefslogtreecommitdiffstats
path: root/src/compiler/spirv
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2018-10-19 09:35:49 -0500
committerJason Ekstrand <[email protected]>2018-10-26 11:45:29 -0500
commitff45649bc2fc3b048a8ae19cd67ec1e8e8eeb7a8 (patch)
treedd63a76053dc0c58fb7dfc5f15930ac837fab1f3 /src/compiler/spirv
parent249e32ab17bdbe1f26449079b0eafd3391b52d0f (diff)
nir/builder: Add a nir_imm_true/false helpers
Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/compiler/spirv')
-rw-r--r--src/compiler/spirv/vtn_alu.c4
-rw-r--r--src/compiler/spirv/vtn_cfg.c10
2 files changed, 7 insertions, 7 deletions
diff --git a/src/compiler/spirv/vtn_alu.c b/src/compiler/spirv/vtn_alu.c
index 38ccd62ae17..6860e7dc090 100644
--- a/src/compiler/spirv/vtn_alu.c
+++ b/src/compiler/spirv/vtn_alu.c
@@ -494,7 +494,7 @@ vtn_handle_alu(struct vtn_builder *b, SpvOp opcode,
default: vtn_fail("invalid number of components");
}
val->ssa->def = nir_build_alu(&b->nb, op, src[0],
- nir_imm_int(&b->nb, NIR_FALSE),
+ nir_imm_false(&b->nb),
NULL, NULL);
}
break;
@@ -511,7 +511,7 @@ vtn_handle_alu(struct vtn_builder *b, SpvOp opcode,
default: vtn_fail("invalid number of components");
}
val->ssa->def = nir_build_alu(&b->nb, op, src[0],
- nir_imm_int(&b->nb, NIR_TRUE),
+ nir_imm_true(&b->nb),
NULL, NULL);
}
break;
diff --git a/src/compiler/spirv/vtn_cfg.c b/src/compiler/spirv/vtn_cfg.c
index 87149905ed1..1da235becc5 100644
--- a/src/compiler/spirv/vtn_cfg.c
+++ b/src/compiler/spirv/vtn_cfg.c
@@ -723,7 +723,7 @@ vtn_emit_branch(struct vtn_builder *b, enum vtn_branch_type branch_type,
{
switch (branch_type) {
case vtn_branch_type_switch_break:
- nir_store_var(&b->nb, switch_fall_var, nir_imm_int(&b->nb, NIR_FALSE), 1);
+ nir_store_var(&b->nb, switch_fall_var, nir_imm_false(&b->nb), 1);
*has_switch_break = true;
break;
case vtn_branch_type_switch_fallthrough:
@@ -841,7 +841,7 @@ vtn_emit_cf_list(struct vtn_builder *b, struct list_head *cf_list,
nir_local_variable_create(b->nb.impl, glsl_bool_type(), "cont");
b->nb.cursor = nir_before_cf_node(&loop->cf_node);
- nir_store_var(&b->nb, do_cont, nir_imm_int(&b->nb, NIR_FALSE), 1);
+ nir_store_var(&b->nb, do_cont, nir_imm_false(&b->nb), 1);
b->nb.cursor = nir_before_cf_list(&loop->body);
@@ -852,7 +852,7 @@ vtn_emit_cf_list(struct vtn_builder *b, struct list_head *cf_list,
nir_pop_if(&b->nb, cont_if);
- nir_store_var(&b->nb, do_cont, nir_imm_int(&b->nb, NIR_TRUE), 1);
+ nir_store_var(&b->nb, do_cont, nir_imm_true(&b->nb), 1);
b->has_loop_continue = true;
}
@@ -870,7 +870,7 @@ vtn_emit_cf_list(struct vtn_builder *b, struct list_head *cf_list,
*/
nir_variable *fall_var =
nir_local_variable_create(b->nb.impl, glsl_bool_type(), "fall");
- nir_store_var(&b->nb, fall_var, nir_imm_int(&b->nb, NIR_FALSE), 1);
+ nir_store_var(&b->nb, fall_var, nir_imm_false(&b->nb), 1);
/* Next, we gather up all of the conditions. We have to do this
* up-front because we also need to build an "any" condition so
@@ -918,7 +918,7 @@ vtn_emit_cf_list(struct vtn_builder *b, struct list_head *cf_list,
nir_if *case_if = nir_push_if(&b->nb, cond);
bool has_break = false;
- nir_store_var(&b->nb, fall_var, nir_imm_int(&b->nb, NIR_TRUE), 1);
+ nir_store_var(&b->nb, fall_var, nir_imm_true(&b->nb), 1);
vtn_emit_cf_list(b, &cse->body, fall_var, &has_break, handler);
(void)has_break; /* We don't care */