glsl: Allow swizzles on scalars.

Required by ARB_shading_language_420pack.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Matt Turner 2013-05-20 11:01:37 -07:00
parent a8492e8fe7
commit ed455cdb0b
1 changed files with 3 additions and 1 deletions

View File

@ -96,7 +96,9 @@ _mesa_ast_field_selection_to_hir(const ast_expression *expr,
} else {
_mesa_glsl_error(&loc, state, "Unknown method: `%s'.", method);
}
} else if (op->type->is_vector()) {
} else if (op->type->is_vector() ||
(state->ARB_shading_language_420pack_enable &&
op->type->is_scalar())) {
ir_swizzle *swiz = ir_swizzle::create(op,
expr->primary_expression.identifier,
op->type->vector_elements);