nvc0/ir: fix constraints for OP_SUSTx on Kepler
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 5 Apr 2016 10:39:12 +0000 (12:39 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 26 Apr 2016 17:47:49 +0000 (19:47 +0200)
Destination type is actually always 32-bits, so typeSizeof() returns 4
and no sources are condensed.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp

index 500ab8915de7f3f222ace12c2fc4b096253fae50..7e8bb17fb258ddc78b4c5ad34ad9a2d729e3c756 100644 (file)
@@ -2131,7 +2131,9 @@ RegAlloc::InsertConstraintsPass::texConstraintNVE0(TexInstruction *tex)
    condenseDefs(tex);
 
    if (tex->op == OP_SUSTB || tex->op == OP_SUSTP) {
-      condenseSrcs(tex, 3, (3 + typeSizeof(tex->dType) / 4) - 1);
+      int n = tex->srcCount(0xff);
+      if (n > 4)
+         condenseSrcs(tex, 3, n - 1);
    } else
    if (isTextureOp(tex->op)) {
       int n = tex->srcCount(0xff, true);