remapper: do not eliminate interface variables in dce by default
this is done by counting op_entrypoint as a use/def
This commit is contained in:
parent
85b52f304d
commit
39d5e711a7
@ -926,7 +926,16 @@ namespace spv {
|
|||||||
// Count function variable use
|
// Count function variable use
|
||||||
process(
|
process(
|
||||||
[&](spv::Op opCode, unsigned start) {
|
[&](spv::Op opCode, unsigned start) {
|
||||||
if (opCode == spv::OpVariable) { ++varUseCount[asId(start+2)]; return true; }
|
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;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user