Skip to content

Commit

Permalink
refactor: reimpl. ImplementedLanguageExtension::all w/ `strum::Vari…
Browse files Browse the repository at this point in the history
…antArray`

Signed-off-by: sagudev <[email protected]>
  • Loading branch information
sagudev authored and ErichDonGubler committed Jan 10, 2025
1 parent 72976f3 commit b74ab18
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion naga/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ codespan-reporting = { version = "0.11.0" }
rustc-hash.workspace = true
indexmap.workspace = true
log = "0.4"
strum.workspace = true
spirv = { version = "0.3", optional = true }
thiserror.workspace = true
serde = { version = "1.0.217", features = ["derive"], optional = true }
Expand Down Expand Up @@ -102,4 +103,3 @@ ron = "0.8.0"
rspirv = { version = "0.11", git = "https://github.com/gfx-rs/rspirv", rev = "b969f175d5663258b4891e44b76c1544da9661ab" }
serde = { workspace = true, features = ["derive"] }
spirv = { version = "0.3", features = ["deserialize"] }
strum.workspace = true
8 changes: 4 additions & 4 deletions naga/src/front/wgsl/parse/directive/language_extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
//!
//! The focal point of this module is the [`LanguageExtension`] API.
use strum::VariantArray;

/// A language extension recognized by Naga, but not guaranteed to be present in all environments.
///
/// WGSL spec.: <https://www.w3.org/TR/WGSL/#language-extensions-sec>
Expand Down Expand Up @@ -61,15 +63,13 @@ impl LanguageExtension {
}

/// A variant of [`LanguageExtension::Implemented`].
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, VariantArray)]
pub enum ImplementedLanguageExtension {}

impl ImplementedLanguageExtension {
const ALL: [ImplementedLanguageExtension; 0] = [];

/// Returns slice of all variants of [`ImplementedLanguageExtension`].
pub const fn all() -> &'static [Self] {
&Self::ALL
Self::VARIANTS
}

/// Maps this [`ImplementedLanguageExtension`] into the sentinel word associated with it in WGSL.
Expand Down

0 comments on commit b74ab18

Please sign in to comment.