The query answered 16 for every format on every device, Metal's answer on an Apple GPU. On RADV a
texture at 16 never goes in place over host pages: its linear images lay rows at multiples of 256
and align their memory to 256, and DRM explicit layouts take only multiples of 256. A guest that
lays its buffers out by the answer then gets shadows where 256 would have given images in place.
The answer is now the device's, worked out lazily at a format's first query. The runtime makes
the images a 2D ShaderRead texture over host pages takes in place (in_place_unbound, the product's
own maker: the driver's linear image made for host allocations at the texture's pitch, else the
DRM_FORMAT_MOD_LINEAR one). It tries each power of two P from 16 to 4096, at widths of 1 to 1920
texels and 3 rows. The answer is the first P at which every width's image lies at
roundup(width * texel, P) and its memory alignment divides P. Each image is released and never
bound.
- The first answer is kept for the device's life.
- Each answer is recorded per driver, runtime and format in the shader cache's content directory.
- A device that imports no host pages, a format no P brings in place, and a failed probe all
answer Metal's 16.
- New counts: WorkCounts::linear_alignments_probed and linear_alignments_recalled.
Nothing new is refused. LINEAR_ALIGNMENT (16) stays the acceptance rule, and a texture under the
answer is made as before: an image in place where the device takes its layout, else the
announced shadow.
The query moves from DeviceProperties to Device
(Device::minimum_linear_texture_alignment_for_pixel_format), since it needs the device's images.
DeviceProperties::minimum_linear_texture_alignment_for_pixel_format is removed.
The private properties change as follows:
- deviceLinearTextureAlignmentBytes and linearTextureAlignmentBytes are the largest per-format
answer.
- The iosurface pair stays 16.
Supporting changes:
- texture/in_place_image.rs's in_place_unbound becomes pub(super).
- buffer_texture.rs's texel_bytes becomes pub(super).
- The unit tests now hold Metal's rule (capabilities::linear_alignment_rule).
Tests:
- A record test.
- runtime_lane::linear_alignments:
- Every format's answer is printed.
- A texture at the answer over host pages is in place wherever the check passed for reads.
- A 64-byte-row texture is made, as a shadow, where the answer is larger.
- A second device of the same driver reads the record and probes nothing.
Regenerated: api_signatures, docs/REFUSALS.md, docs/METAL-COVERAGE.md (coverage.tsv mapping).
Updated: RUNTIME-PORTING.md and the conformance device-queries docs.
Verified: python generators only, so far. The builds, unit tests and the lanes on the M3, RADV,
lavapipe and NVIDIA run next, and their results go with the tip.
(cherry picked from commit d1510f5588e9e5c3ace5acb1622dcd6570408040)