nv50/ir: fix tex constraints for surface coords on Fermi
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 27 Apr 2016 16:27:10 +0000 (18:27 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Sat, 21 May 2016 16:32:49 +0000 (18:32 +0200)
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 65d11f8237abb2d8178aecb8c2fd586d9f30075e..6b52d7b4d33d98ec3f16003ac947f60c8fcf0856 100644 (file)
@@ -2152,6 +2152,12 @@ RegAlloc::InsertConstraintsPass::texConstraintNVC0(TexInstruction *tex)
    if (tex->op == OP_TXQ) {
       s = tex->srcCount(0xff);
       n = 0;
+   } else if (isSurfaceOp(tex->op)) {
+      s = tex->tex.target.getDim() + (tex->tex.target.isArray() || tex->tex.target.isCube());
+      if (tex->op == OP_SUSTB || tex->op == OP_SUSTP)
+         n = 4;
+      else
+         n = 0;
    } else {
       s = tex->tex.target.getArgCount() - tex->tex.target.isMS();
       if (!tex->tex.target.isArray() &&