From 22c9b6aa8dcc54be3ae1a078490abd3b2aa6a26a Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 18 Jan 2011 10:42:25 -0800 Subject: [PATCH] Don't use the reduced type when choosing a swizzle. --- mojoshader_compiler.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mojoshader_compiler.c b/mojoshader_compiler.c index 5450e161..c90990e7 100644 --- a/mojoshader_compiler.c +++ b/mojoshader_compiler.c @@ -2321,9 +2321,7 @@ static const MOJOSHADER_astDataType *type_check_ast(Context *ctx, void *_ast) } // if const int swizlen = (int) strlen(member); - if (swizlen == veclen) - datatype = reduced; - else + if (swizlen != veclen) { const char *typestr = NULL; switch (reduced->vector.base->type) @@ -2341,7 +2339,7 @@ static const MOJOSHADER_astDataType *type_check_ast(Context *ctx, void *_ast) snprintf(buf, sizeof (buf), "%s%d", typestr, swizlen); datatype = get_usertype(ctx, buf); assert(datatype != NULL); - } // else + } // if ast->derefstruct.datatype = datatype; return ast->derefstruct.datatype;