only use dead input elimination on vertex shaders

It can't be safely used unilaterally on other stages, since that will
result in output/input mismatches between stages. They arn't
having their output variables eliminated accordingly.
This commit is contained in:
Malcolm Bechard 2022-09-28 00:07:01 -04:00
parent b40f87f1d3
commit d11c3ff315

View File

@ -212,7 +212,8 @@ void SpirvToolsTransform(const glslang::TIntermediate& intermediate, std::vector
optimizer.RegisterPass(spvtools::CreateInterpolateFixupPass());
if (options->optimizeSize) {
optimizer.RegisterPass(spvtools::CreateRedundancyEliminationPass());
optimizer.RegisterPass(spvtools::CreateEliminateDeadInputComponentsPass());
if (intermediate.getStage() == EShLanguage::EShLangVertex)
optimizer.RegisterPass(spvtools::CreateEliminateDeadInputComponentsPass());
}
optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass());
optimizer.RegisterPass(spvtools::CreateCFGCleanupPass());