HLSL: Track control-flow nesting and warn on aliasing under it.

This commit is contained in:
John Kessenich
2017-06-06 19:52:55 -06:00
parent 9b2531ba23
commit f6deacd579
2 changed files with 21 additions and 4 deletions

View File

@@ -518,7 +518,7 @@ TIntermTyped* HlslParseContext::handleSamplerLvalue(const TSourceLoc& loc, const
}
if (controlFlowNestingLevel > 0)
error(loc, "can't alias sampler in control flow", op, "");
warn(loc, "sampler or image aliased under control flow; consumption must be in same path", op, "");
// Best is if we are aliasing a flattened struct member "S.s1 = s2",
// in which case we want to update the flattening information with the alias,