From 33c3c0c0aa774bb7462e3c42aa04c591a66376a7 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 14 Nov 2022 00:02:42 +0100 Subject: Group all solid triangles independently of color --- wgpu/src/buffer/dynamic.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'wgpu/src/buffer/dynamic.rs') diff --git a/wgpu/src/buffer/dynamic.rs b/wgpu/src/buffer/dynamic.rs index 2a675d81..18be03dd 100644 --- a/wgpu/src/buffer/dynamic.rs +++ b/wgpu/src/buffer/dynamic.rs @@ -1,10 +1,13 @@ //! Utilities for uniform buffer operations. use encase::private::WriteInto; use encase::ShaderType; + +use std::fmt; use std::marker::PhantomData; /// A dynamic buffer is any type of buffer which does not have a static offset. -pub(crate) struct Buffer { +#[derive(Debug)] +pub struct Buffer { offsets: Vec, cpu: Internal, gpu: wgpu::Buffer, @@ -204,3 +207,13 @@ impl Internal { } } } + +impl fmt::Debug for Internal { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::Uniform(_) => write!(f, "Internal::Uniform(_)"), + #[cfg(not(target_arch = "wasm32"))] + Self::Storage(_) => write!(f, "Internal::Storage(_)"), + } + } +} -- cgit