Metal resolves into a texture of any usage. Probe resolve_texture_usage.m (M3 Max, macOS 27.0.1,
job m3-max-59768) showed this, and a guest's walk met it twice: a map view's 900x900 pass
resolves a 4-sample BGRA8Unorm_sRGB colour, beside a 4-sample Depth32Float_Stencil8 and with
every load Load, into a 1-sample BGRA8Unorm_sRGB Shared texture of ShaderRead usage. The runtime
refused that as RenderPassKind::ResolveUsage and skipped the pass, so the view missed its drawing.
Form A, as ruled: every one-sample colour texture (2D, 2D array or cube) whose image is optimal
now takes the colour attachment usage on every device where its format renders, whatever
Metal's usage. A pass resolves into it by Vulkan's own resolve, as into a render target.
- texture.rs plan() sets Plan::resolves for a one-sample colour texture of those types made
without the attachment usage, where the format's features hold the attachment
(plan.supported). The optimal image's format query runs with the usage. Where it refuses the
image or the image does not fit the texture's samples, extent and layers, the image is made
without the usage. Plan::image_usage gives image_info and the texture's Image the usage. Such
a texture is no render target: it takes no feedback usage or shadow for attachment reads,
and a pass that renders into it is still Refusal::AttachmentUsage.
- A linear image in place over a buffer (linear_usage, check_over, linear_layout, the plane
checks) is unchanged. It takes no attachment usage for a resolve alone, so it stays in place
and is never copied to gain one, and a resolve into it stays ResolveUsage. A texture over a
buffer in its own optimal image (the counted copy) takes the usage like any optimal image, and
the pass's write of it is copied back as a render target's is.
- pass.rs resolve() reads the image's own usage (TextureObject::resolve_attachment) in place of
Metal's. ResolveUsage remains for an image with no attachment usage: a depth or stencil
texture (macgaps measured no depth format), a colour texture of another type or of a format
the device's optimal image does not render, and a linear image in place.
Memory: macgaps' table (jobs m3-max-59774, m3-max-59775, m3-max-59776) shows the worst pair on
the Radeon 780M (RADV): a 1920x1080 one-level RGBA8Unorm image grows from 8,847,360 to 8,896,512
bytes (1.0056). On the RX 550 the same image reaches 8,882,200. The Iris Xe, RTX 3090, llvmpipe
and KosmicKrisp show no growth.
Docs: RenderPassKind::ResolveUsage, resolve_texture's doc and the runtime README's resolve
paragraph and known gap say what is true now. docs/REFUSALS.md regenerated (the attachment
view's function is now attachment_view). No public signature moved.
Tests (lavapipe): every_device_resolves_into_a_texture_of_shader_read_usage is the probe's case.
A 4-sample BGRA8Unorm_sRGB attachment cleared to (0.25, 0.5, 0.75, 1) is resolved into a
1-sample Shared texture of ShaderRead usage, and of ShaderRead | ShaderWrite. The image has the
attachment usage, Metrics::resolves rises by one, and every texel reads the clear colour within
one code. A depth resolve into a ShaderRead Depth32Float texture is ResolveUsage. A ShaderRead
texture over a Shared buffer in place has no attachment usage, and a resolve into it is
ResolveUsage. every_device_resolves_a_loaded_pass_beside_depth_and_stencil_into_a_shader_read_texture
is the walk's shape: 900x900, colour beside a 4-sample Depth32Float_Stencil8, every load Load,
resolving what an earlier pass cleared. The old check that ShaderRead and ShaderRead |
ShaderWrite resolves are ResolveUsage is gone, since both now resolve.