2a36291a80950f9c60dba00e052d32d63b77e6b3
14
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
4f6dc912f3 |
Identity domains: a plain ulong texture slot is the RG32 element its resource ID names
A `ulong` texture slot that no `ulong` atomic updates is an `RG32` unsigned image whose two words
the shader joins and splits (`TexelClass::Uint64`), declared `Rg32ui` where it is a storage image
(`ulong_format`, under the floor's `shaderStorageImageExtendedFormats`). Under the identity domains
identity_class refused every `ulong` declaration, so such a kernel was
`Unsupported{IdentityDomains}` ("a type the identity arrays hold no element of"). It now admits it:
its class is the unsigned integer class of its shape, as its declared image is, and a storage
declaration of `Rg32ui` is the class `StorageFormatClass::Format(R32G32_UINT)`, whose variable is
the storage-image array's (set 1, binding 1, which every storage class aliases), as Metal binds
only an `RG32Uint` texture there. A slot a `ulong` atomic updates (an `R64ui` image) and an
argument buffer's `ulong` texture stay refused. The default domains are unchanged.
Docs: RESOURCE-ID.md's arrays name the `RG32Uint` storage class of a `ulong` texture; API.md's
identity forms name a `ulong` slot's reads and writes.
Test: engine_identity's ulong_texture_slots_are_rg32_elements_their_resource_ids_name: the owned
fixture unk_ulong_access (a sample-access and a read-access `texture2d<ulong>`, a write-access
`texture3d<ulong>`) under the identity domains on lavapipe, moltenvk-m3 and moltenvk-m3 without
robustImageAccess2: each passes L3, its classes are the sampled array's unsigned 2D class and the
storage array's 3D `R32G32_UINT` class, and on the CPU interpreter each of 20 threads reads its
elements' two words joined as `(v, 0, 0, 1)`, `(0, 0, 0, 1)` outside the textures, and writes the
sum's two words inside the texture alone.
SEMANTICS_VERSION 2246 -> 2247: a refusal becomes a module.
Evidence:
- The 9 public conformance cases on the plain ulong slot (unk_ulong_rw x7, unk_ulong_access
x2): before, at
|
||
|
|
841c6872ac |
Identity domains: a read through a sampler takes its border texels from the resource ID's word
MSL 4.1's read(sampler, coord[, offset][, lod]) of a texture slot, through a constexpr sampler
with a clamp_to_zero or clamp_to_border axis or through a runtime [[sampler(n)]], reads Metal's
border texel at an index outside the level. The default domains take the border texels from the
slot's BorderTexels specialization (RuntimeFact::BorderTexels); under the identity domains that was
state of the bound texture they did not source, so such a kernel was
Unsupported{IdentityDomains}. The border texels are bits 0-11 of the texture word
(TextureWord::BORDER_TEXELS, docs/RESOURCE-ID.md), already in the slot's pushed resource ID
(PushField::SlotGuestBase). Under the identity domains select_through now sets neither the slot's
border_texels nor the fact, and border_bits reads the word through emit::identity_id and masks
it, as the format's missing alpha is read. SlotPlan::identity_lowered and identity_unsourced drop
the border texels, which the identity domains now source. An argument buffer's texture read so
(its handle-table entry's border texels) is still refused. The default domains are unchanged.
Conformance (known-gaps-rt.tsv, runtime on lavapipe against the committed Metal answers): six
read-through rows translate and match, so their rows go: read-through-int exact;
read-through-half, -layers, -line, -read-write and -volume differ only by notices the suite
declares. read-through-volume reads through a runtime sampler of an opaque-black border, whose
sampler state the runtime notes on every device: the case now declares that notice
(replay::swizzled_border_notice) wherever it reads through such a sampler, as border_swizzles
does. The four plane rows (a8, r32f, rgba8, rgba8-swizzled) now make every pipeline up to
rt_heap_zero, an argument buffer's texture read through a border sampler, where they are still
refused; their rows move there.
Docs: RESOURCE-ID.md says a slot's read through a sampler takes its border texel from bits 0-11
of the word; API.md's identity forms name the read through a sampler (the paragraph's lines
reflowed); CONFORMANCE-COVERAGE.md re-derived for the six rows gone (REFUSALS.md re-derives
unchanged).
Test: engine_identity's a_read_through_a_sampler_takes_its_border_texels_from_the_word:
engine/kernel_read_through's rt_arg (a runtime sampler, offset (1, -1)) under the identity domains
on lavapipe, moltenvk-m3 and moltenvk-m3 without robustImageAccess2: L3, no specialization
constant but the dispatch's, no BorderTexels fact, and on the CPU interpreter, through a sampler
that clamps every axis to the border, each of R32Float, RGBA8Unorm, A8Unorm and RGBA8Unorm
swizzled (a, b, 0, r), under each border color, reads metal::sampler::border_texel's texel past
the right, left and top edges and the texel inside.
SEMANTICS_VERSION 2234, one above the previous commit's (main renumbers at landing): a refusal
becomes a module. The old runtime's render descriptor key changes with it, pinned at landing.
Verified (potluck; the jobs ran this diff on the previous commit's diff on development
|
||
|
|
2dd8ffce0d |
Identity domains: a texture atomic's slot is the R32 storage element its resource ID names
A texture atomic (atomic_fetch_*, atomic_exchange, atomic_compare_exchange_weak, atomic_load or
atomic_store on a texture1d, 1d_array, 2d, 2d_array or 3d of uint or int, access::read_write)
declares its slot R32ui or R32i, as Vulkan's image atomics require and as Metal requires an R32Uint
or R32Sint texture there. Under the identity domains identity_class refused every storage
declaration with a format, so such a kernel was Unsupported{IdentityDomains}. It now admits an
R32ui or R32i storage declaration as the class StorageFormatClass::Format(R32_UINT | R32_SINT),
whose variable is the storage-image array's (set 1, binding 1, which every storage class aliases;
no link or declaration change). The atomic's emission takes the element of that array at the
index the slot's pushed resource ID holds (emit::identity_id), as a read or write does; it took the
array variable itself before, which no path reached. The default domains are unchanged.
Still refused under the identity domains: ulong atomics, texture-buffer atomics and an argument
buffer's atomic texture.
The CPU interpreter models OpImageTexelPointer (unmodelled before): a pointer to a texel inside
its image (Root::Texel), through which an atomic reads and writes the texel's first component, as
an atomic of an R32ui / R32i image does. Robustness's atomic outside the image and one on an
unmapped texel stay unmodelled.
Conformance: swizzled-storage-atomics now makes its pipeline and meets the runtime's
Gap::SwizzledReadWrite at its first dispatch (case/RRRR/dispatch), where a read_write slot bound to
a swizzled texture is refused; its known-gaps-rt.tsv row moves there and says why: Metal's atomic
answers the texel unswizzled, but nothing yet says a slot's reads are atomics alone.
Docs: RESOURCE-ID.md's arrays name the R32Uint / R32Sint storage class of a texture atomic;
API.md's identity forms name a texture slot's atomics (the paragraph's lines reflowed);
CONFORMANCE-COVERAGE.md re-derived for the atomics row's reason (REFUSALS.md re-derives
unchanged).
Test: engine_identity's a_texture_atomic_is_the_r32_storage_element_its_resource_id_names: a
generated texture2d<uint, access::read_write> atomic_fetch_add under the identity domains on
lavapipe, moltenvk-m3 and moltenvk-m3 without robust image access; each passes L3, its one image
class is R32_UINT storage at set 1 binding 1, the guard's size query is there exactly where the
device lacks robust image access, and on the CPU interpreter each thread adds 5 to its texel of
element 2 (the one the pushed resource ID names), answers the texel it held, and no other element
changes.
SEMANTICS_VERSION 2233, one above development's (main renumbers at landing): a refusal becomes a
module. The old runtime's render descriptor key changes with it
(the_old_render_descriptor_key_keeps_its_value), pinned at landing.
Verified (potluck; the jobs ran this diff on development
|
||
|
|
d3d40dd31e |
Identity domains: an argument buffer's texture sampled through the argument buffer's own sampler
Under the identity domains, an argument buffer's sampler was refused. Its cubic test pushed the
execution status address ("an encoder value the function reads as ExecutionStatusAddress"), and
behind that was the form's own refusal ("an argument buffer's sampler"). The sampler's resource ID
is now its handle, read from the member's 8 bytes with no sampler table (access::handle,
emit_identity_sampler):
- Its index selects the element of the set-1 sampler array of its use. That is the array an
argument buffer's sampler already declares, at the same binding the slot samplers' identity
arrays use.
- The word's fields (pixel coordinates, the nearest-pixel test) come from the ID's high word
(sampler::emit::heap_sampler_field).
- The handle is a uvec2 wherever it is held (lowered_pointer, and word_repr for a member word).
A select's null operand is the nil ID.
Bad-ID guard: compare-and-select, index < 4,000 ? index : 0, so an index past the arrays samples
through element 0, the default sampler. I chose it over 4,096-element arrays with a 12-bit mask
because it is two instructions with no layout or floor change. The mask would need every array at
4,096 elements and every unowned element holding the default sampler, which the floor does not
state. pipeline::link::IDENTITY_SAMPLERS becomes pub(crate) for it.
No cubic test under the identity domains (sampler::select::cubic_reach returns early). The runtime
makes no sampler state of a cubic filter (Gap::CubicSampler), so no live ID's word carries bit 30.
The runtime README says so beside the gap, and docs/RESOURCE-ID.md says how the shader reads the
ID.
The conformance ledger's 32 rows refused only by the cubic mark now run through the runtime. On
lavapipe:
- 3 match: pixel-samplers-rgba16f-nearest-{border,edge,zero}.
- 5 are refused at case/encoder, Unavailable argument_encoder or argument_encoder_with_arguments:
the rt side has no argument encoder.
- 24 differ. In each, every source our side runs answers alike wherever Metal's do.
Their 32 rows become 192 rows scoped to llvmpipe, each naming its note and bound:
- pixel-downscales: pixel-sampler-scaling, 2/255.
- pixel-samplers linear: device-sampling.
- rgba8 nearest and subnormal: device-texel-conversion.
- the two nearest mirror norm sites: device-sampling, the device's mirror clamp to edge at
normalized coordinates, which a device test shows a slot's sampler and an argument buffer's
read alike.
docs/CONFORMANCE-COVERAGE.md is regenerated for the ledger (7,490 rows to 7,650).
pixel-samplers now declares the slot form's pixel-sampler-scaling on nearest states as well
(replay::pixel_sampler_scaling_notice): under the identity domains the slot's word is read at
dispatch, so the note is the operation's on any state.
SEMANTICS_VERSION 2231 (a placeholder for the landing to renumber).
Tests:
- engine_identity's
an_argument_buffers_sampler_samples_through_the_identity_arrays_by_its_resource_id covers
tail_argument_samplers' four kernels and tail_argument_cube_gradient on every profile: L3, set
0 empty, set 1 the identity layout, the bindings used, no sampler slot ID, constexpr index or
status address pushed, and no RuntimeFact::CubicArgumentSampler.
- metal2vulkan-runtime tests::argument_sampling (lavapipe, m2v_cpu_icd):
- argument_sampler_edges through a linear state reads the edge averages; through an ID of that
word with index 4,000 it reads element 0's nearest texels (the guard).
- every_device_samples_alike_through_an_argument_buffers_sampler_and_a_slots: one texture at
the pixel-samplers case's 800 normalized coordinates through one nearest state under clamp to
edge, to zero, to an opaque white border and mirror clamp to edge, bound at a slot and held in
an argument buffer; bit-equal.
- validation's an_argument_buffer_sampler_samples_its_member_texture compares the runtime's run
with Metal's texels, where it held the refusal.
Verified (potluck jobs; this commit's tree equals WIP 16c70bf88a on
|
||
|
|
b676eda182 |
rt: a colour render target takes an index, and a draw reads it as an attachment as it reads a shader-read one
Metal fetches any render target, and its header gives every texture a handle with no tie to usage (MTLTexture.h: gpuResourceID, "Handle of the GPU resource suitable for storing in an Argument Buffer"). rt took an index only for shader-read or shader-write usage, so a colour target made for rendering alone had no second element and every fetch from it was Gap::Draw(FetchedAttachment): guest 26's 4,792 refusals, all of that shape. - The index rule: shaders reach a texture made for shader reads or writes, or a colour render target (render-target usage of a pixel format with no depth or stencil), which takes an index exactly where it does (Refusal::TextureIndex), at every maker: new_texture and the heap, buffer and Managed makers, views, drawables and surface planes. A depth or stencil target made for neither is unchanged. - A colour render target not read takes what a shader-read one takes for attachment reads: the sampled usage, and the feedback usage where the image format query offers both beside its usage; the shadow on a device without the loop; neither where the query refuses them, and its draws that read it stay Gap::Draw. Its home stays the attachment layout, so a pass that does not read it records no move of it, and a fetching pass moves it home, feedback, home with the existing move code. - Only its second element is written: its sampled-texture element stays the null one, so a slot that binds it reads nil as before. place_texture takes the view its second element names in place of a flag. - A linear image in place over a buffer takes no sampled usage for a target shaders do not read. - The in-tree consumers take the rule: the replay player's texture class, the harness's and the conformance suite's rt side. rt's own tests make their unindexed colour targets with new_texture_for_views, and give indices where a test needs new_texture's path. - docs/RESOURCE-ID.md, the runtime README and Refusal::TextureIndex's doc say the rule; docs/REFUSALS.md is regenerated. Also rides along, from the planner, in the README's known gaps of memory blocks: a block freed before a submission used it waits on the block-maker thread for its bind, and a ring take that needs a new ring block can wait behind it. Verified: see the check job named in the landing. |
||
|
|
a47fc3e69d |
translator: an argument buffer's texture index is masked to the set-1 image arrays
What: under the identity domains (Device::from_queries' profile alone; Device::new never takes them, so its modules are unchanged), the handle of a texture whose resource ID an argument buffer holds is the ID's low word masked to its low 16 bits (IDENTITY_TEXTURES - 1, the two image arrays' 65,536 elements, a power of two the compiler checks): one OpBitwiseAnd a handle. A bad ID reads the element at index & 0xFFFF, never one outside the arrays. Nothing else changes: a slot's index is the runtime's own push (SlotGuestBase), a constexpr sampler's too (ConstexprSampler), and an argument buffer's sampler is not lowered under these domains, so the sampler arrays stay at 4,000 with no mask. docs/API.md, where that sampler's refusal is listed, and RESOURCE-ID.md say the change that first lowers one masks its index the same way. The new runtime's README records, among the known gaps of memory blocks, that a shader uses a buffer's gpuAddress unchecked, so a stale one can still fault the device. SEMANTICS_VERSION 2178: from_queries' translations of such a texture change (2177 is the unlanded float-array branch's). The feedback elements (index + 65,536 in the sampled array, where the device reads attachments): only a draw's push of a texture slot's index reaches them. The render encoder builds no useResource: or useHeap:, so no draw makes an argument buffer's texture resident, and Metal reads an argument buffer's texture only once it is resident; the mask keeps every argument-buffer index below 65,536 besides. So an argument-buffer texture that is also the pass's attachment is never offset to its feedback element: the shader reads element index, as before, a read Metal leaves undefined while the texture is not made resident (only the compute encoder has use_resource and use_heap). Why: the ID is the program's word, and an index past the arrays fetches a descriptor outside them. Verified: - Check 46942 (msi) at this change on |
||
|
|
fe23decd1b |
rt: a constexpr sampler's index under the owner rule, and an object released with work pending
A constexpr sampler's numbering is a placement like any other. Where a sampler state took the index from it, a later pipeline state that numbers the constexpr sampler there took nothing back: it sampled through the program's sampler. Now it places the constexpr sampler there again with every element it holds (Arrays::hold_samplers: under the grants' lock, the owner's additions where it still owns the index, else a placement), and the constexpr sampler keeps its elements' samplers to write them. The consumer chooses constexpr indices and keeps them from the program's sampler states while a state numbering one lives; rt does not check it (rt README, compute pipeline docs). An object the program released while a command buffer that used it is pending is displaced like a live one: a placement at its index takes it at once, and its teardown once the command buffer retires touches nothing it no longer owns (one owner compare for both). Nothing empties an element at the program's release: a committed command buffer still reads the object through its index, which Metal allows. The owner's teardown nulls it. RESOURCE-ID.md states the duty (no work in flight reads a displaced or released object through its ID) and what an element no object owns holds: every element is written at device creation, a null descriptor (nullDescriptor, on the floor) or the array's default sampler, and written back to that when its owner goes. The replay player gave constexpr samplers the lowest free sampler index, the range the stream's named sampler IDs come from, so a program's sampler state could take a constexpr sampler's index. It now gives them the highest free one, outside that sequence (Indices::highest; REPLAY-STREAM.md). Tests: - sampling::every_device_gives_a_constexpr_sampler_s_index_to_the_object_placed_there_last: a nearest sampler state over sample_up's linear constexpr sampler reads nearest; a later state numbering it takes the index back (linear, for both states); the sampler state's going touches nothing; the slot gauge counts the index once. - sampling::every_device_gives_a_released_object_s_index_to_the_next_at_once: a command buffer samples A through SA, signals and waits on the host; A and SA are released and B and SB made at their indices while it is pending (asserted); another queue reads B through SB; after the first command buffer retires, and A and SA with it, the index still reads B through SB. The writes are valid under UPDATE_UNUSED_WHILE_PENDING with PARTIALLY_BOUND (vkspec: "as long as they are not dynamically used by any shader invocations"): A's dispatch completed before its signal. - replay a_constexpr_sampler_takes_no_index_of_the_sequence. |
||
|
|
fd916e7f99 |
rt: an index has one owner, the texture or sampler placed there last
The consumer's program places a texture at an index a live texture of its own still holds, and releases the older one later (179 placements in one recorded stream, 92 in another). Metal takes it: the later texture takes the ID. rt refused it (IndexInUse). Now Grants keeps one owner word per held index (a HashMap per class, the word given at placement and never again on the device; no list of holders, no refcount, no second bitset). A placement at a granted index always succeeds and makes the placed object the owner; a release vacates the index and empties its elements only where the releaser still owns it, so a displaced object's going touches nothing. Placement and element writes happen under the grants lock in one step (Arrays::place_texture, place_samplers, add_samplers, vacate_texture, vacate_samplers), so the elements always belong to the owner. Where a placement displaces another object, a texture with no storage view writes its storage element null and a sampler writes the arrays it does not use back to their defaults, so nothing stale answers. The descriptor-slot gauge counts held indices: a displacing placement adds none. The same occupancy serves textures, sampler states and constexpr samplers. Constexpr samplers are kept by (index, state words), each with its owner word; a later pipeline state of the same words adds its arrays where the constexpr sampler still owns the index. Refusal::IndexInUse is deleted: nothing Metal refuses remains. A texture now takes its index after its image and views are made, so an index not granted is refused after the image is made and freed at once. The duty: no work in flight reads a displaced object through its ID, as Metal's. rt does not check it. RESOURCE-ID.md and the rt README state the rule and the duty. The harness takes the next index round each class's range (its workloads make far fewer objects than a range holds). The replay player keeps the object placed last per index: a named index an object holds is taken, and the earlier object's release leaves it; with no index free for a constexpr sampler it answers IndicesNotGranted past the range. Tests: grants' an_index_has_one_owner_the_object_placed_there_last (both classes); sampling::every_device_gives_an_index_to_the_texture_placed_there_last (a storage-capable D at 3, a sampled-only A over it, whose placement empties D's storage element: a write through 3 is dropped and D keeps its texels; B storage-capable over A, A dropped; sampling through 3 reads B, writing through 3 writes B; B dropped, sampling through D's ID reads zero; the slot gauge counts 3 once); the sampler states' test places a state over a live one; replay's indices test. REFUSALS.md regenerated, api_signatures loses IndexInUse. |
||
|
|
cc9ab54b86 |
rt: one texture index class, 1 to 65,535, and a storage array as long as the sampled
The consumer hands each guest process texture IDs from one pool (1 to 16,320) and places every texture at its own ID whatever its usage. rt split textures into two index classes by usage (StorageTexture 1..4095 with shader-write usage, Texture 4096..65535 without), so every named sampled-only texture below 4,096 and every storage-capable one above it was refused (IndicesNotGranted), where Metal takes them: 4,818 makings in one recorded stream and 5,707 in another. Now there is one texture class, IndexClass::Texture, 1 to 65,535, with one grant bitset and one occupancy; IndexClass::StorageTexture is deleted. Set 1's storage-image array (binding 1) is as long as the sampled-image array, 65,536 (floor::TEXTURES replaces SAMPLED_IMAGES and STORAGE_IMAGES). A texture with a storage view writes both elements at its index; any other writes its sampled element alone and its storage element stays null; a texture that goes writes both null. Samplers keep their class. Why every floor device holds it: Vulkan's Required Limits (vkspec 56.1, Table 75 and Table 76) give maxPerStageDescriptorUpdateAfterBindStorageImages, maxDescriptorSetUpdateAfterBindStorageImages, the two SampledImages limits, maxPerStageUpdateAfterBindResources and maxUpdateAfterBindDescriptorsInAllPools a minimum of 500,000 on a device that supports descriptorIndexing. The floor's own sums become 2 * 65,536 + maxColorAttachments (131,080 at 8) and 2 * 65,536 + 3 * 4,000 = 143,072, both below 500,000. Every lab capture (2080, 3090, XTX, 780M x2, HawkPoint, RX 550, Iris Xe, UHD 630, lavapipe) reports descriptorIndexing and 1,015,808 or more for each of the six limits. The floor's limit check stays the one gate: no query-chosen size, no second form. Translator: link.rs's identity set 1 sizes binding 1 by IDENTITY_TEXTURES (65,536), the same constant as binding 0, so rt's of_the_device check still matches it. Nothing else in the pipeline interface, binding plan or resource-ID decode assumes a storage index below 4,096: the identity handle is the low word (masked only of bit 31 where the alpha flag rides it), indexing each array's runtime-array variable. The identity domains are reached only from Device::from_queries' profile (rt sets PointerDomain::Identity; the old runtime never does), so Device::new's modules, refusals and notes do not change. SEMANTICS_VERSION 2173: the identity set 1 layout is a binding-plan fact that changed under unchanged keys. Consumers in the tree: the harness and the replay player grant and place every texture in the one class; the player reserves a texture ID in it. Docs: RESOURCE-ID.md's class table (nil, texture, sampler), the rt README (set 1, grants, textures, the fault paragraph, the floor's limits table), IndicesNotGranted's doc (an object at an index not granted, as well as a release) and IndexRange's basis; REFUSALS.md regenerated; api_signatures loses the variant. Tests: sampling::every_device_makes_a_texture_of_any_usage_at_any_index grants the whole texture range, makes a shader-read texture at 2 and a shader-write one at 5,000, and checks one sample_down dispatch against the CPU mean. arrays' fill-past-capacity fills every texture index (a storage texture at 1, views of it at 2..65,535, 128 made again). |
||
|
|
100b92d608 |
identity: constexpr samplers by a pushed index into set 1's sampler arrays
Under the identity domains a texture slot sampled through a constexpr sampler takes the sampler
from the set-1 sampler array of its use (binding 2 plain, 3 compare, 4 integer texture) at an
index the consumer pushes: PushField::ConstexprSampler(CombinedSampler), one u32. The consumer
makes the device sampler that the new public CombinedSampler::constexpr_sampler(profile)
describes, places it at an index of that array, and pushes the index. The index is a push word,
not a specialization constant: an index allocated at run time would key the driver's and the
pipeline cache's entries. Link's immutable sampler for the default domains now goes through the
same method, with the same result.
Under the identity domains every device sampler is normalized: a constexpr pixel sampler's
coordinate is scaled in the shader, as a runtime sampler's is, never handed to the device's
unnormalized sampler. A linear sample or gather through it records
PrecisionNote::PixelSamplerScaling, which is static. No address-mode-map variant applies there
(no binder picks a variant), so the sampler keeps its own modes and the slot records no
ConstexprSampled fact.
Still refused as Unsupported{IdentityDomains}: an argument buffer's sampler, arrays of samplers,
bicubic and anisotropy emulation. The refusal test now uses engine/a2_bicubic_weights.
Translation output changes only under the identity domains (Device::from_queries). Device::new
output is unchanged: golden_hashes_match_the_table passes at this tip (job m3-max-42192), with no
"changed under an unchanged key" and no "profile changed:" line.
Public surface: PushField::ConstexprSampler and CombinedSampler::constexpr_sampler are added
(api_signatures blessed); nothing is removed or changed.
SEMANTICS_VERSION 2162: identity-domain modules of constexpr-sampling kernels change.
ARTIFACT_FORMAT_VERSION 531: PushField gains a variant.
Verified:
- m3-max-42097 (msi), this change on
|
||
|
|
445b720f78 |
identity: texture slots sampled through runtime sampler slots from set 1's sampler arrays
Under the identity domains a kernel samples a texture slot through a runtime sampler slot. The
texture is its class's set-1 element at the index of its pushed gpuResourceID, as a read's is.
The sampler is the element of a set-1 sampler array at the index of the sampler slot's pushed
gpuResourceID (SlotGuestBase of the sampler slot), joined to the texture by OpSampledImage. The
array is picked by the use: binding 2 for a plain sample, 3 for a depth comparison, 4 for a
texture of an integer format; 4,000 SAMPLER descriptors each, PARTIALLY_BOUND |
UPDATE_AFTER_BIND | UPDATE_UNUSED_WHILE_PENDING, every stage, the same set 1 for every pipeline.
The sampler's word (pixel coordinates, a nearest pixel sampler) is read from the ID's high word,
so no specialization constant and no SamplerReduction, SamplerCoordinates, CubicSampler or
ConstantLanes fact remains; every precision note is static. An integer write to a storage slot
without a format saturates to the channel widths the consumer pushes
(PushField::TextureIntegerChannels, a u32), with no fact.
Still refused as Unsupported{IdentityDomains}: constexpr samplers (next change: a pushed index),
an argument buffer's sampler, arrays of samplers, bicubic and anisotropy emulation, a slot's
minimum level.
Translation output changes only under the identity domains (Device::from_queries). Device::new
output is unchanged: golden_hashes_match_the_table passes at this tip (job m3-max-42189), with no
"changed under an unchanged key" and no "profile changed:" line.
For the runtime's side (the planner's three facts):
a. The runtime must dedupe device samplers by create info across the three arrays' uses.
Exhausting maxSamplerAllocationCount (4,000 on the 2080, 3090 and UHD 630; 32,768 on
lavapipe; 65,536 on the others) must be a typed refusal, with a fill-past-capacity test.
b. The update-after-bind limits for 65,536 sampled images, 4,096 storage images and 12,000
samplers hold on all nine profiles (the smallest is lavapipe's 1,015,808); the floor must
check them by query.
c. The count of cubic sampler descriptors is asked of the replay lane; if any exist it goes back
to the planner before step 5 closes.
SEMANTICS_VERSION 2161: identity-domain modules of sampling kernels and integer writes change.
Verified:
- m3-max-42094 (msi), this change on
|
||
|
|
75b422338a |
identity: argument-buffer textures are the set-1 elements their resource IDs name
Under the identity domains an argument buffer's texture handle is the gpuResourceID its member
holds: the handle is the ID's index, the element of the class's set-1 array (0 is nil, the null
descriptor), with no handle table, no search and no descriptor. Where the shader checks a read
itself (no robustImageAccess2) the handle carries the word's missing-alpha bit (word bit 12) at
HANDLE_ALPHA_ONE, so the handle form is Lookup::Element or Lookup::Flagged{alpha} only.
The handle tables' variant forms are off under these domains (`texture::tabled`): reads of a
member of another numeric class, raw-texel decodes, storage conversions (red-blue, sRGB alias),
A8 alpha-in-red, unreadable-storage nulls, YCbCr write marks, and the HeapCrossClassNeutral,
HeapStorageReads and HeapResidency facts. A slot and a member of one class index one array, so
the class's volatility now merges the slots' uses with the groups'. The admission takes heap
groups whose declaration is their identity class with no plain, raw or cross classes; anything
else stays Unsupported{IdentityDomains}.
Translation output changes only under the identity domains: the default domains plan and emit
as before (no golden re-bless needed). SEMANTICS_VERSION 2153.
The test kernel `tex` gains an argument-buffer form (`texture_kernel(true)`), checked on
lavapipe, moltenvk-m3 and moltenvk-m3 without robustImageAccess2: same answers at the same
elements, set 0 empty, and the handle form Element or Flagged{alpha} as the profile checks reads.
Verified (this commit's tree, as 657e2245c2 on
|
||
|
|
fa52012831 |
identity: texture slots are the set-1 elements their pushed resource IDs name
Under the identity domains a kernel's texture slots now lower. A slot's gpuResourceID is pushed as its PushField::SlotGuestBase (the index in the low word, the word in the high one). Its texture is the element at that index of one of set 1's two fixed arrays: binding 0, SAMPLED_IMAGE x 65,536, and binding 1, STORAGE_IMAGE x 4,096. Each is partially bound, updated after binding and while unused elements are pending, and seen by every stage, with the same layout for every pipeline (BindingSource::IdentityArray). Each image class the kernel declares (shape, numeric type and depth comparison, sampled, or storage without a format) is a variable of its descriptor type's binding. The slot binds no descriptor and declares no specialization constant: - is_null_texture answers whether the index is 0. Nil needs nothing else in the shader, since element 0 of each array is a null descriptor (the device test of |
||
|
|
737ccbf81a |
metal: the resource ID word, its spec and test vectors
Under the identity binding domains a guest computes a texture's or sampler's gpuResourceID itself, with no round trip: the index the consumer grants in the low 32 bits and a word in the high 32 bits that is a pure function of the Metal descriptor. The guest's port needs the word specified and a file of vectors both sides check. - metal::resource_word::TextureWord::of(pixel_format, swizzle): bits 0-11 Metal's border texels after the swizzle (the existing border_texels rule), bit 12 the out-of-bounds alpha of a format without alpha, bits 16-31 the MTLPixelFormat raw value, so a texture's word is never 0. None for the placeholders and the formats the translator holds no texture of or only copies. - The sampler word is the existing SamplerWord, unchanged. - docs/RESOURCE-ID.md: the ID's layout, the index classes (0 nil; storage-capable textures 1 to 4,095, valid in both arrays; other textures 4,096 to 65,535; samplers 1 to 3,999), both words' bits and the level rule, and the vectors file. README's documentation table lists it. - crates/metal2vulkan/tests/resource_words.tsv: 392 vectors (every pixel format with a word under the default swizzle, each channel of seven formats from each other source, every sampler field through its values, the level clamps around the points the nearest level turns at, and one descriptor with every field changed). tests/resource_words.rs recomputes every line through the public API and holds the file equal to what the generator writes; an ignored test blesses it. - api_surface lists the new module; api_signatures regenerated. Verified: - msi job 40810 at the same tree: clippy -p metal2vulkan --all-targets --all-features -D warnings, rustdoc -D warnings, nextest 18 of 18 (resource_words, the TextureWord unit test, api_surface, api_signatures). - msi job 40811 at the same tree: clippy under --cfg m2v_gpu and --cfg m2v_cpu_icd. - msi job 40809: the bless test wrote the vectors; the combined sampler line (0x58f6ab53) and the A8Unorm and R8Unorm texture lines checked by hand against the bit tables. |