Skip to content

Commit 9e309cc

Browse files
committed
remove webgpu target
1 parent 8ae0abd commit 9e309cc

File tree

3 files changed

+9
-37
lines changed

3 files changed

+9
-37
lines changed

spirv-tools-sys/src/shared.rs

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,9 @@ use std::fmt;
44
/// often necessary to specify which one applies. `Universal_*` implies an
55
/// environment-agnostic SPIR-V.
66
///
7-
/// When an API method needs to derive a SPIR-V version from a target environment
8-
/// the method will choose the highest version of SPIR-V supported by the target
9-
/// environment. Examples:
10-
///
11-
/// ```text
12-
/// SPV_ENV_VULKAN_1_0 -> SPIR-V 1.0
13-
/// SPV_ENV_VULKAN_1_1 -> SPIR-V 1.3
14-
/// SPV_ENV_VULKAN_1_1_SPIRV_1_4 -> SPIR-V 1.4
15-
/// SPV_ENV_VULKAN_1_2 -> SPIR-V 1.5
16-
/// ```
17-
///
18-
/// Consult the description of API entry points for specific rules.
7+
/// This enum MUST be kept in sync with the `typedef enum spv_target_env` in
8+
/// `spirv-tools-sys/spirv-tools/include/spirv-tools/libspirv.h`, it is being
9+
/// sent across the ffi boundary.
1910
#[derive(Copy, Clone, Debug, PartialEq)]
2011
#[repr(C)]
2112
#[allow(non_camel_case_types, clippy::upper_case_acronyms)]
@@ -58,8 +49,8 @@ pub enum TargetEnv {
5849
Universal_1_3,
5950
/// Vulkan 1.1 latest revision.
6051
Vulkan_1_1,
61-
/// Work in progress WebGPU 1.0.
62-
WebGPU_0,
52+
/// DEPRECATED, may be removed in the future.
53+
WebGPU_0_DEPRECATED,
6354
/// SPIR-V 1.4 latest revision, no other restrictions.
6455
Universal_1_4,
6556
/// Vulkan 1.1 with `VK_KHR_spirv_1_4`, i.e. SPIR-V 1.4 binary.
@@ -109,11 +100,12 @@ impl TargetEnv {
109100

110101
TargetEnv::Vulkan_1_0 => (1, 0),
111102
TargetEnv::Vulkan_1_1 => (1, 3),
112-
TargetEnv::WebGPU_0 => (1, 3),
113103
TargetEnv::Vulkan_1_1_Spirv_1_4 => (1, 4),
114104
TargetEnv::Vulkan_1_2 => (1, 5),
115105
TargetEnv::Vulkan_1_3 => (1, 6),
116106
TargetEnv::Vulkan_1_4 => (1, 6),
107+
108+
TargetEnv::WebGPU_0_DEPRECATED => (1, 3),
117109
}
118110
}
119111
}
@@ -156,7 +148,7 @@ impl std::str::FromStr for TargetEnv {
156148
"opengl4.2" => Self::OpenGL_4_2,
157149
"opengl4.3" => Self::OpenGL_4_3,
158150
"opengl4.5" => Self::OpenGL_4_5,
159-
"webgpu0" => Self::WebGPU_0,
151+
"webgpu0_DEPRECATED" => Self::WebGPU_0_DEPRECATED,
160152
_ => return Err(SpirvResult::InvalidValue),
161153
})
162154
}
@@ -191,7 +183,7 @@ impl fmt::Display for TargetEnv {
191183
Self::OpenGL_4_2 => "opengl4.2",
192184
Self::OpenGL_4_3 => "opengl4.3",
193185
Self::OpenGL_4_5 => "opengl4.5",
194-
Self::WebGPU_0 => "webgpu0",
186+
Self::WebGPU_0_DEPRECATED => "webgpu0_DEPRECATED",
195187
})
196188
}
197189
}

src/opt/compiled.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -162,24 +162,6 @@ impl Optimizer for CompiledOptimizer {
162162
self
163163
}
164164

165-
// /// Registers passes that have been prescribed for converting from Vulkan to
166-
// /// WebGPU. This sequence of passes is subject to constant review and will
167-
// /// change from time to time.
168-
// #[inline]
169-
// pub fn register_vulkan_to_webgpu_passes(&mut self) -> &mut Self {
170-
// unsafe { opt::optimizer_register_vulkan_to_webgpu_passes(self.inner) }
171-
// self
172-
// }
173-
174-
// /// Registers passes that have been prescribed for converting from WebGPU to
175-
// /// Vulkan. This sequence of passes is subject to constant review and will
176-
// /// change from time to time.
177-
// #[inline]
178-
// pub fn register_webgpu_to_vulkan_passes(&mut self) -> &mut Self {
179-
// unsafe { opt::optimizer_register_webgpu_to_vulkan_passes(self.inner) }
180-
// self
181-
// }
182-
183165
/// Registers passes that attempt to legalize the generated code.
184166
///
185167
/// Note: this recipe is specially designed for legalizing SPIR-V. It should be

src/opt/tool.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ pub struct ToolOptimizer {
66
passes: Vec<super::Passes>,
77
use_perf_passes: bool,
88
use_size_passes: bool,
9-
//use_vulkan_to_webgpu: bool,
10-
//use_webgpu_to_vulkan: bool,
119
legalize_hlsl: bool,
1210
}
1311

0 commit comments

Comments
 (0)