Document nonzero surface size requirement. (#4609)

This commit is contained in:
Kevin Reid authored and GitHub committed 2023-10-29 23:22:38 -04:00
1 parent 83c3fbc55c
commit e0341c52cf
2 files changed
+3 -2

No files matched your search

+2 -2
View File
@@ -4893,9 +4893,9 @@ pub struct SurfaceConfiguration<V> {
/// The texture format of the swap chain. The only formats that are guaranteed are
/// `Bgra8Unorm` and `Bgra8UnormSrgb`
pub format: TextureFormat,
/// Width of the swap chain. Must be the same size as the surface.
/// Width of the swap chain. Must be the same size as the surface, and nonzero.
pub width: u32,
/// Height of the swap chain. Must be the same size as the surface.
/// Height of the swap chain. Must be the same size as the surface, and nonzero.
pub height: u32,
/// Presentation mode of the swap chain. Fifo is the only mode guaranteed to be supported.
/// FifoRelaxed, Immediate, and Mailbox will crash if unsupported, while AutoVsync and
+1
View File
@@ -4939,6 +4939,7 @@ impl Surface {
///
/// - A old [`SurfaceTexture`] is still alive referencing an old surface.
/// - Texture format requested is unsupported on the surface.
/// - `config.width` or `config.height` is zero.
pub fn configure(&self, device: &Device, config: &SurfaceConfiguration) {
DynContext::surface_configure(
&*self.context,