These features would not have been enabled with #version 420 otherwise.
Cc: "11.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
result = new(ctx) ir_constant(op->type->array_size());
}
} else if (op->type->is_vector()) {
- if (state->ARB_shading_language_420pack_enable) {
+ if (state->has_420pack()) {
/* .length() returns int. */
result = new(ctx) ir_constant((int) op->type->vector_elements);
} else {
goto fail;
}
} else if (op->type->is_matrix()) {
- if (state->ARB_shading_language_420pack_enable) {
+ if (state->has_420pack()) {
/* .length() returns int. */
result = new(ctx) ir_constant((int) op->type->matrix_columns);
} else {
}
const glsl_type *const constructor_type = this->constructor_type;
- if (!state->ARB_shading_language_420pack_enable) {
+ if (!state->has_420pack()) {
_mesa_glsl_error(&loc, state, "C-style initialization requires the "
"GL_ARB_shading_language_420pack extension");
return ir_rvalue::error_value(ctx);
* expressions. Const-qualified global variables must still be
* initialized with constant expressions.
*/
- if (!state->ARB_shading_language_420pack_enable
+ if (!state->has_420pack()
|| state->current_function == NULL) {
_mesa_glsl_error(& initializer_loc, state,
"initializer of %s variable `%s' must be a "
if (state->current_function->return_type != ret_type) {
YYLTYPE loc = this->get_location();
- if (state->ARB_shading_language_420pack_enable) {
+ if (state->has_420pack()) {
if (!apply_implicit_conversion(state->current_function->return_type,
ret, state)) {
_mesa_glsl_error(& loc, state,
expr->primary_expression.identifier);
}
} else if (op->type->is_vector() ||
- (state->ARB_shading_language_420pack_enable &&
- op->type->is_scalar())) {
+ (state->has_420pack() && op->type->is_scalar())) {
ir_swizzle *swiz = ir_swizzle::create(op,
expr->primary_expression.identifier,
op->type->vector_elements);