This commit is contained in:
Jorijn van der Graaf 2026-05-18 22:31:28 +02:00
commit 765cf33069
6 changed files with 10895 additions and 11 deletions

View file

@ -21,6 +21,17 @@ export module Crafter.Asset:Compression;
import std;
export namespace Crafter::Compression {
// Hard-aborts the process after printing `msg`. Used in place of
// `throw std::runtime_error(...)` so the module is buildable under
// `-fno-exceptions` (wasm targets ship without the C++ unwinding
// runtime). Asset-loading errors are unrecoverable in practice — a
// bad magic, version mismatch, or stream-size mismatch always means
// the build's data is inconsistent with the binary.
[[noreturn]] inline void Fatal(std::string_view msg) {
std::println(std::cerr, "Crafter.Asset fatal: {}", msg);
std::abort();
}
// One independently-decompressable GDeflate stream inside CompressedBlob::bytes.
// Layout matches what VK_EXT_memory_decompression's VkDecompressMemoryRegionEXT
// expects, minus the device addresses (which the consumer fills in).