Introduce explicit Viewport sharing (#96)

This commit is contained in:
Héctor Ramón 2024-05-08 16:17:58 +02:00 committed by GitHub
parent 5aed9e1477
commit b411ea71e7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 84 additions and 53 deletions

View file

@ -6,7 +6,7 @@ use lru::LruCache;
use rustc_hash::FxHasher;
use std::{collections::HashSet, hash::BuildHasherDefault, sync::Arc};
use wgpu::{
BindGroup, Buffer, DepthStencilState, Device, Extent3d, ImageCopyTexture, ImageDataLayout,
BindGroup, DepthStencilState, Device, Extent3d, ImageCopyTexture, ImageDataLayout,
MultisampleState, Origin3d, Queue, RenderPipeline, Texture, TextureAspect, TextureDescriptor,
TextureDimension, TextureFormat, TextureUsages, TextureView, TextureViewDescriptor,
};
@ -350,10 +350,6 @@ impl TextAtlas {
.get_or_create_pipeline(device, self.format, multisample, depth_stencil)
}
pub(crate) fn create_uniforms_bind_group(&self, device: &Device, buffer: &Buffer) -> BindGroup {
self.cache.create_uniforms_bind_group(device, buffer)
}
fn rebind(&mut self, device: &wgpu::Device) {
self.bind_group = self.cache.create_atlas_bind_group(
device,