| 177 | }; |
| 178 | |
| 179 | static std::optional<std::vector<std::byte>> |
| 180 | readFile(const std::filesystem::path &path) { |
| 181 | std::ifstream f(path, std::ios::binary | std::ios::ate); |
| 182 | |
| 183 | if (!f) { |
| 184 | return {}; |
| 185 | } |
| 186 | |
| 187 | std::vector<std::byte> data(f.tellg()); |
| 188 | f.seekg(0, std::ios::beg); |
| 189 | f.read(reinterpret_cast<char *>(data.data()), data.size()); |
| 190 | return data; |
| 191 | } |
| 192 | |
| 193 | static void writeSpvHeader(OutputParam &outputParam, std::ostream &out, |
| 194 | std::span<const std::uint32_t> spv) { |