nvc0/ir: avoid generating illegal instructions for compute constbuf loads
authorIlia Mirkin <imirkin@alum.mit.edu>
Thu, 26 May 2016 01:54:39 +0000 (21:54 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Fri, 27 May 2016 01:23:49 +0000 (21:23 -0400)
commit04ecad97ff7b44bd9afd1bff9108dea199723829
treeac2ef9899856ab1d9c23a43640f0ed12f25cba1b
parent4f98c94be7e56a535a6b84a5561ae071e052c1e2
nvc0/ir: avoid generating illegal instructions for compute constbuf loads

For user-supplied constbufs, fileIndex is 0. In that case, when we
subtract 1, we'll end up loading from constbuf offset -16. This is
illegal, and there are asserts to avoid it. Normally we'd just DCE it,
but no point in generating the instructions if they're not going to be
used.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp