diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2008-08-20 14:40:02 -0600 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2008-08-20 14:40:02 -0600 |
commit | ad9c862ffbb42d733595052d5769405ef7a98a75 (patch) | |
tree | 68df1efc0ccdf157da658271d8dac28fc7ac4036 /src/mesa/shader/slang | |
parent | e55093bf2f4ff32a691f63409b9fea321cf8eb0f (diff) |
mesa: glsl: fix a swizzle bug in storage_to_src_reg()
Need to remove the 'nil' components before swizzling a swizzle
Diffstat (limited to 'src/mesa/shader/slang')
-rw-r--r-- | src/mesa/shader/slang/slang_emit.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index f5f41eb116d..9e8daa10517 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -108,7 +108,9 @@ writemask_to_swizzle(GLuint writemask) /** - * Swizzle a swizzle. That is, return swz2(swz1) + * Swizzle a swizzle (function composition). + * That is, return swz2(swz1), or said another way: swz1.szw2 + * Example: swizzle_swizzle(".zwxx", ".xxyw") yields ".zzwx" */ GLuint _slang_swizzle_swizzle(GLuint swz1, GLuint swz2) @@ -279,7 +281,7 @@ storage_to_src_reg(struct prog_src_register *src, const slang_ir_storage *st) while (st->Parent) { st = st->Parent; index += st->Index; - swizzle = _slang_swizzle_swizzle(st->Swizzle, swizzle); + swizzle = _slang_swizzle_swizzle(fix_swizzle(st->Swizzle), swizzle); } assert(st->File >= 0); |