glsl: make use of glsl_type::is_boolean()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
This commit is contained in:
Samuel Pitoiset
2017-04-21 10:36:05 +02:00
parent 64db02b5fa
commit 60caca3019
4 changed files with 18 additions and 19 deletions

View File

@@ -985,7 +985,7 @@ nir_visitor::visit(ir_call *ir)
* consider a true boolean to be ~0. Fix this up with a != 0
* comparison.
*/
if (type->base_type == GLSL_TYPE_BOOL) {
if (type->is_boolean()) {
nir_alu_instr *load_ssbo_compare =
nir_alu_instr_create(shader, nir_op_ine);
load_ssbo_compare->src[0].src.is_ssa = true;
@@ -1334,7 +1334,7 @@ nir_visitor::visit(ir_expression *ir)
* a true boolean to be ~0. Fix this up with a != 0 comparison.
*/
if (ir->type->base_type == GLSL_TYPE_BOOL)
if (ir->type->is_boolean())
this->result = nir_ine(&b, &load->dest.ssa, nir_imm_int(&b, 0));
return;