mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-22 23:41:01 +01:00
Playtest for binding a group
This commit is contained in:
1 parent
1886149cae
commit
eed8bf84ef
8 files changed
+99
-11
No files matched your search
@@ -520,7 +520,7 @@ impl<B: GfxBackend, F: GlobalIdentityHandlerFactory> Hub<B, F> {
|
||||
}
|
||||
|
||||
impl<B: GfxBackend, F: GlobalIdentityHandlerFactory> Hub<B, F> {
|
||||
fn clear(&mut self, surface_guard: &mut Storage<Surface, SurfaceId>) {
|
||||
fn clear(&self, surface_guard: &mut Storage<Surface, SurfaceId>) {
|
||||
use crate::resource::TextureViewInner;
|
||||
use hal::{device::Device as _, window::PresentationSurface as _};
|
||||
|
||||
@@ -688,6 +688,12 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
hubs: Hubs::new(&factory),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn clear_backend<B: GfxBackend>(&self, _dummy: ()) {
|
||||
let mut surface_guard = self.surfaces.data.write();
|
||||
let hub = B::hub(self);
|
||||
hub.clear(&mut *surface_guard);
|
||||
}
|
||||
}
|
||||
|
||||
impl<G: GlobalIdentityHandlerFactory> Drop for Global<G> {
|
||||
|
||||
@@ -202,16 +202,16 @@ struct PrivateFeatures {
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! gfx_select {
|
||||
($id:expr => $global:ident.$method:ident( $($param:expr),+ )) => {
|
||||
($id:expr => $global:ident.$method:ident( $($param:expr),* )) => {
|
||||
match $id.backend() {
|
||||
#[cfg(any(not(any(target_os = "ios", target_os = "macos")), feature = "gfx-backend-vulkan"))]
|
||||
wgt::Backend::Vulkan => $global.$method::<$crate::backend::Vulkan>( $($param),+ ),
|
||||
wgt::Backend::Vulkan => $global.$method::<$crate::backend::Vulkan>( $($param),* ),
|
||||
#[cfg(any(target_os = "ios", target_os = "macos"))]
|
||||
wgt::Backend::Metal => $global.$method::<$crate::backend::Metal>( $($param),+ ),
|
||||
wgt::Backend::Metal => $global.$method::<$crate::backend::Metal>( $($param),* ),
|
||||
#[cfg(windows)]
|
||||
wgt::Backend::Dx12 => $global.$method::<$crate::backend::Dx12>( $($param),+ ),
|
||||
wgt::Backend::Dx12 => $global.$method::<$crate::backend::Dx12>( $($param),* ),
|
||||
#[cfg(windows)]
|
||||
wgt::Backend::Dx11 => $global.$method::<$crate::backend::Dx11>( $($param),+ ),
|
||||
wgt::Backend::Dx11 => $global.$method::<$crate::backend::Dx11>( $($param),* ),
|
||||
_ => unreachable!()
|
||||
}
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user