concinnity-device 0.19.119

GPU backends (Metal, Vulkan, DirectX) behind a device facade for Concinnity
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Scratch directory for the shader compilers that work on files: dxc, and the
// Metal toolchain behind a runtime metallib. Source and artifact are
// written and removed around each compile, so this is transient scratch rather
// than cache -- nothing here survives a compile, and nothing here belongs in
// the project's state tree.

// One compile's working directory, removed when the returned value drops.
//
// A directory of its own per compile rather than one shared by the process: a
// run that fails part-way leaves its files for the guard rather than for the
// next compile to trip over.
pub(crate) fn dir() -> Result<concinnity_host::scratch::Scratch, String> {
    concinnity_host::scratch::Scratch::dir("shader-compile")
        .map_err(|e| format!("create the shader compiler's work directory: {e}"))
}