File tree Expand file tree Collapse file tree
examples/integration_wgpu/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ pub fn main() {
3939 . request_adapter ( & wgpu:: RequestAdapterOptions {
4040 power_preference : wgpu:: PowerPreference :: HighPerformance ,
4141 compatible_surface : Some ( & surface) ,
42+ force_fallback_adapter : false ,
4243 } )
4344 . await
4445 . expect ( "Request adapter" ) ;
@@ -172,15 +173,15 @@ pub fn main() {
172173 resized = false ;
173174 }
174175
175- match surface. get_current_frame ( ) {
176+ match surface. get_current_texture ( ) {
176177 Ok ( frame) => {
177178 let mut encoder = device. create_command_encoder (
178179 & wgpu:: CommandEncoderDescriptor { label : None } ,
179180 ) ;
180181
181182 let program = state. program ( ) ;
182183
183- let view = frame. output . texture . create_view ( & wgpu:: TextureViewDescriptor :: default ( ) ) ;
184+ let view = frame. texture . create_view ( & wgpu:: TextureViewDescriptor :: default ( ) ) ;
184185
185186 {
186187 // We clear the frame
@@ -208,6 +209,7 @@ pub fn main() {
208209 // Then we submit the work
209210 staging_belt. finish ( ) ;
210211 queue. submit ( Some ( encoder. finish ( ) ) ) ;
212+ frame. present ( ) ;
211213
212214 // Update the mouse cursor
213215 window. set_cursor_icon (
Original file line number Diff line number Diff line change @@ -27,8 +27,8 @@ default_system_font = ["iced_graphics/font-source"]
2727spirv = [" wgpu/spirv" ]
2828
2929[dependencies ]
30- wgpu = " 0.10 "
31- wgpu_glyph = " 0.14 "
30+ wgpu = " 0.11 "
31+ wgpu_glyph = " 0.15 "
3232glyph_brush = " 0.7"
3333raw-window-handle = " 0.3"
3434log = " 0.4"
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ impl Compositor {
4040 wgpu:: PowerPreference :: HighPerformance
4141 } ,
4242 compatible_surface : compatible_surface. as_ref ( ) ,
43+ force_fallback_adapter : false ,
4344 } )
4445 . await ?;
4546
@@ -141,7 +142,7 @@ impl iced_graphics::window::Compositor for Compositor {
141142 output : & <Self :: Renderer as iced_native:: Renderer >:: Output ,
142143 overlay : & [ T ] ,
143144 ) -> Result < mouse:: Interaction , iced_graphics:: window:: SurfaceError > {
144- match surface. get_current_frame ( ) {
145+ match surface. get_current_texture ( ) {
145146 Ok ( frame) => {
146147 let mut encoder = self . device . create_command_encoder (
147148 & wgpu:: CommandEncoderDescriptor {
@@ -150,7 +151,6 @@ impl iced_graphics::window::Compositor for Compositor {
150151 ) ;
151152
152153 let view = & frame
153- . output
154154 . texture
155155 . create_view ( & wgpu:: TextureViewDescriptor :: default ( ) ) ;
156156
@@ -193,6 +193,7 @@ impl iced_graphics::window::Compositor for Compositor {
193193 // Submit work
194194 self . staging_belt . finish ( ) ;
195195 self . queue . submit ( Some ( encoder. finish ( ) ) ) ;
196+ frame. present ( ) ;
196197
197198 // Recall staging buffers
198199 self . local_pool
You can’t perform that action at this time.
0 commit comments