Add new test case for image functions and fix issues caught by this test

This commit is contained in:
Rex Xu
2015-09-16 17:48:22 +08:00
parent bba5c80957
commit 6b86d496c2
14 changed files with 750 additions and 158 deletions

View File

@@ -159,8 +159,9 @@ public:
}
Id getImageType(Id resultId) const
{
assert(isSampledImageType(getTypeId(resultId)));
return module.getInstruction(getTypeId(resultId))->getIdOperand(0);
Id typeId = getTypeId(resultId);
assert(isImageType(typeId) || isSampledImageType(typeId));
return isSampledImageType(typeId) ? module.getInstruction(typeId)->getIdOperand(0) : typeId;
}
bool isArrayedImageType(Id typeId) const
{