[Mesa-dev] [PATCH 3/7] glsl: Allow swizzles on scalars.
Matt Turner
mattst88 at gmail.com
Fri May 24 18:28:15 PDT 2013
Required by ARB_shading_language_420pack.
---
src/glsl/hir_field_selection.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/glsl/hir_field_selection.cpp b/src/glsl/hir_field_selection.cpp
index cc7ba61..ceb0a4c 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);
--
1.8.1.5
More information about the mesa-dev
mailing list