QuerySet::{as, from}_core

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
sagudev authored and mergify[bot] committed 2026-09-27 06:46:29 +00:00
1 parent 988891de66
commit 1122932c10
2 files changed
+31

No files matched your search

+19
View File
@@ -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`].
+12
View File
@@ -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>,