///////////////////////////////////////////////////////
| 454 | |
| 455 | //////////////////////////////////////////////////////////// |
| 456 | bool Shader::loadFromStream(InputStream& stream, Type type) |
| 457 | { |
| 458 | // Read the shader code from the stream |
| 459 | std::vector<char> shader; |
| 460 | if (!getStreamContents(stream, shader)) |
| 461 | { |
| 462 | err() << "Failed to read shader from stream" << std::endl; |
| 463 | return false; |
| 464 | } |
| 465 | |
| 466 | // Compile the shader program |
| 467 | if (type == Type::Vertex) |
| 468 | return compile(shader.data(), {}, {}); |
| 469 | |
| 470 | if (type == Type::Geometry) |
| 471 | return compile({}, shader.data(), {}); |
| 472 | |
| 473 | return compile({}, {}, shader.data()); |
| 474 | } |
| 475 | |
| 476 | |
| 477 | //////////////////////////////////////////////////////////// |
nothing calls this directly
no test coverage detected