diff --git a/player/tests/test.rs b/player/tests/test.rs index 7276e6c29..4382f2f51 100644 --- a/player/tests/test.rs +++ b/player/tests/test.rs @@ -3,7 +3,7 @@ //! and run the tests through them. //! //! Test requirements: -//! - all IDs have the backend `Empty` +//! - all IDs have the backend `Noop` //! - all expected buffers have `MAP_READ` usage //! - last action is `Submit` //! - no swapchain use @@ -74,9 +74,7 @@ impl Test<'_> { wgt::Backend::Gl => "Gl", _ => unreachable!(), }; - let string = read_to_string(&path) - .unwrap() - .replace("Empty", backend_name); + let string = read_to_string(&path).unwrap().replace("Noop", backend_name); ron::de::from_str(&string) .unwrap_or_else(|e| panic!("{path:?}:{} {}", e.position.line, e.code)) } diff --git a/wgpu-core/src/hal_api.rs b/wgpu-core/src/hal_api.rs index b41847b8d..e8d40d8eb 100644 --- a/wgpu-core/src/hal_api.rs +++ b/wgpu-core/src/hal_api.rs @@ -4,8 +4,8 @@ pub trait HalApi: hal::Api + 'static + WasmNotSendSync { const VARIANT: Backend; } -impl HalApi for hal::api::Empty { - const VARIANT: Backend = Backend::Empty; +impl HalApi for hal::api::Noop { + const VARIANT: Backend = Backend::Noop; } #[cfg(vulkan)] diff --git a/wgpu-core/src/id.rs b/wgpu-core/src/id.rs index 2fdfde911..dd68ba945 100644 --- a/wgpu-core/src/id.rs +++ b/wgpu-core/src/id.rs @@ -65,11 +65,11 @@ impl RawId { /// any backend, but the corresponding resource types ([`Texture`], for /// example) are always parameterized by a specific backend `A`. /// -/// So the `T` in `Id` is usually a resource type like `Texture`, -/// where [`Empty`] is the `wgpu_hal` dummy back end. These empty types are +/// So the `T` in `Id` is usually a resource type like `Texture`, +/// where [`Noop`] is the `wgpu_hal` dummy back end. These empty types are /// never actually used, beyond just making sure you access each `Storage` with /// the right kind of identifier. The members of [`Hub`] pair up each -/// `X` type with the resource type `X`, for some specific backend +/// `X` type with the resource type `X`, for some specific backend /// `A`. /// /// [`Global`]: crate::global::Global @@ -77,7 +77,7 @@ impl RawId { /// [`Hub`]: crate::hub::Hub /// [`Texture`]: crate::resource::Texture /// [`Registry`]: crate::hub::Registry -/// [`Empty`]: hal::api::Empty +/// [`Noop`]: hal::api::Noop #[repr(transparent)] #[cfg_attr(any(feature = "serde", feature = "trace"), derive(serde::Serialize))] #[cfg_attr(any(feature = "serde", feature = "replay"), derive(serde::Deserialize))] diff --git a/wgpu-hal/examples/halmark/main.rs b/wgpu-hal/examples/halmark/main.rs index 778cad0e0..731d9f0f0 100644 --- a/wgpu-hal/examples/halmark/main.rs +++ b/wgpu-hal/examples/halmark/main.rs @@ -815,7 +815,7 @@ cfg_if::cfg_if! { } // Fallback else { - type Api = hal::api::Empty; + type Api = hal::api::Noop; } } diff --git a/wgpu-hal/examples/ray-traced-triangle/main.rs b/wgpu-hal/examples/ray-traced-triangle/main.rs index a15aef841..730f6b111 100644 --- a/wgpu-hal/examples/ray-traced-triangle/main.rs +++ b/wgpu-hal/examples/ray-traced-triangle/main.rs @@ -1129,7 +1129,7 @@ cfg_if::cfg_if! { } // Fallback else { - type Api = hal::api::Empty; + type Api = hal::api::Noop; } } diff --git a/wgpu-hal/src/lib.rs b/wgpu-hal/src/lib.rs index bf7cb3642..24e1969a7 100644 --- a/wgpu-hal/src/lib.rs +++ b/wgpu-hal/src/lib.rs @@ -239,14 +239,14 @@ extern crate wgpu_types as wgt; /// DirectX12 API internals. #[cfg(dx12)] pub mod dx12; -/// A dummy API implementation. -pub mod empty; /// GLES API internals. #[cfg(gles)] pub mod gles; /// Metal API internals. #[cfg(metal)] pub mod metal; +/// A dummy API implementation. +pub mod noop; /// Vulkan API internals. #[cfg(vulkan)] pub mod vulkan; @@ -255,11 +255,11 @@ pub mod auxil; pub mod api { #[cfg(dx12)] pub use super::dx12::Api as Dx12; - pub use super::empty::Api as Empty; #[cfg(gles)] pub use super::gles::Api as Gles; #[cfg(metal)] pub use super::metal::Api as Metal; + pub use super::noop::Api as Noop; #[cfg(vulkan)] pub use super::vulkan::Api as Vulkan; } diff --git a/wgpu-hal/src/empty.rs b/wgpu-hal/src/noop/mod.rs similarity index 100% rename from wgpu-hal/src/empty.rs rename to wgpu-hal/src/noop/mod.rs diff --git a/wgpu-types/src/lib.rs b/wgpu-types/src/lib.rs index e71c89c5c..a217127df 100644 --- a/wgpu-types/src/lib.rs +++ b/wgpu-types/src/lib.rs @@ -75,8 +75,8 @@ pub const QUERY_SIZE: u32 = 8; #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum Backend { - /// Dummy backend, used for testing. - Empty = 0, + /// Dummy backend, which may be used for testing. + Noop = 0, /// Vulkan API (Windows, Linux, Android, MacOS via `vulkan-portability`/MoltenVK) Vulkan = 1, /// Metal API (Apple platforms) @@ -94,7 +94,7 @@ impl Backend { #[must_use] pub const fn to_str(self) -> &'static str { match self { - Backend::Empty => "empty", + Backend::Noop => "noop", Backend::Vulkan => "vulkan", Backend::Metal => "metal", Backend::Dx12 => "dx12",