mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-22 15:31:03 +01:00
[deno] Use GPUQuerySet::{count, type} from wgc
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
1 parent
3e775e7a3b
commit
0e7fb34d97
3 files changed
+14
-10
No files matched your search
@@ -725,11 +725,7 @@ impl GPUDevice {
|
||||
|
||||
let wgpu_query_set = self.wgpu_device.create_query_set(&wgpu_descriptor);
|
||||
|
||||
Ok(GPUQuerySet {
|
||||
wgpu_query_set,
|
||||
r#type: descriptor.r#type,
|
||||
count: descriptor.count,
|
||||
})
|
||||
Ok(GPUQuerySet { wgpu_query_set })
|
||||
}
|
||||
|
||||
#[getter]
|
||||
|
||||
@@ -13,8 +13,6 @@ use crate::error::GPUGenericError;
|
||||
|
||||
pub struct GPUQuerySet {
|
||||
pub wgpu_query_set: Arc<wgpu_core::resource::QuerySet>,
|
||||
pub r#type: GPUQueryType,
|
||||
pub count: u32,
|
||||
}
|
||||
|
||||
impl WebIdlInterfaceConverter for GPUQuerySet {
|
||||
@@ -56,13 +54,13 @@ impl GPUQuerySet {
|
||||
#[getter]
|
||||
#[string]
|
||||
#[rename("type")]
|
||||
fn r#type(&self) -> &'static str {
|
||||
self.r#type.as_str()
|
||||
fn r#type(&self) -> String {
|
||||
self.wgpu_query_set.descriptor().ty.to_string()
|
||||
}
|
||||
|
||||
#[getter]
|
||||
fn count(&self) -> u32 {
|
||||
self.count
|
||||
self.wgpu_query_set.descriptor().count
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -512,6 +512,16 @@ pub enum QueryType {
|
||||
PipelineStatistics(PipelineStatisticsTypes),
|
||||
}
|
||||
|
||||
impl fmt::Display for QueryType {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
Self::Occlusion => f.write_str("occlusion"),
|
||||
Self::Timestamp => f.write_str("timestamp"),
|
||||
Self::PipelineStatistics(_) => f.write_str("pipeline-statistics"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bitflags::bitflags! {
|
||||
/// Flags for which pipeline data should be recorded in a query.
|
||||
///
|
||||
|
||||
Reference in new issue
Block a user