Use RenderContext for TextureManager::new

This commit is contained in:
Sijmen 2021-06-01 17:54:53 +02:00
parent bfa7a48483
commit 4af16fb974
Signed by: vijfhoek
GPG key ID: 82D05C89B28B0DAE

View file

@ -125,9 +125,11 @@ pub struct TextureManager {
}
impl TextureManager {
pub fn new(render_device: &wgpu::Device) -> Self {
pub fn new(render_context: &RenderContext) -> Self {
let bind_group_layout =
render_device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor {
render_context
.device
.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor {
label: Some("texture_bind_group_layout"),
entries: &[
wgpu::BindGroupLayoutEntry {
@ -152,7 +154,9 @@ impl TextureManager {
],
});
let sampler = render_device.create_sampler(&wgpu::SamplerDescriptor {
let sampler = render_context
.device
.create_sampler(&wgpu::SamplerDescriptor {
address_mode_u: wgpu::AddressMode::Repeat,
address_mode_v: wgpu::AddressMode::Repeat,
address_mode_w: wgpu::AddressMode::Repeat,