HLMatrixLower: Fix out matrix param for lib func

This commit is contained in:
Tex Riddell 2018-03-13 01:53:52 -07:00
Родитель 5f94a3cf57
Коммит 74f4fee608
2 изменённых файлов: 15 добавлений и 1 удалений

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

@ -2195,7 +2195,7 @@ void HLMatrixLowerPass::castMatrixArgs(Instruction *I) {
Value *argVal = I->getOperand(i);
Type *argTy = argVal->getType();
if (argTy->isPointerTy())
argTy->getPointerElementType();
argTy = argTy->getPointerElementType();
if (argTy->isStructTy() && IsMatrixType(argTy)) {
Value *vecVal = matToVecMap[argVal];
Value *newMatVal = GetMatrixForVec(vecVal, argVal->getType());

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

@ -0,0 +1,14 @@
// RUN: %dxc -T lib_6_1 -Zpr %s | FileCheck %s
// CHECK: call void @"\01?GetMat
// CHECK-NOT: undef
// CHECK: load <16 x float>
void GetMat(out float4x4 mat);
[shader("pixel")]
float4 test(uint i:I) : SV_Target {
float4x4 mat;
GetMat(mat);
return mat[i];
}