Identity domains: a bicubic sample of a 1D texture

The identity domains refused every function that samples a 1D texture through a bicubic
constexpr sampler ("a bicubic filter of a 1D texture", IdentityCause::SamplerState), though its
lowering reads nothing the identity domains do not source. It is the 2D sample's on one axis: the
same footprint (lower::sampler::bicubic::footprint_on, q = floor(256 (x - 1/2) + 1/2)), the
level-0 size by OpImageQuerySizeLod of the bound image (the slot's set-1 element), the taps by
OpImageFetch of that image, and the bound format's treatment from the slot's
PushField::BicubicTexels word (bicubic::format_bits, which takes no dimension), summed by the
module's Routine::Line, which the default domains already emit: the device's FMix of taps i and
i + 1 at the fraction k / 256, then the normalized formats' clamps. Metal filters a 1D texture
bilinearly over those two taps whatever its format (the module docs; the committed M3 observations
of the bcu_forms and bcx_rules cases). The runtime writes the field per slot from the bound
texture whatever its type, so it needs no change. The refusal and BICUBIC_LINE_FORM go.

The sample keeps PrecisionNote::BicubicFilterArithmetic. No new form, query or copy.

The fixture inventory's bcu_forms.ll and bcx_rules.ll rows move to ok on all 15 profiles (30
cells); their .air.ll twins move at the next M3 bless. docs/API.md, the runtime README (its bicubic
paragraph and the identity domains' known gaps) and IdentityCause::SamplerState's doc no longer
list the form. docs/REFUSALS.md regenerated: unchanged. No public item changes.

Test: tests::engine_identity::a_bicubic_kernel_reads_each_slots_format_treatment_from_its_pushed_field
(red at 74dd91398f).
This commit is contained in:
Anees Iqbal committed 2026-12-03 12:37:20 -08:00
1 parent 34d3c8d0c0
commit 94adea1c61
5 files changed
+16 -28

No files matched your search

+4 -7
View File
@@ -2685,16 +2685,15 @@ made, with no lock, and never rewritten for layouts.
`PixelFormatView` of a base of those, `ShaderWrite` and `RenderTarget`, for a view made with a
swizzle other than the identity and for every view of such a view (M3 Max, macOS 27.0.1,
`metal2vulkan-conformance/probes/swizzled_view_stores.m`).
- A kernel, a vertex function or a fragment function samples a 2D texture slot through a bicubic
constexpr sampler, at normalized or at pixel coordinates, by the arm its slot's pushed word
selects, which the runtime writes from the bound texture's format and swizzle
- A kernel, a vertex function or a fragment function samples a 1D or 2D texture slot through a
bicubic constexpr sampler, at normalized or at pixel coordinates, by the arm its slot's pushed
word selects, which the runtime writes from the bound texture's format and swizzle
(`metal2vulkan::metal::format::bicubic_texels_word`), the same word for a dispatch and for a draw.
A dispatch or a draw whose slot holds a texture of a format with no such word (a compressed, YUV,
stencil, integer or extended-range format, or one of 8-bit sRGB codes such as `RGBA8Unorm_sRGB`,
whose taps Metal filters decoded) is `Gap::BicubicTexels`, naming the slot and the format, found
when the pipeline state or a binding changes: each such format's arm is built when a guest binds
one. A bicubic sample of a 1D texture is refused at creation in every stage (the identity domains'
form, below). Only a render state whose functions sample through a bicubic sampler lists a slot to
one. Only a render state whose functions sample through a bicubic sampler lists a slot to
check and fill; a draw of any other state does neither. Basis: this is NOT documented Metal. The
MSL spec lists only nearest and linear filters, and 'bicubic' appears nowhere in the spec or the
feature-set tables. It is built because a guest already uses the bicubic constexpr sampler in
@@ -4546,8 +4545,6 @@ cache is answered compile-required on both.
- with no symbol, a storage texture's access without a format, not a texture buffer's, that the
device's `shaderStorageImageReadWithoutFormat` or `shaderStorageImageWriteWithoutFormat` does
not take and the formats' own bits do not grant: no test yet;
- a bicubic sample of a 1D texture ("a bicubic filter of a 1D texture"): the translator test
`a_bicubic_kernel_reads_each_slots_format_treatment_from_its_pushed_field` asserts the text;
- a bicubic sample of an extended-range texture through `address::repeat` with a constant texel
offset: the golden table holds the refusal (`engine/xr_bicubic`'s `xrb_repeat_offset`);
- an argument buffer's texture of a type the identity arrays hold no element of (a cube read as
+1 -1
View File
@@ -1100,7 +1100,7 @@ pub enum IdentityCause {
/// function.
ObjectOrMeshStage,
/// A sample through a sampler the identity sampling does not take: a sampler argument whose
/// minimum level the function specializes, or a bicubic filter of a 1D texture.
/// minimum level the function specializes.
SamplerState,
/// A storage texture access the device takes only with a declared format, whose bound format
/// no input names under the identity domains.
+5 -13
View File
@@ -1746,9 +1746,6 @@ fn identity_admits(plan: &Plan) -> Result<(), Error> {
}
}
/// [`identity_refusal`]'s form for a 1D texture's bicubic sample.
pub(crate) const BICUBIC_LINE_FORM: &str = "a bicubic filter of a 1D texture";
/// The first form plan `plan` holds that the identity domains do not lower yet, as a Metal
/// program reaches it, which [`identity_admits`]'s refusal names (diagnostics only); `None` where
/// it holds none.
@@ -1847,22 +1844,17 @@ fn identity_refusal(plan: &Plan) -> Option<(IdentityCause, String)> {
// slot or a constexpr sampler (`sampler::IdentitySampling`, `SamplerPlan::heap_identity`), of
// an argument buffer's texture through an argument buffer's sampler (its resource ID the
// handle, `access::handle::emit_identity_sampler`), a runtime sampler's word read from its
// resource ID, and a 2D texture slot's bicubic sample, the bound format's treatment read from
// its push field (`PushField::BicubicTexels`): no bicubic sample of a 1D texture
// (`Routine::Line`), and no specialization of a slot's state. Constexpr samplers a lane
// chooses among beside an argument buffer's texture read the set-1 sampler array at the chosen
// candidate's pushed index (`SamplerPlan::heap_array_identity`) or are a switch over them.
use crate::lower::sampler::bicubic::routines::Routine;
// resource ID, and a 1D or 2D texture slot's bicubic sample, the bound format's treatment read
// from its push field (`PushField::BicubicTexels`): no specialization of a slot's state.
// Constexpr samplers a lane chooses among beside an argument buffer's texture read the set-1
// sampler array at the chosen candidate's pushed index (`SamplerPlan::heap_array_identity`) or
// are a switch over them.
let sampled = &plan.families.sampler;
let refused = [
(
!(sampled.combined.iter()).all(|k| sampled.identity.contains_key(k)),
"a texture argument sampled through a sampler the identity sampling does not take",
),
(
sampled.bicubic_routines.contains(&Routine::Line),
BICUBIC_LINE_FORM,
),
(
(sampled.slots.values()).any(|r| r.min_level),
"a sampler argument whose minimum level the function specializes",
@@ -439,7 +439,7 @@ engine/bcu_edges.ll bcu_edges ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok
engine/bcu_formats.air.ll bcu_formats ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok
engine/bcu_formats.ll bcu_formats ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok
engine/bcu_forms.air.ll bcu_forms Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented}
engine/bcu_forms.ll bcu_forms Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented}
engine/bcu_forms.ll bcu_forms ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok
engine/bcu_fragment.air.ll bcu_fragment ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok
engine/bcu_fragment.ll bcu_fragment ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok
engine/bcu_vertex.air.ll bcu_vertex ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok
@@ -449,7 +449,7 @@ engine/bcu_vertex.ll bcu_vertex_color ok ok ok ok ok ok ok ok ok ok ok ok ok ok
engine/bcx_half_read.air.ll bcx_half_read ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok
engine/bcx_half_read.ll bcx_half_read ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok
engine/bcx_rules.air.ll bcx_rules Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented}
engine/bcx_rules.ll bcx_rules Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented} Unsupported{IdentityDomains; NotImplemented}
engine/bcx_rules.ll bcx_rules ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok
engine/bcx_table.air.ll bcx_table ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok
engine/bcx_table.ll bcx_table ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok
engine/buffer_end_byte_load.air.ll buffer_end_byte_load ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok
Can't render this file because it is too large.
+4 -5
View File
@@ -212,9 +212,9 @@ the runtime's, the command line's, the compile worker's and every validation too
consumer pushes for it (`PushField::ConstexprSampler`), where the consumer places the device
sampler `CombinedSampler::constexpr_sampler` describes, normalized: the shader scales a pixel
sampler's coordinate. An integer write to a storage slot without a format saturates to the channel
widths the consumer pushes (`PushField::TextureIntegerChannels`). A sample of a 2D texture
slot through a bicubic constexpr sampler, at normalized or pixel coordinates, reads how Metal's
bicubic filter treats the bound texture's texels (its inner taps, its clamp and its border
widths the consumer pushes (`PushField::TextureIntegerChannels`). A sample of a 1D or 2D
texture slot through a bicubic constexpr sampler, at normalized or pixel coordinates, reads how
Metal's bicubic filter treats the bound texture's texels (its inner taps, its clamp and its border
texels) from the word the consumer pushes for that slot (`PushField::BicubicTexels`:
`metal::format::bicubic_texels_word` of the bound texture's format and swizzle,
`metal::format::BICUBIC_TEXELS_UNBOUND` for a slot bound to nothing). `bicubic_texels_word` has no word for a
@@ -277,8 +277,7 @@ the runtime's, the command line's, the compile worker's and every validation too
0-11 of the ID's word, a slot's pushed and a member's in the argument buffer). Any other
function is refused as `Unsupported{IdentityDomains}`, whose cause (`Cause::Identity`) names
the family of the first such form the function holds and whose symbol names the form: one that samples through an argument buffer's sampler or samples an
argument buffer's texture, samples a 1D
texture through a bicubic filter, uses a slot's swizzle, a two-plane, extended-range or sRGB-twin form, reads an
argument buffer's texture, uses a slot's swizzle, a two-plane, extended-range or sRGB-twin form, reads an
argument buffer's texture
through another numeric type or as raw texels, or uses any other state of a texture or sampler
beyond its ID.