Mesa (master): r300-gallium: vs: Fix negation calculation.

Corbin Simpson csimpson at kemper.freedesktop.org
Thu Jun 4 23:58:57 PDT 2009


Module: Mesa
Branch: master
Commit: 4c66c5bf921357c94611e583d1a64f653e957765
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4c66c5bf921357c94611e583d1a64f653e957765

Author: Corbin Simpson <MostAwesomeDude at gmail.com>
Date:   Thu Jun  4 23:56:32 2009 -0700

r300-gallium: vs: Fix negation calculation.

Still doesn't draw right, but at least it's the right numbers now.
Thanks to taiu in #dri-devel.

---

 src/gallium/drivers/r300/r300_state_tcl.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_state_tcl.c b/src/gallium/drivers/r300/r300_state_tcl.c
index 30a8dab..8cf8250 100644
--- a/src/gallium/drivers/r300/r300_state_tcl.c
+++ b/src/gallium/drivers/r300/r300_state_tcl.c
@@ -164,13 +164,13 @@ static uint32_t r300_vs_op(unsigned op)
 static uint32_t r300_vs_swiz(struct tgsi_full_src_register* reg)
 {
     if (reg->SrcRegister.Extended) {
-        return (reg->SrcRegister.Negate ? R300_PVS_NEGATE_XYZW : 0) |
+        return (reg->SrcRegister.Negate ? (0xf << 12) : 0) |
             reg->SrcRegisterExtSwz.ExtSwizzleX |
             (reg->SrcRegisterExtSwz.ExtSwizzleY << 3) |
             (reg->SrcRegisterExtSwz.ExtSwizzleZ << 6) |
             (reg->SrcRegisterExtSwz.ExtSwizzleW << 9);
     } else {
-        return (reg->SrcRegister.Negate ? R300_PVS_NEGATE_XYZW : 0) |
+        return (reg->SrcRegister.Negate ? (0xf << 12) : 0) |
             reg->SrcRegister.SwizzleX |
             (reg->SrcRegister.SwizzleY << 3) |
             (reg->SrcRegister.SwizzleZ << 6) |
@@ -182,13 +182,13 @@ static uint32_t r300_vs_swiz(struct tgsi_full_src_register* reg)
 static uint32_t r300_vs_scalar_swiz(struct tgsi_full_src_register* reg)
 {
     if (reg->SrcRegister.Extended) {
-        return (reg->SrcRegister.Negate ? R300_PVS_NEGATE_XYZW : 0) |
+        return (reg->SrcRegister.Negate ? (0xf << 12) : 0) |
             reg->SrcRegisterExtSwz.ExtSwizzleX |
             (reg->SrcRegisterExtSwz.ExtSwizzleX << 3) |
             (reg->SrcRegisterExtSwz.ExtSwizzleX << 6) |
             (reg->SrcRegisterExtSwz.ExtSwizzleX << 9);
     } else {
-        return (reg->SrcRegister.Negate ? R300_PVS_NEGATE_XYZW : 0) |
+        return (reg->SrcRegister.Negate ? (0xf << 12) : 0) |
             reg->SrcRegister.SwizzleX |
             (reg->SrcRegister.SwizzleX << 3) |
             (reg->SrcRegister.SwizzleX << 6) |



More information about the mesa-commit mailing list