Update egui and wgpu
This commit is contained in:
+16
-13
@@ -231,22 +231,13 @@ impl Viewport {
|
||||
icon: Option<Arc<IconData>>,
|
||||
mut app: Box<dyn AppWindow>,
|
||||
) -> Self {
|
||||
let mut painter = egui_wgpu::winit::Painter::new(
|
||||
egui_wgpu::WgpuConfiguration {
|
||||
present_mode: wgpu::PresentMode::AutoNoVsync,
|
||||
..egui_wgpu::WgpuConfiguration::default()
|
||||
},
|
||||
1,
|
||||
None,
|
||||
false,
|
||||
true,
|
||||
);
|
||||
|
||||
let ctx = Context::default();
|
||||
let mut fonts = FontDefinitions::default();
|
||||
fonts.font_data.insert(
|
||||
"Selawik".into(),
|
||||
FontData::from_static(include_bytes!("../assets/selawik.ttf")),
|
||||
Arc::new(FontData::from_static(include_bytes!(
|
||||
"../assets/selawik.ttf"
|
||||
))),
|
||||
);
|
||||
fonts
|
||||
.families
|
||||
@@ -260,6 +251,18 @@ impl Viewport {
|
||||
});
|
||||
egui_extras::install_image_loaders(&ctx);
|
||||
|
||||
let mut painter = egui_wgpu::winit::Painter::new(
|
||||
ctx.clone(),
|
||||
egui_wgpu::WgpuConfiguration {
|
||||
present_mode: wgpu::PresentMode::AutoNoVsync,
|
||||
..egui_wgpu::WgpuConfiguration::default()
|
||||
},
|
||||
1,
|
||||
None,
|
||||
false,
|
||||
true,
|
||||
);
|
||||
|
||||
let mut info = ViewportInfo::default();
|
||||
let mut builder = app.initial_viewport();
|
||||
if let Some(icon) = icon {
|
||||
@@ -325,7 +328,7 @@ impl Viewport {
|
||||
[0.0, 0.0, 0.0, 0.0],
|
||||
&clipped_primitives,
|
||||
&output.textures_delta,
|
||||
false,
|
||||
vec![],
|
||||
);
|
||||
|
||||
self.state
|
||||
|
||||
@@ -63,13 +63,13 @@ impl GameScreen {
|
||||
layout: Some(&render_pipeline_layout),
|
||||
vertex: wgpu::VertexState {
|
||||
module: &shader,
|
||||
entry_point: "vs_main",
|
||||
entry_point: Some("vs_main"),
|
||||
buffers: &[],
|
||||
compilation_options: wgpu::PipelineCompilationOptions::default(),
|
||||
},
|
||||
fragment: Some(wgpu::FragmentState {
|
||||
module: &shader,
|
||||
entry_point,
|
||||
entry_point: Some(entry_point),
|
||||
targets: &[Some(wgpu::ColorTargetState {
|
||||
format: wgpu::TextureFormat::Bgra8Unorm,
|
||||
blend: Some(wgpu::BlendState::REPLACE),
|
||||
@@ -235,7 +235,7 @@ impl egui_wgpu::CallbackTrait for GameScreenCallback {
|
||||
.get(&self.display_mode)
|
||||
.unwrap_or_else(|| panic!("Unrecognized display mode {:?}", self.display_mode));
|
||||
render_pass.set_pipeline(pipeline);
|
||||
render_pass.set_bind_group(0, &self.bind_group, &[]);
|
||||
render_pass.set_bind_group(0, Some(self.bind_group.as_ref()), &[]);
|
||||
render_pass.set_viewport(x, y, w, h, 0.0, 1.0);
|
||||
render_pass.draw(0..6, 0..1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user