state->stage == MESA_SHADER_TESS_CTRL;
}
+static bool
+vote(const _mesa_glsl_parse_state *state)
+{
+ return state->ARB_shader_group_vote_enable;
+}
+
/** @} */
/******************************************************************************/
ir_function_signature *_shader_clock(builtin_available_predicate avail,
const glsl_type *type);
+ ir_function_signature *_vote(enum ir_expression_operation opcode);
+
#undef B0
#undef B1
#undef B2
glsl_type::uvec2_type),
NULL);
+ add_function("anyInvocationARB", _vote(ir_unop_vote_any), NULL);
+ add_function("allInvocationsARB", _vote(ir_unop_vote_all), NULL);
+ add_function("allInvocationsEqualARB", _vote(ir_unop_vote_eq), NULL);
+
#undef F
#undef FI
#undef FIUD
return sig;
}
+ir_function_signature *
+builtin_builder::_vote(enum ir_expression_operation opcode)
+{
+ ir_variable *value = in_var(glsl_type::bool_type, "value");
+
+ MAKE_SIG(glsl_type::bool_type, vote, 1, value);
+ body.emit(ret(expr(opcode, value)));
+ return sig;
+}
+
/** @} */
/******************************************************************************/
if (extensions->ARB_cull_distance)
add_builtin_define(parser, "GL_ARB_cull_distance", 1);
+
+ if (extensions->ARB_shader_group_vote)
+ add_builtin_define(parser, "GL_ARB_shader_group_vote", 1);
}
}
EXT(ARB_shader_bit_encoding, true, false, ARB_shader_bit_encoding),
EXT(ARB_shader_clock, true, false, ARB_shader_clock),
EXT(ARB_shader_draw_parameters, true, false, ARB_shader_draw_parameters),
+ EXT(ARB_shader_group_vote, true, false, ARB_shader_group_vote),
EXT(ARB_shader_image_load_store, true, false, ARB_shader_image_load_store),
EXT(ARB_shader_image_size, true, false, ARB_shader_image_size),
EXT(ARB_shader_precision, true, false, ARB_shader_precision),
bool ARB_shader_clock_warn;
bool ARB_shader_draw_parameters_enable;
bool ARB_shader_draw_parameters_warn;
+ bool ARB_shader_group_vote_enable;
+ bool ARB_shader_group_vote_warn;
bool ARB_shader_image_load_store_enable;
bool ARB_shader_image_load_store_warn;
bool ARB_shader_image_size_enable;
this->type = glsl_type::int_type;
break;
+ case ir_unop_vote_any:
+ case ir_unop_vote_all:
+ case ir_unop_vote_eq:
+ this->type = glsl_type::bool_type;
+ break;
+
default:
assert(!"not reached: missing automatic type setup for ir_expression");
this->type = op0->type;
"interpolate_at_centroid",
"get_buffer_size",
"ssbo_unsized_array_length",
+ "vote_any",
+ "vote_all",
+ "vote_eq",
"+",
"-",
"*",
*/
ir_unop_ssbo_unsized_array_length,
+ /**
+ * Vote among threads on the value of the boolean argument.
+ */
+ ir_unop_vote_any,
+ ir_unop_vote_all,
+ ir_unop_vote_eq,
+
/**
* A sentinel marking the last of the unary operations.
*/
- ir_last_unop = ir_unop_ssbo_unsized_array_length,
+ ir_last_unop = ir_unop_vote_eq,
ir_binop_add,
ir_binop_sub,
assert(ir->operands[0]->type->base_type == GLSL_TYPE_SUBROUTINE);
assert(ir->type->base_type == GLSL_TYPE_INT);
break;
+
+ case ir_unop_vote_any:
+ case ir_unop_vote_all:
+ case ir_unop_vote_eq:
+ assert(ir->type == glsl_type::bool_type);
+ assert(ir->operands[0]->type == glsl_type::bool_type);
+ break;
+
case ir_binop_add:
case ir_binop_sub:
case ir_binop_mul:
case ir_unop_frexp_sig:
case ir_unop_frexp_exp:
unreachable("should have been lowered by lower_instructions");
+
+ case ir_unop_vote_any:
+ case ir_unop_vote_all:
+ case ir_unop_vote_eq:
+ unreachable("unsupported");
}
ir->remove();
EXT(ARB_shader_bit_encoding , ARB_shader_bit_encoding , GLL, GLC, x , x , 2010)
EXT(ARB_shader_clock , ARB_shader_clock , GLL, GLC, x , x , 2015)
EXT(ARB_shader_draw_parameters , ARB_shader_draw_parameters , GLL, GLC, x , x , 2013)
+EXT(ARB_shader_group_vote , ARB_shader_group_vote , GLL, GLC, x , x , 2013)
EXT(ARB_shader_image_load_store , ARB_shader_image_load_store , GLL, GLC, x , x , 2011)
EXT(ARB_shader_image_size , ARB_shader_image_size , GLL, GLC, x , x , 2012)
EXT(ARB_shader_objects , dummy_true , GLL, GLC, x , x , 2002)
GLboolean ARB_shader_bit_encoding;
GLboolean ARB_shader_clock;
GLboolean ARB_shader_draw_parameters;
+ GLboolean ARB_shader_group_vote;
GLboolean ARB_shader_image_load_store;
GLboolean ARB_shader_image_size;
GLboolean ARB_shader_precision;
case ir_unop_dFdy_fine:
case ir_unop_subroutine_to_int:
case ir_unop_get_buffer_size:
+ case ir_unop_vote_any:
+ case ir_unop_vote_all:
+ case ir_unop_vote_eq:
assert(!"not supported");
break;
case ir_binop_carry:
case ir_binop_borrow:
case ir_unop_ssbo_unsized_array_length:
+
+ case ir_unop_vote_any:
+ case ir_unop_vote_all:
+ case ir_unop_vote_eq:
/* This operation is not supported, or should have already been handled.
*/
assert(!"Invalid ir opcode in glsl_to_tgsi_visitor::visit()");