Skip to content

Commit 6dafe9c

Browse files
authored
[naga wgsl-in] Remove to_wgsl method on StorageFormat. (#7288)
Delete `StorageFormat::to_wgsl`, and use `StorageFormat`'s `common::wgsl::ToWgsl` implementation instead.
1 parent 2fac7fa commit 6dafe9c

File tree

1 file changed

+2
-49
lines changed

1 file changed

+2
-49
lines changed

naga/src/front/wgsl/to_wgsl.rs

Lines changed: 2 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//! Producing the WGSL forms of types, for use in error messages.
22
3+
use crate::common::wgsl::ToWgsl;
4+
35
use alloc::{
46
format,
57
string::{String, ToString},
@@ -160,55 +162,6 @@ impl crate::Scalar {
160162
}
161163
}
162164

163-
impl crate::StorageFormat {
164-
pub const fn to_wgsl(self) -> &'static str {
165-
use crate::StorageFormat as Sf;
166-
match self {
167-
Sf::R8Unorm => "r8unorm",
168-
Sf::R8Snorm => "r8snorm",
169-
Sf::R8Uint => "r8uint",
170-
Sf::R8Sint => "r8sint",
171-
Sf::R16Uint => "r16uint",
172-
Sf::R16Sint => "r16sint",
173-
Sf::R16Float => "r16float",
174-
Sf::Rg8Unorm => "rg8unorm",
175-
Sf::Rg8Snorm => "rg8snorm",
176-
Sf::Rg8Uint => "rg8uint",
177-
Sf::Rg8Sint => "rg8sint",
178-
Sf::R32Uint => "r32uint",
179-
Sf::R32Sint => "r32sint",
180-
Sf::R32Float => "r32float",
181-
Sf::Rg16Uint => "rg16uint",
182-
Sf::Rg16Sint => "rg16sint",
183-
Sf::Rg16Float => "rg16float",
184-
Sf::Rgba8Unorm => "rgba8unorm",
185-
Sf::Rgba8Snorm => "rgba8snorm",
186-
Sf::Rgba8Uint => "rgba8uint",
187-
Sf::Rgba8Sint => "rgba8sint",
188-
Sf::Bgra8Unorm => "bgra8unorm",
189-
Sf::Rgb10a2Uint => "rgb10a2uint",
190-
Sf::Rgb10a2Unorm => "rgb10a2unorm",
191-
Sf::Rg11b10Ufloat => "rg11b10float",
192-
Sf::R64Uint => "r64uint",
193-
Sf::Rg32Uint => "rg32uint",
194-
Sf::Rg32Sint => "rg32sint",
195-
Sf::Rg32Float => "rg32float",
196-
Sf::Rgba16Uint => "rgba16uint",
197-
Sf::Rgba16Sint => "rgba16sint",
198-
Sf::Rgba16Float => "rgba16float",
199-
Sf::Rgba32Uint => "rgba32uint",
200-
Sf::Rgba32Sint => "rgba32sint",
201-
Sf::Rgba32Float => "rgba32float",
202-
Sf::R16Unorm => "r16unorm",
203-
Sf::R16Snorm => "r16snorm",
204-
Sf::Rg16Unorm => "rg16unorm",
205-
Sf::Rg16Snorm => "rg16snorm",
206-
Sf::Rgba16Unorm => "rgba16unorm",
207-
Sf::Rgba16Snorm => "rgba16snorm",
208-
}
209-
}
210-
}
211-
212165
#[cfg(test)]
213166
mod tests {
214167
use alloc::{string::ToString, vec};

0 commit comments

Comments
 (0)