SPV: Partially address #2293: correct "const in" precision matching.
Track whether formal parameters declare reduced precision and match that with arguments, and if they differ, make a copy to promote the precision.
This commit is contained in:
parent
fbb9dc2cf1
commit
4df10335e6
6 changed files with 94 additions and 2 deletions
|
|
@ -1298,8 +1298,11 @@ Function* Builder::makeFunctionEntry(Decoration precision, Id returnType, const
|
|||
// Set up the precisions
|
||||
setPrecision(function->getId(), precision);
|
||||
for (unsigned p = 0; p < (unsigned)decorations.size(); ++p) {
|
||||
for (int d = 0; d < (int)decorations[p].size(); ++d)
|
||||
for (int d = 0; d < (int)decorations[p].size(); ++d) {
|
||||
addDecoration(firstParamId + p, decorations[p][d]);
|
||||
if (decorations[p][d] == DecorationRelaxedPrecision)
|
||||
function->addReducedPrecisionParam(p);
|
||||
}
|
||||
}
|
||||
|
||||
// CFG
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue