nvc0/ir: fix TargetNVC0::insnCanLoadOffset()
[mesa.git] / src / gallium / drivers / nouveau / codegen / nv50_ir_target_nvc0.cpp
index 954aec0a2f9770b2c8cd4abdbbd2d12c59444f2e..8938d19f6cf2bc74cea17af6cce8aba46babb19d 100644 (file)
@@ -415,6 +415,7 @@ bool
 TargetNVC0::insnCanLoadOffset(const Instruction *insn, int s, int offset) const
 {
    const ValueRef& ref = insn->src(s);
+   offset += insn->src(s).get()->reg.data.offset;
    if (ref.getFile() == FILE_MEMORY_CONST &&
        (insn->op != OP_LOAD || insn->subOp != NV50_IR_SUBOP_LDC_IS))
       return offset >= -0x8000 && offset < 0x8000;