📝 Name Windows beside Linux and macOS in the window and OS docs [ci skip]

The swapchain, the window's presenter, the display's sink and the window
system's extensions present on Windows too, through SDL's Win32 surface
(os/windows.rs's WINDOW_SURFACE_EXTENSIONS), but their docs said "either OS"
or named Linux and macOS alone. rust-toolchain.toml still named the Metal
platform, deleted on 11-07. caps.rs's table gave a host's naming of its
device by Metal's registry ID (open_device, a handshake) as the reason for
the stand-in; no host names its device so now, and the reason that holds is
that Metal's core count and driver sizes for that GPU are found by that ID.
Comments and docs only.
This commit is contained in:
Anees Iqbal committed 2026-11-18 14:56:42 -08:00
1 parent 5709b8a198
commit aa28476e9d
10 files changed
+35 -34

No files matched your search

+1 -1
View File
@@ -24,7 +24,7 @@ log.workspace = true
# The call recorder's blob hashes (`recorder::format`), SHA-256 as the replay format names them.
sha2.workspace = true
# A display window's swapchain (`swapchain.rs`) and the window system's extensions
# (`os/wsi.rs`), through ash, on either OS.
# (`os/wsi.rs`), through ash, on Linux, Windows and macOS.
ash.workspace = true
# On macOS the OS services are this crate's own (`os/macos.rs`): threads, clocks, Mach VM, the
+1 -1
View File
@@ -34,7 +34,7 @@
//!
//! | answer | stand-in | why not the runtime's or a fact |
//! |---|---|---|
//! | `registryID` of the runtime's system default device | Metal's system default device's, asked at run time on macOS ([`crate::os::default_registry_id`]; `0x10000043f` on the M3 Max) | the runtime's is folded from the device UUID, which MoltenVK fills with the vendor and device IDs alone (`0x0902061a6b100000` on the M3 Max), and a host names its device by Metal's (`open_device`, the handshake); another device, and a host where Metal has none, answer the runtime's |
//! | `registryID` of the runtime's system default device | Metal's system default device's, asked at run time on macOS ([`crate::os::default_registry_id`]; `0x10000043f` on the M3 Max) | the runtime's is folded from the device UUID, which MoltenVK fills with the vendor and device IDs alone (`0x0902061a6b100000` on the M3 Max), and the core count and driver sizes Metal answers for that GPU are found by Metal's (`gpu_core_count`, `identity::driver_sizes`); another device, and a host where Metal has none, answer the runtime's |
//! | `supportsFamily:` of Apple5 to Apple10, -1009 | yes, yes, yes, yes, yes, no, no | the runtime claims a family only where every row of Apple's table is exact, and claims none on MoltenVK. **Pending support** (below): what a family promises that the runtime refuses dies at its selector |
//! | `supportsExtendedXR10Formats` | yes | **pending support** (below): the runtime makes textures of the XR10 formats (550 to 555), in heaps too, and of format 84 (plane 1's view format of the two-plane XR10 textures, 550 and 551), reads and writes them in kernels, samples them in 2D and gathers 552 to 555 as floats, unswizzled and under the four swizzles of the texture or a view the tests read through (`rgbx`'s `XR_SWIZZLES`, which move, repeat, drop and replace channels; no other swizzle is measured), as Metal does on the M3 (`rgbx`'s `extended_range_textures_read_as_metals`), reads 552 and 554 through an argument buffer as Metal does, and samples and gathers them so as Metal does through a sampler of one filter and no mip filter, samples other textures through one as Metal does while one lives that the command does not reach, and dies, naming the runtime's refusal, at a command that samples or gathers one it reaches (names or makes resident) through an argument buffer otherwise (a sampler of a mip filter among them), or reads an `_sRGB` twin or a swizzled one so (`rgbx`'s `extended_range_textures_an_argument_buffer_holds_read_as_metals`), copies 550's and 551's colour words to and from the CPU and buffers as Metal does, and renders to one where the fragment function writes all of its channels or none. It blends a `half4` output, and a `float4` one, into one in the shader, by its model of Metal's blend, and reads one it blends by framebuffer fetch. The model holds without fast math, each product rounded to `half` as Metal's compiler does there (`encode_render`'s `float4_extended_range_blends_are_metals_here` and `half4_extended_range_blends_are_metals_without_fast_math` compare `float4` and `half4` outputs with Metal across passes, into each linear form and each `_sRGB` twin), and under fast math for an output each of whose lanes is a load; where Metal may round the blend's source otherwise, under fast math an output the function computes, or a module that names no math mode, the render state announces the output's kind: for a `half4` one `extended-range-blend-source`, which the device relays for its reach ([`crate::answer`]): a computed `half4` misses Metal's by one code of a channel at 13 of the 66 blended configurations the tests draw, at 130 to 483 of 4096 texels each (`half4_extended_range_blends_announce_their_source`); for a `float4` one `extended-range-float-blend-source`, which the runtime announces at each draw that binds the state's variant, where the draw dies (the state is made), where a computed `float4` missed Metal's at 17 of the 66 (`float4_extended_range_blends_die_naming_their_source`). The tests draw the 22 blends of `XR_BLENDS` into each linear form and the 8 of `XR_SRGB_BLENDS` into each `_sRGB` twin; without fast math, where the runtime also draws a blend by the blend colour under a difference, and any blend into an `_sRGB` twin, they draw those of `XR_CONSTANT_DIFFERENCES` into each form and the rest of `XR_BLENDS` into each twin as Metal does (`extended_range_blends_drawn_without_fast_math_alone_are_metals`), and into each form and twin six blends under write masks of one colour channel and of two as Metal does, and a function's two outputs into colour 0, unblended, storing the first output's values as Metal does, the second nowhere, and without fast math under six blends of the second source as Metal does (`extended_range_masked_blends_and_two_output_states_are_metals`); the others are not measured. A draw that blends into or reads an attachment an earlier draw of its pass may have written, or that its `Clear` left between two codes, reads the `half` values the runtime holds through a pass of one sample and one layer without a rasterization-rate map, as Metal's tile memory does, announcing nothing, so its blends in one pass are Metal's (`encode_render`'s `float4_extended_range_blends_are_metals_here`, `a_blend_onto_a_clear_between_codes_is_metals`); otherwise (another such pass, after an execution of render commands or a tile dispatch, where an earlier render pass instance of the pass wrote the attachment, or a draw whose pipeline has no shadowed form) it sees the codes the runtime stored, where Metal holds the value through the pass, which the runtime announces and the device relays (`extended-range-blends-stored-codes`). A multisampled render target of one resolves by the runtime's own resolve of its codes after the pass: `BGR10_XR`'s and `BGRA10_XR`'s colour as Metal's, an alpha within a code and an `_sRGB` twin's colour within 7 (`encode_render`'s `drawn_extended_range_samples_resolve_as_metals`), which the runtime announces and the device relays (`extended-range-resolve`). The runtime refuses the rest, which dies at its selector; among it a render target of one unblended under a mask of some of its channels, blended under fast math under a mask of one colour channel, by a factor of the second source, by the blend colour under a difference, into an `_sRGB` form beyond the Line truncated
//! | `supports_float16_bcubic_filtering` | yes | undocumented, unmeasured |
+4 -3
View File
@@ -15,10 +15,11 @@
//! - **A method not built yet** dies at its selector ([`answer::unbuilt`]), so a run's death line
//! names the first selector the platform lacks; none answers a made-up value.
//! - **The OS services** ([`os`]): on macOS this crate's over the system's (threads, clocks, Mach
//! VM, the autorelease pool, IOSurface and the Objective-C message layer), beside MoltenVK; on Linux this crate's own, over the host's
//! Vulkan driver.
//! VM, the autorelease pool, IOSurface and the Objective-C message layer), beside MoltenVK; on
//! Linux and on Windows this crate's own, over the host's Vulkan driver.
//! - **A display window's swapchain** (`swapchain`), on the runtime's own device: the window's
//! render thread presents the display's frames through it, with no copy, on either OS.
//! render thread presents the display's frames through it, with no copy, on Linux, Windows
//! and macOS.
// The proof that the runtime's types are `Send` and `Sync` nests deeper than rustc's default
// limit of 128 (E0275): in the library itself, where a `Debug` derive asks it of an encoder's
+12 -12
View File
@@ -4,20 +4,20 @@
//!
//! The instance takes `VK_KHR_surface` and each of the OS's surface extensions the loader lists
//! (`crate::os`'s `WINDOW_SURFACE_EXTENSIONS`: on Linux Wayland's, XCB's and Xlib's, so a window
//! opens over whichever the window library picks; on macOS `VK_EXT_metal_surface`, over a
//! window's `CAMetalLayer`). The device takes `VK_KHR_swapchain`, and the OS's own device
//! extensions (`WINDOW_DEVICE_EXTENSIONS`: on macOS `VK_EXT_metal_objects`, whose export of an
//! image's Metal texture fetches its drawable, `crate::swapchain`), where every physical device
//! lists them: the runtime refuses a device whose extension it asked for is missing, and which
//! physical device it picks is its own choice, so a host where one of them lacks one gets no
//! swapchain at all, and its windows say so and stay closed, rather than losing the device. The
//! physical devices' lists are read through an instance of the probe's own, made with no
//! extensions but `VK_KHR_portability_enumeration` where the loader lists it, as the runtime
//! opens over whichever the window library picks; on Windows `VK_KHR_win32_surface`; on macOS
//! `VK_EXT_metal_surface`, over a window's `CAMetalLayer`). The device takes `VK_KHR_swapchain`,
//! and the OS's own device extensions (`WINDOW_DEVICE_EXTENSIONS`: on macOS `VK_EXT_metal_objects`,
//! whose export of an image's Metal texture fetches its drawable, `crate::swapchain`), where every
//! physical device lists them: the runtime refuses a device whose extension it asked for is
//! missing, and which physical device it picks is its own choice, so a host where one of them lacks
//! one gets no swapchain at all, and its windows say so and stay closed, rather than losing the
//! device. The physical devices' lists are read through an instance of the probe's own, made with
//! no extensions but `VK_KHR_portability_enumeration` where the loader lists it, as the runtime
//! makes its own (so the probe lists MoltenVK, a portability driver, as the runtime does), and
//! destroyed at once. The loader is the one the runtime opens (`crate::os`'s `open_loader`). The
//! probe runs once a process ([`HOST`]), and the library's choice of device reads what it read
//! of each physical device too ([`seen_devices`], [`crate::device_choice`]), so the choice costs
//! no instance of its own.
//! probe runs once a process ([`HOST`]), and the library's choice of device reads what it read of
//! each physical device too ([`seen_devices`], [`crate::device_choice`]), so the choice costs no
//! instance of its own.
//!
//! **Present fences.** The device also takes `VK_KHR_swapchain_maintenance1` (or, where a device
//! lists only that, `VK_EXT_swapchain_maintenance1`), and the instance its surface counterpart
+6 -5
View File
@@ -1,9 +1,10 @@
//! A display window's swapchain on the runtime's own device: what the window's render thread
//! presents through, on either OS. No copy: each of the swapchain's images is a runtime texture
//! (`new_texture_with_vk_image`), which the display's present pass renders into in a command
//! buffer of the frame queue, and the image is presented from the swapchain's own presenting
//! queue. The surface is the window's: on Linux SDL's (Wayland's or X11's), on macOS one over
//! the window's `CAMetalLayer` (`VK_EXT_metal_surface`), whose drawables MoltenVK's images are.
//! presents through, on Linux, Windows and macOS. No copy: each of the swapchain's images is a
//! runtime texture (`new_texture_with_vk_image`), which the display's present pass renders into in
//! a command buffer of the frame queue, and the image is presented from the swapchain's own
//! presenting queue. The surface is the window's: on Linux SDL's (Wayland's or X11's), on Windows
//! SDL's (`VK_KHR_win32_surface`), on macOS one over the window's `CAMetalLayer`
//! (`VK_EXT_metal_surface`), whose drawables MoltenVK's images are.
//!
//! **The presenting queue.** Each swapchain presents on a queue made for presenting
//! (`Device::new_command_queue_for_presenting`), whose `VkQueue` the runtime reserves apart from
+3 -3
View File
@@ -1,7 +1,7 @@
//! What a window's render thread presents through: the display's sink presents the frames itself,
//! over a Vulkan swapchain of the window's surface, on either OS. The sink makes a [`Presenter`]
//! over the window ([`VulkanTarget`]: SDL's window on Linux, the window's `CAMetalLayer` on macOS),
//! and the render thread has it draw each frame ([`Presenting`]).
//! over a Vulkan swapchain of the window's surface, on Linux, Windows and macOS. The sink makes a
//! [`Presenter`] over the window ([`VulkanTarget`]: SDL's window on Linux and Windows, the window's
//! `CAMetalLayer` on macOS), and the render thread has it draw each frame ([`Presenting`]).
//!
//! **The presenter's life.** At its first draw the render thread asks the sink for a presenter;
//! without one (no swapchain on this host) it never draws, and the window stays empty. Each draw
+3 -3
View File
@@ -1,6 +1,6 @@
//! A graphics display's window sink on the Vulkan platform, on either OS: [`VulkanScanoutSink`]
//! makes a presenter over a swapchain of the window's surface, and each draw blits the scanout
//! into the swapchain's next image (its usage takes transfers) and presents it.
//! A graphics display's window sink on the Vulkan platform, on Linux, Windows and macOS:
//! [`VulkanScanoutSink`] makes a presenter over a swapchain of the window's surface, and each draw
//! blits the scanout into the swapchain's next image (its usage takes transfers) and presents it.
//!
//! **The compositor's GPU.** Where the host's compositor composites the window on another GPU
//! than the runtime's (the window system names it: [`VulkanTarget::compositor_device`]), every
+1 -1
View File
@@ -166,7 +166,7 @@ reims-vgpu-graphics, reims-vgpu-video-* <- reims-vgpu <- reims-vgpu-c <- Q
gestures' phases), `policy` (the modes and density offered for a host screen) and `env` (the
`REIMS_VGPU_WINDOW_*` variables). `handle.rs` is the `Window` the device holds, `Send` and `Sync`
with no AppKit object in it; `present.rs` is `FrameSink`, the trait it draws through, and the
presenter both OSes' render threads draw through.
presenter every OS's render threads draw through.
- **On macOS** (`native/macos/`) the AppKit side runs on the main thread (7.3), its state in
statics only that thread reaches (`main_thread::MainOnly`): `main_thread.rs` posts work to the
main run loop in order, and the application's start, alone; `app.rs` is the application, its
+2 -2
View File
@@ -26,8 +26,8 @@ repeats the ones code cites.
code. Code some OSes share and others do not
goes in a module of its own that the index picks for those OSes (the
window crate's `native/sdl_thread/`, SDL on the library's own thread, for
Linux and Windows). It sits in the crates both OSes share: no crate is one
OS's. A file both OSes share is the exception, where
Linux and Windows). It sits in the crates the OSes share: no crate is one
OS's. A file the OSes share is the exception, where
splitting cannot be avoided, and keeps its `cfg`s to a few whole items;
index files that pick modules are exempt.
- **The Vulkan platform** answers as Metal does through metal2vulkan's
+2 -3
View File
@@ -2,9 +2,8 @@
# Cargo's profile rustflags), the toolchain metal2vulkan's builds use too. The date is fixed so
# every host runs one rustc, clippy and rustfmt; moving it is a deliberate step, with a full check.
# The crates' `rust-version` (Cargo.toml) stays the stable floor clippy's `incompatible_msrv` checks
# the standard library's items against. D32: the Metal platform is aarch64-apple-darwin alone; the
# Vulkan platform builds for aarch64 and x86-64, on macOS and Linux, and x86_64-unknown-linux-gnu is
# what ships on Linux (built there, type-checked from the Mac by `cargo xtask check`),
# the standard library's items against. x86_64-unknown-linux-gnu is what ships on Linux (built
# there, type-checked from the Mac by `cargo xtask check`),
# x86_64-pc-windows-gnullvm what ships on Windows (built there under MSYS2 CLANG64, type-checked
# from the Mac and Linux by `cargo xtask check`), and aarch64-apple-darwin what runs on a Mac.
# x86_64-apple-darwin runs core's tests under Rosetta, with the x86-64 guest's pages and