[][src]Crate shaderc_sys

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:

  1. The option --features build-from-source will prevent automatic library detection and force building from source.
  2. If the SHADERC_LIB_DIR environment variable is set to /path/to/shaderc/libs/, it will take precedence and libshaderc_combined.a (and the glslang and SPIRV libraries on Linux) will be searched in the /path/to/shaderc/libs/ directory.
  3. On Linux, /usr/lib/ will be automatically searched for system libraries if none of the above were given.
  4. 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

shaderc_include_result

Enums

ShadercCompilationResult
ShadercCompileOptions
ShadercCompiler

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_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