Bugfix: add per-lane offsets when accessing varying data through a pointer!

This commit is contained in:
Matt Pharr
2012-01-27 13:37:18 -08:00
parent d9c0f9315a
commit bdba3cd97d

View File

@@ -3065,8 +3065,10 @@ IndexExpr::GetLValue(FunctionEmitContext *ctx) const {
if (baseValue == NULL || indexValue == NULL)
return NULL;
ctx->SetDebugPos(pos);
return ctx->GetElementPtrInst(baseValue, indexValue,
baseExprType, "ptr_offset");
llvm::Value *ptr = ctx->GetElementPtrInst(baseValue, indexValue,
baseExprType, "ptr_offset");
ptr = lAddVaryingOffsetsIfNeeded(ctx, ptr, GetLValueType());
return ptr;
}
// Otherwise it's an array or vector