[−][src]Trait emu_core::compile::CompileToSpirv
The trait to implement when adding support for a new source language (e.g. - HLSL, XLA, Swift SIL, etc.).
This trait is generic over the input language (which must be hash-able so we can do caching) and the target bytecode (which can be a Vec<u32>
or &mut [u32]
for example).
We want the target bytecode to be mutable for a reason. We want people to be able to mutate the bytecode later on to
do - for example - various linting, optimization, compression, etc. before finishing compilation to DeviceFnMut.
Also, the target bytecode should be a GLSL compute shader with a single entry point of interest.
Required methods
fn compile_to_spirv(src: I) -> Result<Spirv<P>, CompileError>
Compiles the source language into SPIR-V