742e320bee2d8bcb7c833ddd7d3c1e1a2b8b7244
14
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
b8f7b5a7f9 |
Answer minimumLinearTextureAlignmentForPixelFormat: from the device's images, per format
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) |
||
|
|
f118559e73 |
Binary archives: add mesh pipelines, and load a metallib as an empty archive
Two of the conformance ledger's every-venue rows, both of the runtime's archive surface. binary-archive-mesh-adder: BinaryArchive had three of Metal's four pipeline adders. add_mesh_render_pipeline_functions (addMeshRenderPipelineFunctionsWithDescriptor:error:) makes the state as new_mesh_render_pipeline_state does with the default options, answering its error, and keeps the descriptor's archive key (metal_key::mesh). A mesh creation compiles its pipeline whole and looks in no archive, so the add keeps no compiled artifact. Under FAIL_ON_BINARY_ARCHIVE_MISS a mesh creation, which every listed archive missed before, now hits an archive holding its key (binary_archive::mesh_missing). Which fields Metal keys a mesh pipeline by is not measured, so the key holds every field of the descriptor: a creation hits only an add of an equal descriptor, where Metal's hits too, and one differing in a field Metal does not key misses here where Metal's may hit, as the add's and new_mesh_render_pipeline_state's docs say. binary-archive-sources: Metal takes a metallib as an archive (the case's M3 Max recording); container::read refused it as no archive of ours. A file that parses as a metallib (Library::from_metallib, container tags alone) now loads as an archive holding nothing: its lookups miss and it serializes as one nothing was added to. What Metal's archive of a metallib holds is not measured; new_binary_archive's doc says so. The suite's runtime side answers the mesh add through the new call. The ledger's two rows go; api_signatures.tsv gains the method, and METAL-COVERAGE (coverage.tsv) marks the call implemented. Tests: unit tests the_mesh_key_holds_every_field_and_a_lookup_names_the_mesh_function and a_metallib_loads_as_an_archive_holding_nothing; lane test a_mesh_add_is_found_by_its_own_descriptor_and_a_metallib_loads_as_an_ empty_archive (hit, miss before the add and for another color format, the add's error, serialize and reload, the metallib's miss and nothing to serialize). Verified by those tests and a whole lavapipe conformance replay (see the tip report). (cherry picked from commit adadb73f7c2063341e1dbe54fe887a5ceddf86b7) |
||
|
|
570df3cc95 |
Answer maxArgumentBufferSamplerCount from the set-1 sampler array and the sampler limit
What: `DeviceProperties::max_argument_buffer_sampler_count`, Metal's `maxArgumentBufferSamplerCount`: one fewer than the smaller of a set-1 sampler array's elements and the device's maxSamplerAllocationCount (element 0 of the array, and one of the device's samplers, are the neutral sampler's; each state the array holds takes an element and a sampler of its own). The array's elements are a new public translator function, `pipeline::heap_sampler_capacity`: link's heap capacity for a heap of one sampler array with set 0 counting no sampler, the least of the handle table's 65536 entries (TABLE_CAPACITY) and the two update-after-bind sampler limits, 0 where a function cannot read a set-1 sampler array (the layout's features or the module's non-uniform sampled-image indexing). Link's heap_capacity now reads the same limit table (`heap_limits`) and arithmetic (`room`), and heap_set the same layout-feature check (`heap_layout_lacks`), so the sizing and the answer cannot drift. The runtime's `Device::sampler_array` (each state's creation-time check) now calls it too: it was the two update-after-bind limits without the handle table's reach, 500000 on MoltenVK where link makes 65536 elements, so a state past 65535 was not announced as it was made. The device's SamplerCount and the answer read one value, the identity's maxSamplerAllocationCount. Why: the consumer computed it as the least of the two update-after-bind sampler limits and maxSamplerAllocationCount; that misses the handle table's reach (500000 against our 65535 on the M3) and the neutral's element (32768 against 32767 on lavapipe, 4000 against 3999 on NVIDIA). Metal on the M3 Max (macOS 27.0.1) answers 500000 (a Swift query of MTLCreateSystemDefaultDevice, potluck job m3-max-2496), recorded in the field's docs and docs/API.md's accepted differences. Tests: engine_handles::an_argument_sampler_array_has_the_heap_sampler_capacity (link's array equals the function on every committed profile, follows lowered limits, 0 without the features); capabilities:: argument_buffer_samplers_are_one_fewer_than_the_array_and_the_sampler_limit (every committed profile, pinned venue values); the device test argument_sampler_count (the kernel's array, the device's count, the driver's limit and the answer agree; elements-1 states unannounced, the next announced). Verification follows in the branch's report. (cherry picked from commit 7a2b84f15a1dde81e35cbc0b9367962e54d8332f) |
||
|
|
c305c66a7f |
Give mesh pipelines Metal's descriptor limits, state queries and refusals
The mesh descriptor gains Metal's fields, with Metal's defaults:
max_total_threads_per_{object,mesh}_threadgroup, max_total_threadgroups_per_mesh_grid,
the two threadgroup-size-is-multiple-of-width flags, payload_memory_length,
max_vertex_amplification_count (1) and required_threads_per_{object,mesh}_threadgroup. The
descriptor key reads every one.
A compiled mesh pipeline carries MeshPipelineMetalInfo (RenderPipeline::mesh_info), and the
runtime's RenderPipelineState answers Metal's five mesh queries from it, plus the two required
sizes. Each thread limit is the descriptor's maximum, else the function's
[[max_total_threads_per_threadgroup(n)]], else 1024, held to the device's own limit where that is
lower: the task and mesh stages' invocations with VK_EXT_mesh_shader, the compute stage's where
both stages run as compute work. The widths are 32. The grid limit is the descriptor's, else the
object function's [[max_total_threadgroups_per_mesh_grid(n)]], else 2^20, held to
maxMeshWorkGroupTotalCount where mesh functions run natively. Without an object function the
object stage answers 0 and 0, where the M3 Max answers 3 and 32 (an accepted difference).
DeviceProfile::emulates_mesh_shading says how a device runs the stages, so a consumer no longer
copies the compile layer's rule; with the getters, no separate per-stage query is needed.
What Metal refuses is refused as Metal's rule, DescriptorError::MeshPipeline with a
MeshPipelineProblem, measured on the M3 Max (mesh_pipeline_limits.m, plain and under
MTL_DEBUG_LAYER): a required size with an axis of 0, past 1024 threads or past its stage's
maximum, or for an object stage without an object function (process ends); a maximum past 1024,
a function maximum other than the descriptor's, a mesh stage's required size of other threads
than its maximum, and a payload past 16384 bytes (creation errors, codes 3 and 2). An
amplification count of 0 is VertexAmplificationCount, as a render pipeline's; one above 1, which
Metal makes, is NotImplemented(VertexAmplification), recorded in FAST-PATHS' known gaps.
payloadMemoryLength widens the object and mesh functions' payload arena past the declared type
(LoweringInputs::object_payload now reaches the object stage too); an object stage compiled on
its own without it is NeedsInput(ObjectPayload). SEMANTICS_VERSION 1971 and
ARTIFACT_FORMAT_VERSION 488 for that and the new artifact field; the runtime's warm record
format 4 for the descriptor's fields.
Docs: the new_mesh_render_pipeline_state doc now says how each device runs mesh stages, and
what it refuses; API.md's accepted differences gain the mesh pipeline rows. api_signatures
blessed (it also records RuntimeFact::PartialObjectThreadgroups from the partial-threadgroup
commit), api_surface lists MeshPipelineMetalInfo and MeshPipelineProblem, REFUSALS.md,
METAL-COVERAGE.md and CONFORMANCE-COVERAGE.md regenerated.
Tests: engine_mesh's a_mesh_pipeline_answers_metals_mesh_queries_within_the_device and
a_mesh_descriptor_metal_refuses_is_refused_as_its_rule over every committed mesh and
emulating profile; the validation lane's
a_mesh_state_answers_metals_queries_and_refuses_what_metal_refuses on a device. Not yet built:
the next steps are the M3, lavapipe and RTX 5080 runs.
(cherry picked from commit d6934967fad363ca2185c49935204141f253b416)
|
||
|
|
61a9508e92 |
Build visibilityResultType: Accumulate takes a pass's results into the buffer's words
RenderPassDescriptor gains visibility_result_type (MTLVisibilityResultType: Reset, the default and today's behaviour, and Accumulate). Under Accumulate no query result is copied over its offset's word: every query of an offset, the first one too, is copied into the upload region the continuations already use, and the crate-owned combine takes them into the word as the buffer holds it. The combine already loaded the destination word as its accumulator, so Accumulate is the first query becoming one more source. A `Boolean` word ORs the device's results in; a `Counting` word is summed in through a new table mode of the combine, into the word's low 32 bits alone, wrapping there, its high 32 bits kept (ContinuedResult::low_half / in_low_half). That last part is what the M3 Max answered when recorded: 0xffff_fff8 plus 16 samples writes 8, and 0xffff_ffff_ffff_fff8 plus 16 writes 0xffff_ffff_0000_0008. A plain 64-bit sum was divergent there. An offset set with no draw after it keeps its word, because a query with no draw adds 0. Where a no-copy buffer's bytes start off a multiple of 8, so the results land in an upload region, the words are now copied into that region before the combine (Landing::inward). Reset records exactly what it did before. Conformance: RenderPass gains visibility_type (typed()), and words() appends it only where it is not Reset, so existing fingerprints read as before. Both sides set it. There are four new visibility cases, recorded on the M3 Max (macOS 27.0.1): visibility-counting-accumulate (two command buffers; words 100/5/7/0xffff_fff8/u64::MAX-7), visibility-counting-accumulate-one-command-buffer (two passes in one command buffer, read once), visibility-counting-accumulate-revisit, and visibility-boolean-accumulate (words 0/2/3 under covering and non-covering draws, an offset set with no draw, then a second command buffer). The family's acts key states the type, and a joined shape adds a command-buffer input. Cost and timing records for the new cases are not written here. Lane tests (runtime_lane): accumulated_counts_add_to_the_words, accumulated_booleans_or_into_the_words, and host_bytes::accumulated_visibility_results_land_where_their_bytes_lie. Unit tests: the combine's accumulated_counts_are_summed_into_the_low_half, its plan's table mode, and the type's raw values. Coverage: coverage.tsv marks MTLRenderPassDescriptor.visibilityResultType implemented (its unused "visibility" group is removed), and METAL-COVERAGE.md is regenerated. MTLVisibilityResultType joins the enum table, so metal_enumerators.tsv and CONFORMANCE-COVERAGE.md are regenerated. The API signatures are re-blessed. REFUSALS.md is regenerated: VisibilityResultType::from_raw is one more UndefinedValue site. The regeneration also picks up two bind/graphics.rs sites the committed file was missing. The degrade docs (landed results, Boolean) state Accumulate. Verified on the M3 Max under MoltenVK 1.4.2: - The 52 visibility-touching lane tests pass: visibility, host_bytes, depth_never, amplified_draws, degrade_notices and the framebuffer_fetch split pass. - The visibility family's replay is all announced (no divergence), after the low-half change. - Negative control with Accumulate forced to Reset: all three Accumulate lane tests fail, and all four new cases replay divergent. - Negative control with no inward copy: the landing test fails at 4 bytes past a page (2 read 0, 100 read 16). - Before the low-half change, visibility-counting-accumulate replayed divergent at words 3 and 4. - The combine's low-half test fails on the interpreter without the high-half select ([8, 1] for [8, 0]). clippy (plain and --cfg m2v_gpu), rustdoc and scripts/api-docs are clean. SEMANTICS_VERSION: no translated shader changes, but the owned combine module's words do (main's call). RUNTIME_VERSION and the runtime-sources pin are not touched here. (cherry picked from commit 1c172968ad6492cebcae2a568fc99e90565d4d11) (cherry picked from commit 9f47ebcf006920f7561a16a77f77e422de7201c1) |
||
|
|
81441ca877 |
Regenerate the surfaces for pull-model interpolation
- RUNTIME_VERSION 1719: the runtime answers supportsPullModelInterpolation and refuses a draw reading an interpolant at a sample at custom positions. - scripts/metal-coverage/coverage.tsv: supportsPullModelInterpolation implemented (DeviceProperties::supports_pull_model_interpolation); docs/METAL-COVERAGE.md and docs/CONFORMANCE-COVERAGE.md regenerated. - docs/REFUSALS.md regenerated: feature::PullModelInterpolation and gap::InterpolateAtSampleWithPositions (reach rows in reach.tsv). - crates/metal2vulkan/tests/api_signatures.tsv blessed: additions only but Query::ALL's length (8 to 9) and value. - crates/metal2vulkan-runtime/README.md: the query and what differs. - runtime-sources pin recomputed (pin-compute.py). Verified: refusal_surface.py --check, signatures.py --check, metal-coverage --check and conformance-coverage --check all current. (cherry picked from commit 2dcbbf39b6e5caeb3e87079d7f2f36540ceb0dd0) |
||
|
|
ceb666187a |
Answer Metal's supports32BitMSAA from the device's own textures
The runtime had no answer for supports32BitMSAA (METAL-COVERAGE listed it missing), so the consumer passed None through. Metal's answer promises a multisample texture of each 32-bit integer format and the resolve of each 32-bit float one; the M3 Max, a Radeon Pro 5300M and a UHD 630 all answer 1. What the runtime did before was read first: a multisample texture of each of the nine formats is planned as any texture is (image_plan), within the device's limits for the image (vkGetPhysicalDeviceImageFormatProperties2), and refused as a count its format lacks; draws and texture2d_ms reads of it, the float formats' AVERAGE resolves (Metal's own on MoltenVK, device-rounded-resolve elsewhere) and the refusal of an integer resolve (ResolveFormat, as Metal stops it) were all in place. The render pipeline, sample planes and interleave all take a format's own counts beside framebufferIntegerColorSampleCounts. Nothing was wrong; the query was missing. Device::supports_32bit_msaa answers yes where the device makes every texture and resolve the answer promises, each probed exactly as pixel_format_capabilities probes a capability (the probe closure of families::formats::answers is now a function both share): the texture sample counts hold 4, a 2D multisample RenderTarget|ShaderRead texture of each of the nine formats is made at every count above 1 the textures take, and each float format resolves (its Resolve capability). A device method, as supports_family is, because it reads the device's per-format limits: Vulkan floors an integer format at framebufferIntegerColorSampleCounts, one sample on RADV and lavapipe, while their 32-bit integer formats each take 1 to 8 (1, 4, 8 on lavapipe), as the venue profiles' captured per-format counts state. Tests: - runtime tests::msaa_32bit: every committed profile pinned, with the limits it states (a venue profile's own per-format color attachment counts, else Vulkan's floors). Yes on every venue (moltenvk-m3, both 780M RADV, both gate lavapipe, the ANV and NVIDIA ones) and on the Intel and NVIDIA profiles whose floors cover the counts; no on amd-rdna2/rdna3-radv, lavapipe, lunarg-desktop-baseline-2023, swiftshader and vk12-floor (R32Uint at the lowest count, naming FramebufferIntegerColorSampleCount), and roadmap-2022 (no 4 samples). A yes agrees with each format's Msaa and float Resolve capabilities; the rule needs 4 and every count, and a missing resolve texture says so. A negative control that probes 4 samples alone fails two of them. - validation runtime_lane::msaa_32bit (--cfg m2v_gpu): the answer is what the device makes; R32Uint and RGBA32Uint targets at 2 and 4 drawn at sample rate hold every bit, read back through texture2d_ms<uint> (Metal: every channel as written); an RG32Float 4-sample target keeps its samples and resolves to the probe's Metal texels, exact where the driver's average is Metal's; an RGBA32Uint resolve is refused. Verified: runtime tests msaa_32bit, families and capabilities, the metal_coverage and runtime-sources pin tests; on the M3 Max (MoltenVK 1.4.2, macOS 27.0.1) through the Mac GPU lock, runtime_lane msaa_32bit, families and capabilities 7/7: supports32BitMSAA true, counts [2, 4], nothing refused, 0 integer channels differ, 32 of 32 resolved channels as Metal's, device-rounded-resolve not announced. clippy with all features and with --cfg m2v_gpu, rustdoc -D warnings, refusal_surface --check (no refusal moved), api-signatures (one method added), METAL-COVERAGE and CONFORMANCE-COVERAGE regenerated (the item now implemented, not yet exercised by the suite). RUNTIME_VERSION 1718 (a new answer); runtime sources re-pinned. (cherry picked from commit 2376157b3bf7bf99221579f42a795ef351b8144c) |
||
|
|
9d783a4e3a |
Run the emulation's wrapped indirect object grids, reporting Metal's wrapped grid
Content: the tree of `development` at f976f1035d, unchanged. |
||
|
|
b0b61ac179 |
Time a fault that later failing encoders follow as Metal's GPU reaches them
The steps this packet landed as, in order: - Stop a running predicated loop at the GPU's recovery from a fault or a hang - Resolve multisampled extended-range targets by Metal's measured rules - Run the emulation's indirect mesh draws with an object function Content: the tree of `development` at 60cf488339, unchanged. |
||
|
|
1d494932f7 |
Clear the object-grid lane's targets to zero before reading them as drawn nothing
The steps this packet landed as, in order: - Run any object grid Metal runs, in pieces within the task stage's limits - Upload a folded object draw's fold when it launches nothing too - Run an unfolded object stage's direct grid as Metal does when its threads wrap - Bump the semantics, artifact format and runtime versions for the seventh stack - Pin the runtime sources of the seventh stack - Bless the golden hash tables over the seventh stack Content: the tree of `development` at a6f6b269ad, unchanged. |
||
|
|
54e399ca25 |
Draw indirect mesh grids as Metal does, through an arguments pass on mesh-shader devices
The steps this packet landed as, in order: - Regenerate the refusal surface after the indirect mesh draws - Read the task limits through the profile's public limits in the mesh draws lane - Name VK_EXT_post_depth_coverage in the candidate's enable list - Re-bless the opened chains, and let a late depth test behind an imageblock writer link - Withhold the mesh shader extension's features with it in the mesh lane Content: the tree of `development` at 3e1d7fbbe1, unchanged. |
||
|
|
787d92fdc2 |
Answer a heap texture's allocatedSize from the place that holds it
The steps this packet landed as, in order: - Answer a kept heap texture requirement before asking the device's limits - Answer whether a command buffer or submission uses given objects, cloning nothing - List devices' registry IDs without making devices, and open one by its ID - Give a made pipeline state's reflection from its compile, after its creation - Enable optional device extensions where each device can, and say which it enabled - Let a caller vouch for its host pages' write permission, skipping the kernel's answer - Import read-only host pages from the caller's dma-buf source, and say whether a device takes shared pointers - Hold a texture of Apple's private usage 0x8 alone to what Metal does with it - Measure RADV 26.2.4 on the RX 7900 XTX: its pointer imports follow their address - Free a no-copy buffer's dma-buf imports before its keep-alive goes - Measure a file's pages mapped under a live RADV pointer import, a known gap - Let what waits for a dma-buf import's free go as its fields drop Content: the tree of `development` at 0a38130573, unchanged. |
||
|
|
0175289314 |
Batch the development-fast round: tessellation without tessellationShader, primitive ids, mesh tooling, color groups, the vk12 floor, runtime timing and teardown fixes
One commit of the 247 on development-fast (720ef1ce9a..9f46fdf80d), squashed at the user's request. Translator: - Tessellation on a device without tessellationShader: Metal's tessellator emitted as SPIR-V, a one-workgroup scan placing each patch's triangles in Metal's order, and the post-tessellation function as a plain vertex stage (EmulatedTessellationDraws; SEMANTICS 1739, ARTIFACT_FORMAT 419). - [[primitive_id]] on a device without geometry or tessellation shaders, as a flat varying the vertex function writes; indexed lists, lines and points drawn de-indexed (RuntimeGap::PrimitiveIdIndices). - Fragment functions of more colors than the device draws at once, compiled in color groups (PrecisionNote::ColorAttachmentGroups). - Object functions' threadgroup memory from the render encoder; a kernel's mesh draws from an indirect command buffer; mesh payload sizing. - The Vulkan 1.2 floor profile (vk12-floor) and the gates it needs; Metal 27.0.1 answers as the M3 Max. - Overflow tests in the runtime-built modules by the product's high word (NVIDIA's compiler fails the division form), guarded crate-wide by tests::owned_divisions. Runtime: - Color-group passes replayed per group over twin depth/stencil; snapshot and copy-back cost cuts. - Command buffers finish on the queue waiter that saw them; the waiter holds no device handle, so a program's drop after its wait is the device's last. - Every object an encoder was handed held until its command buffer completes; deallocator order and announcements. - Driver defects recorded and announced: ANV counts a visibility sample once per color output (visibility-count-per-color); MoltenVK fails pending work when memory that held a device-address buffer is freed, so freed memory waits for the work in flight (host-deallocator-delayed). - RenderCommandEncoder::set_object_threadgroup_memory_length; Visibility::counting(). Validation: mesh tooling (object, mesh and ICB-mesh cases on both executors), the authoring census closed, the queue storm judged in Metal's unit, load-robust exits and indirect-census bounds, and the golden hashes, printouts, fixture inventory and authored compile census blessed. Docs: FAST-PATHS.md trimmed to a ledger of what is true now; API.md's catalogue and accepted differences, REFUSALS.md and METAL-COVERAGE.md current. Verified on development-fast before the squash: the full suites on the RTX 5080, RTX 3090, RX 7900 XTX, Radeon 780M, Iris Xe, lavapipe and the M3 (MoltenVK and the Metal oracle), lint in every configuration, rustdoc, doc tests, packaging and public case qualification; the timing and teardown lanes x5 on every venue; the authoring-capability census 16656/16656 with 0 unresolved, the vk12-floor translation census at 6139 translated with the slowest row 794 ms and peak 126 MiB. The tree is development-fast's at 9f46fdf80d. |
||
|
|
13b279df1b |
Squash 11203 commits of translator, runtime, and validation work
Rolls up everything since
|