mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
Document Naga's promises around validation and panics.
This commit is contained in:
@@ -33,6 +33,21 @@ pub use r#type::{Disalignment, TypeError, TypeFlags};
|
||||
|
||||
bitflags::bitflags! {
|
||||
/// Validation flags.
|
||||
///
|
||||
/// If you are working with trusted shaders, then you may be able
|
||||
/// to save some time by skipping validation.
|
||||
///
|
||||
/// If you do not perform full validation, invalid shaders may
|
||||
/// cause Naga to panic. If you do perform full validation and
|
||||
/// [`Validator::validate`] returns `Ok`, then Naga promises that
|
||||
/// code generation will either succeed or return an error; it
|
||||
/// should never panic.
|
||||
///
|
||||
/// The default value for `ValidationFlags` is
|
||||
/// `ValidationFlags::all()`. If Naga's `"validate"` feature is
|
||||
/// enabled, this requests full validation; otherwise, this
|
||||
/// requests no validation. (The `"validate"` feature is disabled
|
||||
/// by default.)
|
||||
#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
|
||||
#[cfg_attr(feature = "deserialize", derive(serde::Deserialize))]
|
||||
pub struct ValidationFlags: u8 {
|
||||
|
||||
Reference in New Issue
Block a user