2020#include " sca/GLSLTools.h"
2121#include " shaders/ShaderGenerator.h"
2222
23- #include " MockIncluder.h"
24-
2523#include < filamat/Enums.h>
2624#include < filamat/MaterialBuilder.h>
2725
@@ -53,9 +51,7 @@ std::string shaderWithAllProperties(JobSystem& jobSystem, ShaderStage type,
5351 filamat::MaterialBuilder::Shading shadingModel = filamat::MaterialBuilder::Shading::LIT,
5452 filamat::MaterialBuilder::RefractionMode refractionMode = filamat::MaterialBuilder::RefractionMode::NONE,
5553 filamat::MaterialBuilder::VertexDomain vertexDomain = filamat::MaterialBuilder::VertexDomain::OBJECT) {
56- MockIncluder includer;
57- includer
58- .sourceForInclude (" modify_normal.h" , " material.normal = vec3(0.8);" );
54+
5955 filamat::MaterialBuilder builder;
6056 builder.material (fragmentCode.c_str ());
6157 builder.materialVertex (vertexCode.c_str ());
@@ -68,8 +64,7 @@ std::string shaderWithAllProperties(JobSystem& jobSystem, ShaderStage type,
6864 MaterialBuilder::PropertyList allProperties;
6965 std::fill_n (allProperties, MaterialBuilder::MATERIAL_PROPERTIES_COUNT, true );
7066
71- // We need to "build" the material to resolve any includes in user code.
72- builder.build (jobSystem);
67+ // Note: no need to call builder.build as we are only checking the properties.
7368
7469 return builder.peek (type, {
7570 ShaderModel::MOBILE,
@@ -735,25 +730,6 @@ TEST_F(MaterialCompiler, StaticCodeAnalyzerOutputFactor) {
735730 EXPECT_TRUE (PropertyListsMatch (expected, properties));
736731}
737732
738- TEST_F (MaterialCompiler, StaticCodeAnalyzerWithinInclude) {
739- std::string fragmentCode (R"(
740- void material(inout MaterialInputs material) {
741- prepareMaterial(material);
742- #include "modify_normal.h"
743- }
744- )" );
745-
746- std::string shaderCode = shaderWithAllProperties (*jobSystem, ShaderStage::FRAGMENT,
747- fragmentCode);
748-
749- GLSLTools glslTools;
750- MaterialBuilder::PropertyList properties{ false };
751- glslTools.findProperties (ShaderStage::FRAGMENT, shaderCode, properties);
752- MaterialBuilder::PropertyList expected{ false };
753- expected[size_t (filamat::MaterialBuilder::Property::NORMAL)] = true ;
754- EXPECT_TRUE (PropertyListsMatch (expected, properties));
755- }
756-
757733TEST_F (MaterialCompiler, EmptyName) {
758734 std::string shaderCode (R"(
759735 void material(inout MaterialInputs material) {
0 commit comments