Skip to content

Commit f743106

Browse files
authored
get presents_with_transaction from render_layer (#8716)
1 parent 0ac2da4 commit f743106

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

wgpu-hal/src/metal/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,9 +397,6 @@ pub struct Surface {
397397
render_layer: Mutex<metal::MetalLayer>,
398398
swapchain_format: RwLock<Option<wgt::TextureFormat>>,
399399
extent: RwLock<wgt::Extent3d>,
400-
// Useful for UI-intensive applications that are sensitive to
401-
// window resizing.
402-
pub present_with_transaction: bool,
403400
}
404401

405402
unsafe impl Send for Surface {}
@@ -409,6 +406,8 @@ unsafe impl Sync for Surface {}
409406
pub struct SurfaceTexture {
410407
texture: Texture,
411408
drawable: metal::MetalDrawable,
409+
// Useful for UI-intensive applications that are sensitive to
410+
// window resizing.
412411
present_with_transaction: bool,
413412
}
414413

wgpu-hal/src/metal/surface.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ impl super::Surface {
2828
render_layer: Mutex::new(layer),
2929
swapchain_format: RwLock::new(None),
3030
extent: RwLock::new(wgt::Extent3d::default()),
31-
present_with_transaction: false,
3231
}
3332
}
3433

@@ -168,7 +167,6 @@ impl crate::Surface for super::Surface {
168167
render_layer.set_device(&device_raw);
169168
render_layer.set_pixel_format(caps.map_format(config.format));
170169
render_layer.set_framebuffer_only(framebuffer_only);
171-
render_layer.set_presents_with_transaction(self.present_with_transaction);
172170
// opt-in to Metal EDR
173171
// EDR potentially more power used in display and more bandwidth, memory footprint.
174172
let wants_edr = config.format == wgt::TextureFormat::Rgba16Float;
@@ -224,7 +222,7 @@ impl crate::Surface for super::Surface {
224222
},
225223
},
226224
drawable,
227-
present_with_transaction: self.present_with_transaction,
225+
present_with_transaction: render_layer.presents_with_transaction(),
228226
};
229227

230228
Ok(Some(crate::AcquiredSurfaceTexture {

0 commit comments

Comments
 (0)