Enable preprocessor optimization of ESSL 1.0

Since #7358 is blocked by an upstream spirv-cross issue, we can at least do a
bit of preprocessor optimization for ESSL 1.0 code in the meantime and introduce
the FILAMENT_EFFECTIVE_VERSION preprocessor definitions.
This commit is contained in:
Eliza Velasquez
2023-11-16 12:47:46 -08:00
committed by Eliza
parent 8f6c4841cb
commit caae42fdf6
4 changed files with 38 additions and 3 deletions
+6 -1
View File
@@ -23,6 +23,7 @@
#include <spirv_glsl.hpp>
#include <spirv_msl.hpp>
#include "backend/DriverEnums.h"
#include "sca/builtinResource.h"
#include "sca/GLSLTools.h"
@@ -395,7 +396,11 @@ bool GLSLPostProcessor::process(const std::string& inputShader, Config const& co
break;
case MaterialBuilder::Optimization::SIZE:
case MaterialBuilder::Optimization::PERFORMANCE:
fullOptimization(tShader, config, internalConfig);
if (config.featureLevel == filament::backend::FeatureLevel::FEATURE_LEVEL_0) {
preprocessOptimization(tShader, config, internalConfig);
} else {
fullOptimization(tShader, config, internalConfig);
}
break;
}