doc: document naga reflect
This commit is contained in:
parent
3b9514ad38
commit
977975f4c7
|
@ -40,12 +40,9 @@
|
||||||
//! ```
|
//! ```
|
||||||
//!
|
//!
|
||||||
//! ## What's with all the traits?
|
//! ## What's with all the traits?
|
||||||
//! librashader-reflect is designed to be compiler-agnostic. In the future, we will allow usage of
|
//! librashader-reflect is designed to be compiler-agnostic. [naga](https://docs.rs/naga/latest/naga/index.html),
|
||||||
//! [naga](https://docs.rs/naga/latest/naga/index.html), a pure-Rust shader compiler, when it has
|
//! a pure-Rust shader compiler, as well as SPIRV-Cross via [SpirvCompilation](crate::front::SpirvCompilation)
|
||||||
//! matured enough to support [the features librashader needs](https://github.com/gfx-rs/naga/issues/1012).
|
//! is supported.
|
||||||
//!
|
|
||||||
//! In the meanwhile, the only supported compilation type is [GlslangCompilation](crate::front::SpirvCompilation),
|
|
||||||
//! which does transpilation via [glslang](https://github.com/KhronosGroup/glslang) and [SPIRV-Cross](https://github.com/KhronosGroup/SPIRV-Cross).
|
|
||||||
#![feature(impl_trait_in_assoc_type)]
|
#![feature(impl_trait_in_assoc_type)]
|
||||||
#![feature(let_chains)]
|
#![feature(let_chains)]
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
|
#[doc(hidden)]
|
||||||
pub mod glsl;
|
pub mod glsl;
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
pub mod hlsl;
|
pub mod hlsl;
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
pub mod msl;
|
pub mod msl;
|
||||||
|
|
||||||
use crate::error::{SemanticsErrorKind, ShaderReflectError};
|
use crate::error::{SemanticsErrorKind, ShaderReflectError};
|
||||||
|
@ -20,6 +25,8 @@ use spirv_cross::ErrorCode;
|
||||||
use crate::reflect::helper::{SemanticErrorBlame, TextureData, UboData};
|
use crate::reflect::helper::{SemanticErrorBlame, TextureData, UboData};
|
||||||
|
|
||||||
/// Reflect shaders under SPIRV-Cross semantics.
|
/// Reflect shaders under SPIRV-Cross semantics.
|
||||||
|
///
|
||||||
|
/// SPIRV-Cross supports GLSL, HLSL, SPIR-V, and MSL targets.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct SpirvCross;
|
pub struct SpirvCross;
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ pub mod presets;
|
||||||
|
|
||||||
mod helper;
|
mod helper;
|
||||||
|
|
||||||
|
/// Reflection via naga.
|
||||||
#[cfg(feature = "naga")]
|
#[cfg(feature = "naga")]
|
||||||
pub mod naga;
|
pub mod naga;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
|
#[doc(hidden)]
|
||||||
pub mod msl;
|
pub mod msl;
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
pub mod spirv;
|
pub mod spirv;
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
pub mod wgsl;
|
pub mod wgsl;
|
||||||
|
|
||||||
use crate::error::{SemanticsErrorKind, ShaderReflectError};
|
use crate::error::{SemanticsErrorKind, ShaderReflectError};
|
||||||
|
@ -28,6 +33,8 @@ use crate::reflect::{align_uniform_size, ReflectShader, ShaderReflection};
|
||||||
///
|
///
|
||||||
/// The Naga reflector will lower combined image samplers to split,
|
/// The Naga reflector will lower combined image samplers to split,
|
||||||
/// with the same bind point on descriptor group 1.
|
/// with the same bind point on descriptor group 1.
|
||||||
|
///
|
||||||
|
/// Naga supports WGSL, SPIR-V, and MSL targets.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Naga;
|
pub struct Naga;
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
|
Loading…
Reference in a new issue