diff options
Diffstat (limited to 'src/wgpuctx')
| -rw-r--r-- | src/wgpuctx/mod.rs | 19 | ||||
| -rw-r--r-- | src/wgpuctx/pipeline.rs | 10 |
2 files changed, 17 insertions, 12 deletions
diff --git a/src/wgpuctx/mod.rs b/src/wgpuctx/mod.rs index 5f8e381..ef2abfc 100644 --- a/src/wgpuctx/mod.rs +++ b/src/wgpuctx/mod.rs @@ -1,5 +1,5 @@ use std::sync::Arc; -use wgpu::util::DeviceExt; +use wgpu::{CurrentSurfaceTexture, util::DeviceExt}; use winit::window::{Window}; use crate::texture::Texture; @@ -106,13 +106,17 @@ impl WgpuCtx pub fn prepare_surface( &mut self, view_descr: &wgpu::TextureViewDescriptor) - -> Result<wgpu::TextureView, wgpu::SurfaceError> + -> Result<wgpu::TextureView, CurrentSurfaceTexture> { - let texture = self.surface.get_current_texture()?; - let view = texture.texture.create_view(view_descr); - - self.surface_texture = Some(texture); - Ok(view) + let surface_texture = self.surface.get_current_texture(); + match surface_texture { + CurrentSurfaceTexture::Success(texture) => { + let view = texture.texture.create_view(view_descr); + self.surface_texture = Some(texture); + Ok(view) + }, + _ => Err(surface_texture) + } } pub fn create_encoder( @@ -277,6 +281,7 @@ impl<'encoder> RenderPassBuilder<'encoder> depth_stencil_attachment: None, occlusion_query_set: None, timestamp_writes: None, + multiview_mask: None, } ) } diff --git a/src/wgpuctx/pipeline.rs b/src/wgpuctx/pipeline.rs index d698ac4..460b71d 100644 --- a/src/wgpuctx/pipeline.rs +++ b/src/wgpuctx/pipeline.rs @@ -3,7 +3,7 @@ use crate::wgpuctx::WgpuCtx; pub struct RenderPipelineBuilder<'a> { - bind_groups: Vec<&'a wgpu::BindGroupLayout>, + bind_groups: Vec<Option<&'a wgpu::BindGroupLayout>>, shader: &'a wgpu::ShaderModule, vertex_entry_point: Option<&'static str>, @@ -44,7 +44,7 @@ impl<'a> RenderPipelineBuilder<'a> mut self, bindgroup: &'a wgpu::BindGroupLayout) -> Self { - self.bind_groups.push(bindgroup); + self.bind_groups.push(Some(bindgroup)); self } @@ -79,7 +79,7 @@ impl<'a> RenderPipelineBuilder<'a> let layout_descr = wgpu::PipelineLayoutDescriptor { label: label, bind_group_layouts: self.bind_groups.as_slice(), - push_constant_ranges: &[] + immediate_size: 0, }; let layout = wgpuctx.create_pipeline_layout(&layout_descr); @@ -134,8 +134,8 @@ impl<'a> RenderPipelineBuilder<'a> mask: !0, alpha_to_coverage_enabled: false }, - multiview: None, - cache: None + cache: None, + multiview_mask: None, } ) |
