MCPcopy Create free account
hub / github.com/ddiakopoulos/polymer / compile_variant

Method compile_variant

libraries/lib-engine/src/shader.cpp:162–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160}
161
162gl_shader gl_shader_asset::compile_variant(const std::vector<std::string> defines)
163{
164 gl_shader variant;
165
166 try
167 {
168 if (defines.size() > 0 || includePath.size() > 0)
169 {
170 variant = preprocess(read_file_text(vertexPath), read_file_text(fragmentPath), read_file_text(geomPath), includePath, defines, includes);
171 }
172 else
173 {
174 variant = gl_shader(read_file_text(vertexPath), read_file_text(fragmentPath), read_file_text(geomPath));
175 }
176 }
177 catch (const std::exception & e)
178 {
179 //@todo use logger
180 std::cout << "Shader recompilation error: " << e.what() << std::endl;
181 }
182
183 return std::move(variant);
184}

Callers

nothing calls this directly

Calls 4

preprocessFunction · 0.85
read_file_textFunction · 0.85
gl_shaderClass · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected