commit
378a13555d
3 changed files with 9 additions and 6 deletions
|
|
@ -39,6 +39,7 @@ pub fn main() {
|
|||
.request_adapter(&wgpu::RequestAdapterOptions {
|
||||
power_preference: wgpu::PowerPreference::HighPerformance,
|
||||
compatible_surface: Some(&surface),
|
||||
force_fallback_adapter: false,
|
||||
})
|
||||
.await
|
||||
.expect("Request adapter");
|
||||
|
|
@ -172,7 +173,7 @@ pub fn main() {
|
|||
resized = false;
|
||||
}
|
||||
|
||||
match surface.get_current_frame() {
|
||||
match surface.get_current_texture() {
|
||||
Ok(frame) => {
|
||||
let mut encoder = device.create_command_encoder(
|
||||
&wgpu::CommandEncoderDescriptor { label: None },
|
||||
|
|
@ -180,7 +181,7 @@ pub fn main() {
|
|||
|
||||
let program = state.program();
|
||||
|
||||
let view = frame.output.texture.create_view(&wgpu::TextureViewDescriptor::default());
|
||||
let view = frame.texture.create_view(&wgpu::TextureViewDescriptor::default());
|
||||
|
||||
{
|
||||
// We clear the frame
|
||||
|
|
@ -208,6 +209,7 @@ pub fn main() {
|
|||
// Then we submit the work
|
||||
staging_belt.finish();
|
||||
queue.submit(Some(encoder.finish()));
|
||||
frame.present();
|
||||
|
||||
// Update the mouse cursor
|
||||
window.set_cursor_icon(
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@ default_system_font = ["iced_graphics/font-source"]
|
|||
spirv = ["wgpu/spirv"]
|
||||
|
||||
[dependencies]
|
||||
wgpu = "0.10"
|
||||
wgpu_glyph = "0.14"
|
||||
wgpu = "0.11"
|
||||
wgpu_glyph = "0.15"
|
||||
glyph_brush = "0.7"
|
||||
raw-window-handle = "0.3"
|
||||
log = "0.4"
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ impl Compositor {
|
|||
wgpu::PowerPreference::HighPerformance
|
||||
},
|
||||
compatible_surface: compatible_surface.as_ref(),
|
||||
force_fallback_adapter: false,
|
||||
})
|
||||
.await?;
|
||||
|
||||
|
|
@ -141,7 +142,7 @@ impl iced_graphics::window::Compositor for Compositor {
|
|||
output: &<Self::Renderer as iced_native::Renderer>::Output,
|
||||
overlay: &[T],
|
||||
) -> Result<mouse::Interaction, iced_graphics::window::SurfaceError> {
|
||||
match surface.get_current_frame() {
|
||||
match surface.get_current_texture() {
|
||||
Ok(frame) => {
|
||||
let mut encoder = self.device.create_command_encoder(
|
||||
&wgpu::CommandEncoderDescriptor {
|
||||
|
|
@ -150,7 +151,6 @@ impl iced_graphics::window::Compositor for Compositor {
|
|||
);
|
||||
|
||||
let view = &frame
|
||||
.output
|
||||
.texture
|
||||
.create_view(&wgpu::TextureViewDescriptor::default());
|
||||
|
||||
|
|
@ -193,6 +193,7 @@ impl iced_graphics::window::Compositor for Compositor {
|
|||
// Submit work
|
||||
self.staging_belt.finish();
|
||||
self.queue.submit(Some(encoder.finish()));
|
||||
frame.present();
|
||||
|
||||
// Recall staging buffers
|
||||
self.local_pool
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue