Merge pull request #326 from greg-lunarg/greg-mr4

remapper: do not eliminate interface variables in dce
This commit is contained in:
John Kessenich 2016-06-03 10:48:12 -06:00
commit 9f1f818083

View File

@ -926,8 +926,17 @@ namespace spv {
// Count function variable use
process(
[&](spv::Op opCode, unsigned start) {
if (opCode == spv::OpVariable) { ++varUseCount[asId(start+2)]; return true; }
return false;
if (opCode == spv::OpVariable) {
++varUseCount[asId(start+2)];
return true;
} else if (opCode == spv::OpEntryPoint) {
const int wordCount = asWordCount(start);
for (int i = 4; i < wordCount; i++) {
++varUseCount[asId(start+i)];
}
return true;
} else
return false;
},
[&](spv::Id& id) { if (varUseCount[id]) ++varUseCount[id]; }