pub struct GBufferStats {Show 13 fields
pub total_memory_bytes: u64,
pub per_attachment_memory: HashMap<String, u64>,
pub width: u32,
pub height: u32,
pub color_attachment_count: u32,
pub fill_rate_mpix_per_sec: f64,
pub bandwidth_gb_per_write: f64,
pub resize_count: u32,
pub clears_this_frame: u32,
pub geometry_draw_calls: u32,
pub avg_triangles_per_draw: u32,
pub overdraw_ratio: f32,
pub bytes_per_frame: u64,
}Expand description
Statistics about G-Buffer memory usage and performance.
Fields§
§total_memory_bytes: u64Total GPU memory used by all attachments (bytes).
per_attachment_memory: HashMap<String, u64>Memory per attachment.
width: u32Current resolution.
height: u32§color_attachment_count: u32Number of color attachments.
fill_rate_mpix_per_sec: f64Estimated fill rate in megapixels per second (set externally).
bandwidth_gb_per_write: f64Estimated bandwidth usage in GB/s for a single full G-Buffer write.
resize_count: u32Number of times the G-Buffer has been resized.
clears_this_frame: u32Number of times the G-Buffer has been cleared this frame.
geometry_draw_calls: u32Number of draw calls that wrote to the G-Buffer this frame.
avg_triangles_per_draw: u32Average triangle count per draw call (estimated).
overdraw_ratio: f32Overdraw ratio (pixels written / total pixels). 1.0 = no overdraw.
bytes_per_frame: u64Total bytes written per frame (approx).
Implementations§
Source§impl GBufferStats
impl GBufferStats
pub fn new() -> Self
Sourcepub fn from_layout(layout: &GBufferLayout, width: u32, height: u32) -> Self
pub fn from_layout(layout: &GBufferLayout, width: u32, height: u32) -> Self
Calculate stats from a layout and resolution.
Sourcepub fn update_frame(&mut self, draw_calls: u32, overdraw: f32)
pub fn update_frame(&mut self, draw_calls: u32, overdraw: f32)
Update frame-specific stats.
Trait Implementations§
Source§impl Clone for GBufferStats
impl Clone for GBufferStats
Source§fn clone(&self) -> GBufferStats
fn clone(&self) -> GBufferStats
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GBufferStats
impl Debug for GBufferStats
Auto Trait Implementations§
impl Freeze for GBufferStats
impl RefUnwindSafe for GBufferStats
impl Send for GBufferStats
impl Sync for GBufferStats
impl Unpin for GBufferStats
impl UnsafeUnpin for GBufferStats
impl UnwindSafe for GBufferStats
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.