///////////////////////////////////////////////////////
| 343 | |
| 344 | //////////////////////////////////////////////////////////// |
| 345 | bool Shader::loadFromFile(const std::filesystem::path& filename, Type type) |
| 346 | { |
| 347 | // Read the file |
| 348 | std::vector<char> shader; |
| 349 | if (!getFileContents(filename, shader)) |
| 350 | { |
| 351 | err() << "Failed to open shader file\n" << formatDebugPathInfo(filename) << std::endl; |
| 352 | return false; |
| 353 | } |
| 354 | |
| 355 | // Compile the shader program |
| 356 | if (type == Type::Vertex) |
| 357 | return compile(shader.data(), {}, {}); |
| 358 | |
| 359 | if (type == Type::Geometry) |
| 360 | return compile({}, shader.data(), {}); |
| 361 | |
| 362 | return compile({}, {}, shader.data()); |
| 363 | } |
| 364 | |
| 365 | |
| 366 | //////////////////////////////////////////////////////////// |
nothing calls this directly
no test coverage detected