mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-20 14:31:08 +01:00
QuerySet::{as, from}_core
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
1 parent
988891de66
commit
1122932c10
2 files changed
+31
No files matched your search
@@ -55,6 +55,25 @@ impl QuerySet {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(wgpu_core)]
|
||||
impl QuerySet {
|
||||
/// Create a new query set of wgpu from a wgpu-core query set.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// - `core_query_set` - wgpu-core query set.
|
||||
pub fn from_core(core_query_set: alloc::sync::Arc<wgc::resource::QuerySet>) -> Self {
|
||||
Self {
|
||||
inner: crate::backend::wgpu_core::CoreQuerySet::from_core(core_query_set).into(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the underlying wgpu-core query set if this `QuerySet` is on the wgpu-core backend, otherwise `None`.
|
||||
pub fn as_core(&self) -> Option<alloc::sync::Arc<wgc::resource::QuerySet>> {
|
||||
self.inner.as_core_opt().map(|qs| qs.as_core())
|
||||
}
|
||||
}
|
||||
|
||||
/// Describes a [`QuerySet`].
|
||||
///
|
||||
/// For use with [`Device::create_query_set`].
|
||||
|
||||
@@ -443,6 +443,18 @@ pub struct CoreQuerySet {
|
||||
pub(crate) wgpu_query_set: Arc<wgc::resource::QuerySet>,
|
||||
}
|
||||
|
||||
impl CoreQuerySet {
|
||||
pub(crate) fn from_core(core_query_set: Arc<wgc::resource::QuerySet>) -> Self {
|
||||
Self {
|
||||
wgpu_query_set: core_query_set,
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn as_core(&self) -> Arc<wgc::resource::QuerySet> {
|
||||
self.wgpu_query_set.clone()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct CorePipelineLayout {
|
||||
pub(crate) wgpu_pipeline_layout: Arc<wgc::binding_model::PipelineLayout>,
|
||||
|
||||
Reference in new issue
Block a user