Mesa (master): nv50/ir: fix emission of s[] args in certain situations

Ilia Mirkin imirkin at kemper.freedesktop.org
Sun Nov 8 00:03:21 UTC 2015


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

Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date:   Sat Nov  7 18:48:55 2015 -0500

nv50/ir: fix emission of s[] args in certain situations

There might only be a single arg (e.g. cvt), so use mode rather than
looking at the source directly. Also we don't want to rely on the type
of the value, which can be unreliable, but instead use the
instruction's. This works out well since mkSplit doesn't adjust the
type.

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>

---

 src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp
index 7e0fb53..0b52882 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp
@@ -441,9 +441,9 @@ CodeEmitterNV50::setSrcFileBits(const Instruction *i, int enc)
       return;
 
    if ((mode & 3) == 1) {
-      const int pos = i->src(1).getFile() == FILE_IMMEDIATE ? 13 : 14;
+      const int pos = ((mode >> 2) & 3) == 3 ? 13 : 14;
 
-      switch (i->getSrc(0)->reg.type) {
+      switch (i->sType) {
       case TYPE_U8:
          break;
       case TYPE_U16:




More information about the mesa-commit mailing list