diff options
| author | 2022-11-14 00:02:42 +0100 | |
|---|---|---|
| committer | 2022-11-16 09:24:16 +0100 | |
| commit | 33c3c0c0aa774bb7462e3c42aa04c591a66376a7 (patch) | |
| tree | 08ea046e6ac8a9ad43a7ef1f56256a056a4a4d6c /wgpu/src/buffer | |
| parent | 5b0dfcd0b0a9f25a3004dbc2cad3dea8220a76a1 (diff) | |
| download | iced-33c3c0c0aa774bb7462e3c42aa04c591a66376a7.tar.gz iced-33c3c0c0aa774bb7462e3c42aa04c591a66376a7.tar.bz2 iced-33c3c0c0aa774bb7462e3c42aa04c591a66376a7.zip | |
Group all solid triangles independently of color
Diffstat (limited to '')
| -rw-r--r-- | wgpu/src/buffer/dynamic.rs | 15 | ||||
| -rw-r--r-- | wgpu/src/buffer/static.rs | 2 | 
2 files changed, 15 insertions, 2 deletions
| 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<T: ShaderType> { +#[derive(Debug)] +pub struct Buffer<T: ShaderType> {      offsets: Vec<wgpu::DynamicOffset>,      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(_)"), +        } +    } +} diff --git a/wgpu/src/buffer/static.rs b/wgpu/src/buffer/static.rs index cf06790c..ef87422f 100644 --- a/wgpu/src/buffer/static.rs +++ b/wgpu/src/buffer/static.rs @@ -8,7 +8,7 @@ const DEFAULT_STATIC_BUFFER_COUNT: wgpu::BufferAddress = 128;  /// A generic buffer struct useful for items which have no alignment requirements  /// (e.g. Vertex, Index buffers) & no dynamic offsets.  #[derive(Debug)] -pub(crate) struct Buffer<T> { +pub struct Buffer<T> {      //stored sequentially per mesh iteration; refers to the offset index in the GPU buffer      offsets: Vec<wgpu::BufferAddress>,      label: &'static str, | 
