diff options
author | Corbin Simpson <MostAwesomeDude@gmail.com> | 2010-02-10 12:31:18 -0800 |
---|---|---|
committer | Corbin Simpson <MostAwesomeDude@gmail.com> | 2010-02-10 12:35:30 -0800 |
commit | 92ea8834d826eb6986112b5c2e0b530522d00530 (patch) | |
tree | 90547f76c35616fb5f270d47995e76a8ad93a51c /src | |
parent | f6a16dfa9714c33a16cae3826dec7806be6c21cd (diff) |
r300/compiler: r500-fs: Properly set HW register swizzles.
Fixes fallout from 9a1bf52c.
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/r300/compiler/r500_fragprog.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c | 15 |
2 files changed, 14 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c b/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c index d87acecdab..b0fb8e970b 100644 --- a/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c +++ b/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c @@ -295,7 +295,7 @@ static char *toswiz(int swiz_val) { case 2: return "B"; case 3: return "A"; case 4: return "0"; - case 5: return "1/2"; + case 5: return "H"; case 6: return "1"; case 7: return "U"; } diff --git a/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c b/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c index c2eb613b23..829f028950 100644 --- a/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c +++ b/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c @@ -121,8 +121,19 @@ static unsigned int translate_alpha_op(struct r300_fragment_program_compiler *c, static unsigned int fix_hw_swizzle(unsigned int swz) { - if (swz == 5) swz = 6; - if (swz == RC_SWIZZLE_UNUSED) swz = 4; + switch (swz) { + case RC_SWIZZLE_ZERO: + case RC_SWIZZLE_UNUSED: + swz = 4; + break; + case RC_SWIZZLE_HALF: + swz = 5; + break; + case RC_SWIZZLE_ONE: + swz = 6; + break; + } + return swz; } |