diff --git a/crates/metal2vulkan-runtime/README.md b/crates/metal2vulkan-runtime/README.md index 520697a2c..8b3f281bf 100644 --- a/crates/metal2vulkan-runtime/README.md +++ b/crates/metal2vulkan-runtime/README.md @@ -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 diff --git a/crates/metal2vulkan/src/error/mod.rs b/crates/metal2vulkan/src/error/mod.rs index 7ba61cfa7..e71bb29f9 100644 --- a/crates/metal2vulkan/src/error/mod.rs +++ b/crates/metal2vulkan/src/error/mod.rs @@ -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. diff --git a/crates/metal2vulkan/src/lower/select.rs b/crates/metal2vulkan/src/lower/select.rs index 600b2e4d8..76d2f3df0 100644 --- a/crates/metal2vulkan/src/lower/select.rs +++ b/crates/metal2vulkan/src/lower/select.rs @@ -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", diff --git a/crates/metal2vulkan/tests/public_fixture_expectations_engine.tsv b/crates/metal2vulkan/tests/public_fixture_expectations_engine.tsv index ec198804e..cb88beb8e 100644 --- a/crates/metal2vulkan/tests/public_fixture_expectations_engine.tsv +++ b/crates/metal2vulkan/tests/public_fixture_expectations_engine.tsv @@ -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 diff --git a/docs/API.md b/docs/API.md index df7b879b9..6dc5972e0 100644 --- a/docs/API.md +++ b/docs/API.md @@ -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.