| 160 | } |
| 161 | |
| 162 | gl_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 | } |
nothing calls this directly
no test coverage detected