Skip to content

Commit

Permalink
Don't use the reduced type when choosing a swizzle.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jan 18, 2011
1 parent 522f69c commit 22c9b6a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions mojoshader_compiler.c
Expand Up @@ -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)
Expand All @@ -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;
Expand Down

0 comments on commit 22c9b6a

Please sign in to comment.