spirv_tools_sys::assembler

Function assemble

Source
pub unsafe extern "C" fn assemble(
    tool: *const ToolContext,
    text: *const c_char,
    size: usize,
    options: u32,
    binary: *mut *mut Binary,
    diagnostic: *mut *mut Diagnostic,
) -> SpirvResult
Expand description

Encodes the given SPIR-V assembly text to its binary representation. The length parameter specifies the number of bytes for text. Encoded binary will be stored into *binary. Any error will be written into *diagnostic if diagnostic is non-null, otherwise the context’s message consumer will be used. The generated binary is independent of the context and may outlive it. The SPIR-V binary version is set to the highest version of SPIR-V supported by the context’s target environment.

The options parameter is a bit field of spv_text_to_binary_options_t.