summaryrefslogtreecommitdiffstats
path: root/src/wgpuctx
diff options
context:
space:
mode:
authorJon Santmyer <jon@jonsantmyer.com>2026-05-12 19:01:27 -0400
committerJon Santmyer <jon@jonsantmyer.com>2026-05-12 19:01:27 -0400
commita0a3b3974cab754c10a1517d82762b99482970ce (patch)
tree8aeb0ca1e007bacecc8e12a263bd5aa321b8f69a /src/wgpuctx
parent7f63ec5c10eb7e8dd4edaabd1a6a437328911d39 (diff)
downloadsystemic4x-main.tar.gz
systemic4x-main.tar.bz2
systemic4x-main.zip
update packages to latest versionsHEADmain
Diffstat (limited to 'src/wgpuctx')
-rw-r--r--src/wgpuctx/mod.rs19
-rw-r--r--src/wgpuctx/pipeline.rs10
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,
}
)