fyrox_graphics/
query.rs

1use crate::core::Downcast;
2use std::fmt::Debug;
3
4#[repr(u32)]
5#[derive(Copy, Clone, Debug)]
6pub enum QueryKind {
7    SamplesPassed = glow::SAMPLES_PASSED,
8    AnySamplesPassed = glow::ANY_SAMPLES_PASSED,
9}
10
11#[derive(Debug)]
12pub enum QueryResult {
13    SamplesPassed(u32),
14    AnySamplesPassed(bool),
15}
16
17pub trait Query: Downcast + Debug {
18    fn begin(&self, kind: QueryKind);
19    fn end(&self);
20    fn try_get_result(&self) -> Option<QueryResult>;
21}