mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-20 06:21:13 +01:00
Update Instance::from_core
Creation of wgc instance is not unsafe anymore (here used to be global actually). Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
1 parent
78fa6152cc
commit
f54ae8f3b5
2 files changed
+3
-9
No files matched your search
@@ -407,15 +407,9 @@ impl Instance {
|
||||
/// # Arguments
|
||||
///
|
||||
/// - `core_instance` - wgpu-core instance.
|
||||
///
|
||||
/// # Safety
|
||||
///
|
||||
/// Refer to the creation of wgpu-core Instance.
|
||||
pub unsafe fn from_core(core_instance: Arc<wgc::instance::Instance>) -> Self {
|
||||
pub fn from_core(core_instance: Arc<wgc::instance::Instance>) -> Self {
|
||||
Self {
|
||||
inner: unsafe {
|
||||
crate::backend::ContextWgpuCore::from_core_instance(core_instance).into()
|
||||
},
|
||||
inner: crate::backend::ContextWgpuCore::from_core_instance(core_instance).into(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ impl ContextWgpuCore {
|
||||
unsafe { self.0.as_hal::<A>() }
|
||||
}
|
||||
|
||||
pub unsafe fn from_core_instance(core_instance: Arc<wgc::instance::Instance>) -> Self {
|
||||
pub fn from_core_instance(core_instance: Arc<wgc::instance::Instance>) -> Self {
|
||||
Self(core_instance)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user