Expand description
Shaderc system library FFI, building, and linking
This crate contains the lower-level C interface for the Shaderc library. For the higher-level Rust-friendly interface, please see the shaderc crate.
The Shaderc library provides an API for compiling GLSL/HLSL source code to SPIRV modules. It has been shipping in the Android NDK since version r12b.
This crate contains Rust FFI inteface to the Shaderc library. It also
handles system library detection and building from source if no system
library installed via build.rs
.
The order of preference in which the build script will attempt to obtain Shaderc can be controlled by several options:
- The option
--features build-from-source
will prevent automatic library detection and force building from source. - If the
SHADERC_LIB_DIR
environment variable is set to/path/to/shaderc/libs/
, it will take precedence andlibshaderc_combined.a
(and the glslang and SPIRV libraries on Linux) will be searched in the/path/to/shaderc/libs/
directory. - On Linux,
/usr/lib/
will be automatically searched for system libraries if none of the above were given. - If no other option was set or succeeded, shaderc-sys will fall back to checking out and compiling a copy of Shaderc. This procedure is quite slow.
The build script also tries to check whether Ninja
is available on PATH
. Ninja is required to build with Visual Studio because
MSBuild does not support paths longer than MAX_PATH. On other platforms,
Ninja is optional but is generally faster than the default build tool.
Structs§
Enums§
Functions§
- shaderc_
assemble_ ⚠into_ spv - shaderc_
compile_ ⚠into_ preprocessed_ text - shaderc_
compile_ ⚠into_ spv - shaderc_
compile_ ⚠into_ spv_ assembly - shaderc_
compile_ ⚠options_ add_ macro_ definition - shaderc_
compile_ ⚠options_ clone - shaderc_
compile_ ⚠options_ initialize - shaderc_
compile_ ⚠options_ release - shaderc_
compile_ ⚠options_ set_ auto_ bind_ uniforms - shaderc_
compile_ ⚠options_ set_ auto_ combined_ image_ sampler - shaderc_
compile_ ⚠options_ set_ auto_ map_ locations - shaderc_
compile_ ⚠options_ set_ binding_ base - shaderc_
compile_ ⚠options_ set_ binding_ base_ for_ stage - shaderc_
compile_ ⚠options_ set_ forced_ version_ profile - shaderc_
compile_ ⚠options_ set_ generate_ debug_ info - shaderc_
compile_ ⚠options_ set_ hlsl_ functionality1 - shaderc_
compile_ ⚠options_ set_ hlsl_ io_ mapping - shaderc_
compile_ ⚠options_ set_ hlsl_ offsets - shaderc_
compile_ ⚠options_ set_ hlsl_ register_ set_ and_ binding - shaderc_
compile_ ⚠options_ set_ hlsl_ register_ set_ and_ binding_ for_ stage - shaderc_
compile_ ⚠options_ set_ include_ callbacks - shaderc_
compile_ ⚠options_ set_ invert_ y - shaderc_
compile_ ⚠options_ set_ limit - shaderc_
compile_ ⚠options_ set_ nan_ clamp - shaderc_
compile_ ⚠options_ set_ optimization_ level - shaderc_
compile_ ⚠options_ set_ source_ language - shaderc_
compile_ ⚠options_ set_ suppress_ warnings - shaderc_
compile_ ⚠options_ set_ target_ env - shaderc_
compile_ ⚠options_ set_ target_ spirv - shaderc_
compile_ ⚠options_ set_ warnings_ as_ errors - shaderc_
compiler_ ⚠initialize - shaderc_
compiler_ ⚠release - shaderc_
get_ ⚠spv_ version - shaderc_
parse_ ⚠version_ profile - shaderc_
result_ ⚠get_ bytes - shaderc_
result_ ⚠get_ compilation_ status - shaderc_
result_ ⚠get_ error_ message - shaderc_
result_ ⚠get_ length - shaderc_
result_ ⚠get_ num_ errors - shaderc_
result_ ⚠get_ num_ warnings - shaderc_
result_ ⚠release