return state->EXT_demote_to_helper_invocation_enable;
}
+static bool
+is_nir(const _mesa_glsl_parse_state *state)
+{
+ return state->ctx->Const.ShaderCompilerOptions[state->stage].NirOptions;
+}
+
+static bool
+is_not_nir(const _mesa_glsl_parse_state *state)
+{
+ return !is_nir(state);
+}
+
/** @} */
/******************************************************************************/
B1(acos)
B1(atan2)
B1(atan)
+ B1(atan2_op)
+ B1(atan_op)
B1(sinh)
B1(cosh)
B1(tanh)
_atan2(glsl_type::vec2_type),
_atan2(glsl_type::vec3_type),
_atan2(glsl_type::vec4_type),
+ _atan_op(glsl_type::float_type),
+ _atan_op(glsl_type::vec2_type),
+ _atan_op(glsl_type::vec3_type),
+ _atan_op(glsl_type::vec4_type),
+ _atan2_op(glsl_type::float_type),
+ _atan2_op(glsl_type::vec2_type),
+ _atan2_op(glsl_type::vec3_type),
+ _atan2_op(glsl_type::vec4_type),
NULL);
F(sinh)
const unsigned n = type->vector_elements;
ir_variable *y = in_var(type, "y");
ir_variable *x = in_var(type, "x");
- MAKE_SIG(type, always_available, 2, y, x);
+ MAKE_SIG(type, is_not_nir, 2, y, x);
/* If we're on the left half-plane rotate the coordinates π/2 clock-wise
* for the y=0 discontinuity to end up aligned with the vertical
builtin_builder::_atan(const glsl_type *type)
{
ir_variable *y_over_x = in_var(type, "y_over_x");
- MAKE_SIG(type, always_available, 1, y_over_x);
+ MAKE_SIG(type, is_not_nir, 1, y_over_x);
ir_variable *tmp = body.make_temp(type, "tmp");
do_atan(body, type, tmp, y_over_x);
UNOP(log, ir_unop_log, always_available)
UNOP(exp2, ir_unop_exp2, always_available)
UNOP(log2, ir_unop_log2, always_available)
+UNOP(atan_op, ir_unop_atan, is_nir)
UNOPA(sqrt, ir_unop_sqrt)
UNOPA(inversesqrt, ir_unop_rsq)
return sig;
}
+ir_function_signature *
+builtin_builder::_atan2_op(const glsl_type *x_type)
+{
+ return binop(is_nir, ir_binop_atan2, x_type, x_type, x_type);
+}
+
ir_function_signature *
builtin_builder::_floatBitsToInt(const glsl_type *type)
{