summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2013-05-20 11:01:37 -0700
committerMatt Turner <[email protected]>2013-06-14 11:25:49 -0700
commited455cdb0be458454fbefb87a1a973d95dda9e6a (patch)
tree18b37f9602b81ee84a00aae154d0860fc92fdec6 /src
parenta8492e8fe7e70c558a494da7fa2fb4a05dc51962 (diff)
glsl: Allow swizzles on scalars.
Required by ARB_shading_language_420pack. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/glsl/hir_field_selection.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/glsl/hir_field_selection.cpp b/src/glsl/hir_field_selection.cpp
index cc7ba61c8f1..ceb0a4cdb62 100644
--- a/src/glsl/hir_field_selection.cpp
+++ b/src/glsl/hir_field_selection.cpp
@@ -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);