Skip to content

Commit 8054528

Browse files
committed
make tile buffers cloneable and size hasheable
1 parent 3a5fc70 commit 8054528

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

fidget-core/src/render/region.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ use nalgebra::{
4444
///
4545
/// If the render region is not square, then the shorter axis is clamped to ±1
4646
/// and the longer axis will exceed that value.
47-
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
47+
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
4848
pub struct RegionSize<const N: usize>
4949
where
5050
Const<N>: DimNameAdd<U1>,

fidget-wgpu/src/render3d.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,7 @@ pub struct Context {
790790
clear_ctx: ClearContext,
791791
}
792792

793+
#[derive(Clone)]
793794
struct TileBuffers<const N: usize> {
794795
tiles: wgpu::Buffer,
795796
zmin: wgpu::Buffer,
@@ -834,6 +835,7 @@ impl<const N: usize> TileBuffers<N> {
834835
}
835836

836837
/// Root tile buffers store strata-packed tile lists
838+
#[derive(Clone)]
837839
struct RootTileBuffers<const N: usize> {
838840
tiles: wgpu::Buffer,
839841
zmin: wgpu::Buffer,
@@ -887,6 +889,7 @@ impl<const N: usize> RootTileBuffers<N> {
887889
///
888890
/// This object is constructed by [`Context::shape`] and may only be used with
889891
/// that particular [`Context`].
892+
#[derive(Clone)]
890893
pub struct RenderShape {
891894
config_buf: wgpu::Buffer,
892895
axes: [u32; 3],
@@ -938,6 +941,7 @@ impl RenderShape {
938941
///
939942
/// This object is constructed by [`Context::buffers`] and may only be used with
940943
/// that particular [`Context`].
944+
#[derive(Clone)]
941945
pub struct Buffers {
942946
/// Image render size
943947
///

0 commit comments

Comments
 (0)