Fix precise on matrix with matrix subscript. (#2545)

This commit is contained in:
Tex Riddell 2019-10-24 17:08:05 -07:00 коммит произвёл GitHub
Родитель 8ea40f8604
Коммит f032e2bce5
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 19 добавлений и 2 удалений

Просмотреть файл

@ -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;
}