this->type = glsl_type::int_type;
break;
+ case ir_unop_ballot:
+ this->type = glsl_type::uint64_t_type;
+ break;
+
+ case ir_unop_read_first_invocation:
+ this->type = op0->type;
+ break;
+
case ir_unop_vote_any:
case ir_unop_vote_all:
case ir_unop_vote_eq:
this->type = op0->type->get_scalar_type();
break;
+ case ir_binop_read_invocation:
+ this->type = op0->type;
+ break;
+
default:
assert(!"not reached: missing automatic type setup for ir_expression");
this->type = glsl_type::float_type;
# of its length.
operation("ssbo_unsized_array_length", 1),
+ # ARB_shader_ballot operations
+ operation("ballot", 1, source_types=(bool_type,), dest_type=uint64_type),
+ operation("read_first_invocation", 1),
+
# Vote among threads on the value of the boolean argument.
operation("vote_any", 1),
operation("vote_all", 1),
# operand1 is the sample ID
operation("interpolate_at_sample", 2),
+ # ARB_shader_ballot operation
+ operation("read_invocation", 2),
+
# Fused floating-point multiply-add, part of ARB_gpu_shader5.
operation("fma", 3, source_types=real_types, c_expression="{src0} * {src1} + {src2}"),
assert(ir->type->base_type == GLSL_TYPE_INT);
break;
+ case ir_unop_ballot:
+ assert(ir->type == glsl_type::uint64_t_type);
+ assert(ir->operands[0]->type == glsl_type::bool_type);
+ break;
+
+ case ir_binop_read_invocation:
+ assert(ir->operands[1]->type == glsl_type::uint_type);
+ /* fall-through */
+ case ir_unop_read_first_invocation:
+ assert(ir->type == ir->operands[0]->type);
+ assert(ir->type->is_scalar() || ir->type->is_vector());
+ assert(ir->type->base_type == GLSL_TYPE_FLOAT ||
+ ir->type->base_type == GLSL_TYPE_INT ||
+ ir->type->base_type == GLSL_TYPE_UINT);
+ break;
+
case ir_unop_vote_any:
case ir_unop_vote_all:
case ir_unop_vote_eq:
case ir_unop_dFdy_fine:
case ir_unop_subroutine_to_int:
case ir_unop_get_buffer_size:
+ case ir_unop_ballot:
+ case ir_binop_read_invocation:
+ case ir_unop_read_first_invocation:
case ir_unop_vote_any:
case ir_unop_vote_all:
case ir_unop_vote_eq: