Fix precise on matrix with matrix subscript. (#2545)
This commit is contained in:
Родитель
8ea40f8604
Коммит
f032e2bce5
|
@ -1099,8 +1099,13 @@ void HLModule::MarkPreciseAttributeOnPtrWithFunctionCall(llvm::Value *Ptr,
|
|||
MarkPreciseAttributeOnValWithFunctionCall(arg, Builder, M);
|
||||
}
|
||||
} else {
|
||||
IRBuilder<> Builder(CI->getNextNode());
|
||||
MarkPreciseAttributeOnValWithFunctionCall(CI, Builder, M);
|
||||
if (CI->getType()->isPointerTy()) {
|
||||
// For instance, matrix subscript...
|
||||
MarkPreciseAttributeOnPtrWithFunctionCall(CI, M);
|
||||
} else {
|
||||
IRBuilder<> Builder(CI->getNextNode());
|
||||
MarkPreciseAttributeOnValWithFunctionCall(CI, Builder, M);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Must be GEP here.
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
// RUN: %dxc -E main -T vs_6_0 %s | FileCheck %s
|
||||
|
||||
// CHECK: define void @main()
|
||||
|
||||
float3x3 main(float3 normal : IN) : OUT
|
||||
{
|
||||
precise float3x3 ret; // <---- precise
|
||||
ret[0] = normal;
|
||||
ret[1] = normal;
|
||||
ret[2] = normal;
|
||||
return ret;
|
||||
}
|
Загрузка…
Ссылка в новой задаче