mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-21 15:00:57 +01:00
Add getters for type and count on QuerySet (#9672)
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
2 files changed
+17
-1
No files matched your search
@@ -429,7 +429,11 @@ impl Device {
|
||||
#[must_use]
|
||||
pub fn create_query_set(&self, desc: &QuerySetDescriptor<'_>) -> QuerySet {
|
||||
let query_set = self.inner.create_query_set(desc);
|
||||
QuerySet { inner: query_set }
|
||||
QuerySet {
|
||||
inner: query_set,
|
||||
ty: desc.ty,
|
||||
count: desc.count,
|
||||
}
|
||||
}
|
||||
|
||||
/// Set a callback which will be called for all errors that are not handled in error scopes.
|
||||
|
||||
@@ -25,6 +25,8 @@ use crate::*;
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct QuerySet {
|
||||
pub(crate) inner: dispatch::DispatchQuerySet,
|
||||
pub(crate) ty: QueryType,
|
||||
pub(crate) count: u32,
|
||||
}
|
||||
#[cfg(send_sync)]
|
||||
#[cfg(send_sync)]
|
||||
@@ -38,6 +40,16 @@ impl QuerySet {
|
||||
pub fn as_custom<T: custom::QuerySetInterface>(&self) -> Option<&T> {
|
||||
self.inner.as_custom()
|
||||
}
|
||||
|
||||
/// Returns the type of queries stored.
|
||||
pub fn ty(&self) -> QueryType {
|
||||
self.ty
|
||||
}
|
||||
|
||||
/// Returns the number of query result slots.
|
||||
pub fn count(&self) -> u32 {
|
||||
self.count
|
||||
}
|
||||
}
|
||||
|
||||
/// Describes a [`QuerySet`].
|
||||
|
||||
Reference in new issue
Block a user