A sampler state's lodBias moves the level on a device presenting an Intel or AMD Mac
What: vk_sampler set mipLodBias 0 whatever the descriptor's lodBias, read as Apple9 (an Apple M3 Max samples every level as with no bias). The consumer's oracle (an AMD Radeon Pro 5300M and an Intel UHD 630) shows a Mac with an Intel or AMD GPU adds the bias to every sample's level, explicit (level()), gradient and implicit alike, clamped into the texture's levels. So a guest presenting such a Mac read the wrong level. How: the translator's SamplerUse gains lod_bias (with_lod_bias), a fact the consumer states per bind from the Mac it presents; a plan's uses leave it unset. With it, vk_sampler's mipLodBias is device_lod_bias's (new, public): the bias within the device's maxSamplerLodBias, the limit of its sign past it (Capped), none for a NaN (NotANumber) and none where the portability subset withholds samplerMipLodBias (Withheld). Without it, 0 as before; a use of texel coordinates takes none either way. Vulkan adds mipLodBias to an explicit level too, so the device's sampler gives the measured answer within the limit. The runtime keeps the resolved MacClass in DeviceProperties (one place, presented_class; lossless_compression derives from it). A state's taken descriptor keeps its bias on IntelOrAmd (-0 as 0, NaN as none) and 0 on AppleSilicon, and SamplerState::bound_use adds the flag at every bind: a slot's, an argument sampler's, a heap set's array element, and the attached-levels reckoning of the levels a draw samples. A bias the device cannot take as it is is announced once as the state is made, the new precision kind CappedLodBias (capped-lod-bias), never fatal. Docs: vk_sampler, SamplerDescriptor::lod_bias, the runtime sampler module, MacClass and DeviceOptions::mac_class name the answer per class; API.md's catalogue lists capped-lod-bias and the Mac-class section the bias. The api_surface and api_signatures tables take DeviceLodBias, device_lod_bias, SamplerUse::lod_bias/with_lod_bias and the new kind. REFUSALS.md regenerated unchanged. Tests: metal::sampler's a_lod_bias_is_the_device_s_where_the_use_adds_it (every committed profile, both uses) and the_device_lod_bias_is_the_bias_within_what_the_device_takes (exact, capped finite and infinite, NaN, withheld on MoltenVK's profile); tests::sampler takes the bias per class; the lane's lod_bias tests a device presenting each class: AppleSilicon reads the unbiased level (kernel explicit, fragment implicit), IntelOrAmd the biased one, the capped ones announced once (CAPPED_LOD_BIAS, listed as a site). Evidence: potluck jobs in the report to main.
This commit is contained in:
1 parent
954bd4771e
commit
0709ba7ba5
16 files changed
+708
-99
No files matched your search
+20
@@ -2717,6 +2717,18 @@ bound.
|
||||
samples with 32. Cost: it filters with the device's largest anisotropy (16 on every venue
|
||||
measured), where Metal filters with 32: a footprint more than 16 times as long as it is wide reads
|
||||
a coarser level than Metal's (one level coarser at 32 to 1 and beyond).
|
||||
- `metal2vulkan-degrade-capped-lod-bias` (precision). `CappedLodBias`: A sampler state whose
|
||||
`lodBias` the GPU of the Mac the device presents adds to every sample's level
|
||||
(`MacClass::IntelOrAmd`), where the device's samplers cannot add it as it is
|
||||
(`metal::sampler::DeviceLodBias`): past the device's `maxSamplerLodBias` (an infinity included),
|
||||
a NaN, or a bias other than 0 where the device's portability subset withholds
|
||||
`samplerMipLodBias` (MoltenVK). Announced once, where the device makes the state; the payload
|
||||
names the bias and what the device's samplers add for it. Cost: its samples add the device's
|
||||
limit of the bias's sign where the bias is past it, and no bias where the device withholds it or
|
||||
the bias is NaN: a sample whose level with what the device adds has not reached the last level
|
||||
the sampler reads (a positive bias) or level 0 (a negative one) reads another level than Metal's,
|
||||
which adds the whole bias and then clamps the level into the texture's levels; what Metal samples
|
||||
for a NaN bias is not measured.
|
||||
- `metal2vulkan-degrade-not-mipmapped-anisotropic-sampler` (precision).
|
||||
`NotMipmappedAnisotropicSampler`: A sampler state with anisotropy, no mip filter (`NotMipmapped`)
|
||||
and different minification and magnification filters, on a device that samples through Metal's
|
||||
@@ -5006,6 +5018,14 @@ each item named states the rule in full.
|
||||
anything from the render area alone (a level past the first, a slice past the first, 4x
|
||||
multisampled) to the whole texture (plain 4-, 8- and 16-byte color formats). Metal guarantees
|
||||
nothing past the render area, and the runtime gives the 5300M's answer.
|
||||
- a sampler state's `lodBias` is added to every sample's level, an explicit level's, a
|
||||
gradient's and an implicit one's alike, the sum clamped into the texture's levels, as an AMD
|
||||
Radeon Pro 5300M and an Intel UHD 630 sample it (the consumer's probe): the state's binds
|
||||
hand the device its bias as `mipLodBias` (`SamplerUse::lod_bias`), which Vulkan adds to an
|
||||
explicit level too. A bias past the device's `maxSamplerLodBias` adds that limit, and a NaN,
|
||||
or any bias where the device's portability subset withholds `samplerMipLodBias` (MoltenVK),
|
||||
none, announced (`capped-lod-bias`). A device that presents an Apple silicon Mac samples
|
||||
every level as with no bias, as an Apple M3 Max (Apple9) does.
|
||||
|
||||
Metal leaves a new texture's contents undefined, and zero and a released texture's texels are
|
||||
both what such a Mac reads, so this trades no accuracy and no `DevicePolicy` switch fills the
|
||||
|
||||
Reference in new issue
Block a user