Blend a fetched attachment with the second source, as Metal allows

The steps this packet landed as, in order:
- Regenerate docs/REFUSALS.md after the second-source blend of a fetched attachment
- Bind the generic blend lane's buffers at a u32 index

Content: the tree of `development` at d556610e9d, unchanged.
This commit is contained in:
Anees Iqbal committed 2026-10-26 13:19:06 +02:00
1 parent a437496677
commit ac54e28297
19 files changed
+911 -174

No files matched your search

@@ -2212,10 +2212,11 @@ degradations! {
/// The blend of a color attachment the fragment function reads, computed by the shader in
/// the pixel interlock's storage form, of a format whose Metal blend arithmetic is not
/// built (a 32-bit float, 16-bit normalized, 8-bit signed normalized, 10-bit, packed
/// float or `A8Unorm` format, among others, or an 8-bit unorm one written by fewer than
/// four lanes): in `float`, each step rounded, the source and the blend color clamped to a
/// normalized format's range, the device's conversion storing the result. Metal's blend
/// for these formats is not measured.
/// float or `A8Unorm` format, among others, an 8-bit unorm one written by fewer than four
/// lanes, or a 16-bit float or 8-bit unorm one under a blend of the second source): in
/// `float`, each step rounded, the sources and the blend color clamped to a normalized
/// format's range, the device's conversion storing the result. Metal's blend for these
/// formats is not measured.
UnmeasuredFetchBlend = "unmeasured-fetch-blend";
}
}
@@ -1007,10 +1007,10 @@ impl FeatureRow {
// interlock's storage form (`lower::fragment::fetch`), exact for a fetch and for an
// unblended write, and for Metal's blend of an extended-range, a 16-bit float, an
// 8-bit unorm or a packed 16-bit attachment; another float-class format's blend is the
// shader's generic one, logged (`PrecisionNote::UnmeasuredFetchBlend`). Its blend of an
// sRGB attachment, a blend of the second source (but an extended-range one's), and its
// fetch of a one- or two-channel sRGB attachment are not built, refused per pipeline:
// the row's gap. A device with neither has no ordered fetch.
// shader's generic one, logged (`PrecisionNote::UnmeasuredFetchBlend`), as is a blend of
// the second source. Its blend of an sRGB attachment and its fetch of a one- or
// two-channel sRGB attachment are not built, refused per pipeline: the row's gap. A
// device with neither has no ordered fetch.
F::ProgrammableBlending => first([
match (through_inputs(f.profile), through_storage(f.profile)) {
(true, _) => None,
@@ -67,6 +67,7 @@ fixture fbl_fetch_blend16_narrow: metal: Apple metal version 32023.921 (metalfe-
fixture fbl_fetch_blend16_safe: metal: Apple metal version 32023.921 (metalfe-32023.921.6); macosx-sdk: 27.0 (26A425)
fixture fbl_fetch_blend8: metal: Apple metal version 32023.921 (metalfe-32023.921.6); macosx-sdk: 27.0 (26A425)
fixture fbl_fetch_blend8_safe: metal: Apple metal version 32023.921 (metalfe-32023.921.6); macosx-sdk: 27.0 (26A425)
fixture fbl_fetch_dual: metal: Apple metal version 32023.921 (metalfe-32023.921.6); macosx-sdk: 27.0 (26A425)
fixture fca_fragment_absent_inputs: metal: Apple metal version 32023.921 (metalfe-32023.921.6); macosx-sdk: 27.0 (26A425)
fixture fca_kernel_absent_builtin: metal: Apple metal version 32023.921 (metalfe-32023.921.6); macosx-sdk: 27.0 (26A425)
fixture fca_vertex_absent_attribute: metal: Apple metal version 32023.921 (metalfe-32023.921.6); macosx-sdk: 27.0 (26A425)
@@ -0,0 +1,139 @@
; Generated by scripts/regen-air-fixtures from fbl_fetch_dual.metal (typed pointers; xcrun metal-as reassembles it). Do not edit.
; ModuleID = '-'
source_filename = "-"
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024-n8:16:32"
target triple = "air64_v29-apple-macosx27.0.0"
; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn
define <{ <4 x float> }> @fbd_vertex(i32 noundef %0) local_unnamed_addr #0 {
%2 = shl i32 %0, 1
%3 = and i32 %2, 2
%4 = tail call fast float @air.convert.f.f32.u.i32(i32 %3) #3
%5 = insertelement <2 x float> undef, float %4, i64 0
%6 = and i32 %0, 2
%7 = tail call fast float @air.convert.f.f32.u.i32(i32 %6) #3
%8 = insertelement <2 x float> %5, float %7, i64 1
%9 = fmul fast <2 x float> %8, <float 2.000000e+00, float 2.000000e+00>
%10 = fadd fast <2 x float> %9, <float -1.000000e+00, float -1.000000e+00>
%11 = shufflevector <2 x float> %10, <2 x float> poison, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
%12 = shufflevector <4 x float> %11, <4 x float> <float poison, float poison, float 0.000000e+00, float 1.000000e+00>, <4 x i32> <i32 0, i32 1, i32 6, i32 7>
%13 = insertvalue <{ <4 x float> }> undef, <4 x float> %12, 0
ret <{ <4 x float> }> %13
}
; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn
declare float @air.convert.f.f32.u.i32(i32) local_unnamed_addr #1
; Function Attrs: argmemonly mustprogress nofree nosync nounwind readonly willreturn
define <{ <4 x half>, <4 x half> }> @fbd_dual_half(<4 x float> %0, <4 x half> noundef %1, <4 x half> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %2, <4 x half> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %3) local_unnamed_addr #2 {
%5 = extractelement <4 x float> %0, i64 1
%6 = tail call i32 @air.convert.u.i32.f.f32(float %5) #3
%7 = shl i32 %6, 6
%8 = extractelement <4 x float> %0, i64 0
%9 = tail call i32 @air.convert.u.i32.f.f32(float %8) #3
%10 = add i32 %7, %9
%11 = extractelement <4 x half> %1, i64 3
%12 = fcmp fast oeq half %11, 0xH0000
%13 = add i32 %10, 4096
%14 = select i1 %12, i32 %13, i32 %10
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds <4 x half>, <4 x half> addrspace(1)* %2, i64 %15
%17 = load <4 x half>, <4 x half> addrspace(1)* %16, align 8, !tbaa !37, !alias.scope !41, !noalias !44
%18 = getelementptr inbounds <4 x half>, <4 x half> addrspace(1)* %3, i64 %15
%19 = load <4 x half>, <4 x half> addrspace(1)* %18, align 8, !tbaa !37, !alias.scope !44, !noalias !41
%20 = insertvalue <{ <4 x half>, <4 x half> }> undef, <4 x half> %17, 0
%21 = insertvalue <{ <4 x half>, <4 x half> }> %20, <4 x half> %19, 1
ret <{ <4 x half>, <4 x half> }> %21
}
; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn
declare i32 @air.convert.u.i32.f.f32(float) local_unnamed_addr #1
; Function Attrs: argmemonly mustprogress nofree nosync nounwind readonly willreturn
define <{ <4 x float>, <4 x float> }> @fbd_dual_float(<4 x float> %0, <4 x float> noundef %1, <4 x float> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %2, <4 x float> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %3) local_unnamed_addr #2 {
%5 = extractelement <4 x float> %0, i64 1
%6 = tail call i32 @air.convert.u.i32.f.f32(float %5) #3
%7 = shl i32 %6, 6
%8 = extractelement <4 x float> %0, i64 0
%9 = tail call i32 @air.convert.u.i32.f.f32(float %8) #3
%10 = add i32 %7, %9
%11 = extractelement <4 x float> %1, i64 3
%12 = fcmp fast oeq float %11, 0.000000e+00
%13 = add i32 %10, 4096
%14 = select i1 %12, i32 %13, i32 %10
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %2, i64 %15
%17 = load <4 x float>, <4 x float> addrspace(1)* %16, align 16, !tbaa !46, !alias.scope !48, !noalias !51
%18 = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %3, i64 %15
%19 = load <4 x float>, <4 x float> addrspace(1)* %18, align 16, !tbaa !46, !alias.scope !51, !noalias !48
%20 = insertvalue <{ <4 x float>, <4 x float> }> undef, <4 x float> %17, 0
%21 = insertvalue <{ <4 x float>, <4 x float> }> %20, <4 x float> %19, 1
ret <{ <4 x float>, <4 x float> }> %21
}
attributes #0 = { mustprogress nofree nosync nounwind readnone willreturn "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="0" "no-builtins" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" }
attributes #1 = { mustprogress nofree nosync nounwind readnone willreturn }
attributes #2 = { argmemonly mustprogress nofree nosync nounwind readonly willreturn "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="128" "no-builtins" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" }
attributes #3 = { nounwind readnone willreturn }
!llvm.module.flags = !{!0, !1, !2, !3, !4, !5, !6, !7, !8}
!air.vertex = !{!9}
!air.fragment = !{!14, !23}
!air.compile_options = !{!31, !32, !33}
!llvm.ident = !{!34}
!air.version = !{!35}
!air.language_version = !{!36}
!0 = !{i32 2, !"SDK Version", [2 x i32] [i32 27, i32 0]}
!1 = !{i32 1, !"wchar_size", i32 4}
!2 = !{i32 7, !"frame-pointer", i32 2}
!3 = !{i32 7, !"air.max_device_buffers", i32 31}
!4 = !{i32 7, !"air.max_constant_buffers", i32 31}
!5 = !{i32 7, !"air.max_threadgroup_buffers", i32 31}
!6 = !{i32 7, !"air.max_textures", i32 128}
!7 = !{i32 7, !"air.max_read_write_textures", i32 8}
!8 = !{i32 7, !"air.max_samplers", i32 16}
!9 = !{<{ <4 x float> }> (i32)* @fbd_vertex, !10, !12}
!10 = !{!11}
!11 = !{!"air.position", !"air.arg_type_name", !"float4", !"air.arg_name", !"position"}
!12 = !{!13}
!13 = !{i32 0, !"air.vertex_id", !"air.arg_type_name", !"uint", !"air.arg_name", !"vid"}
!14 = !{<{ <4 x half>, <4 x half> }> (<4 x float>, <4 x half>, <4 x half> addrspace(1)*, <4 x half> addrspace(1)*)* @fbd_dual_half, !15, !18}
!15 = !{!16, !17}
!16 = !{!"air.render_target", i32 0, i32 0, !"air.arg_type_name", !"half4", !"air.arg_name", !"color"}
!17 = !{!"air.render_target", i32 0, i32 1, !"air.arg_type_name", !"half4", !"air.arg_name", !"second"}
!18 = !{!19, !20, !21, !22}
!19 = !{i32 0, !"air.position", !"air.center", !"air.no_perspective", !"air.arg_type_name", !"float4", !"air.arg_name", !"position"}
!20 = !{i32 1, !"air.render_target", i32 0, !"air.arg_type_name", !"half4", !"air.arg_name", !"dst"}
!21 = !{i32 2, !"air.buffer", !"air.location_index", i32 0, i32 1, !"air.read", !"air.address_space", i32 1, !"air.arg_type_size", i32 8, !"air.arg_type_align_size", i32 8, !"air.arg_type_name", !"half4", !"air.arg_name", !"src"}
!22 = !{i32 3, !"air.buffer", !"air.location_index", i32 1, i32 1, !"air.read", !"air.address_space", i32 1, !"air.arg_type_size", i32 8, !"air.arg_type_align_size", i32 8, !"air.arg_type_name", !"half4", !"air.arg_name", !"second"}
!23 = !{<{ <4 x float>, <4 x float> }> (<4 x float>, <4 x float>, <4 x float> addrspace(1)*, <4 x float> addrspace(1)*)* @fbd_dual_float, !24, !27}
!24 = !{!25, !26}
!25 = !{!"air.render_target", i32 0, i32 0, !"air.arg_type_name", !"float4", !"air.arg_name", !"color"}
!26 = !{!"air.render_target", i32 0, i32 1, !"air.arg_type_name", !"float4", !"air.arg_name", !"second"}
!27 = !{!19, !28, !29, !30}
!28 = !{i32 1, !"air.render_target", i32 0, !"air.arg_type_name", !"float4", !"air.arg_name", !"dst"}
!29 = !{i32 2, !"air.buffer", !"air.location_index", i32 0, i32 1, !"air.read", !"air.address_space", i32 1, !"air.arg_type_size", i32 16, !"air.arg_type_align_size", i32 16, !"air.arg_type_name", !"float4", !"air.arg_name", !"src"}
!30 = !{i32 3, !"air.buffer", !"air.location_index", i32 1, i32 1, !"air.read", !"air.address_space", i32 1, !"air.arg_type_size", i32 16, !"air.arg_type_align_size", i32 16, !"air.arg_type_name", !"float4", !"air.arg_name", !"second"}
!31 = !{!"air.compile.denorms_disable"}
!32 = !{!"air.compile.fast_math_enable"}
!33 = !{!"air.compile.framebuffer_fetch_enable"}
!34 = !{!"Apple metal version 32023.921 (metalfe-32023.921.6)"}
!35 = !{i32 2, i32 9, i32 0}
!36 = !{!"Metal", i32 4, i32 1, i32 0}
!37 = !{!38, !38, i64 0}
!38 = !{!"half", !39, i64 0}
!39 = !{!"omnipotent char", !40, i64 0}
!40 = !{!"Simple C++ TBAA"}
!41 = !{!42}
!42 = distinct !{!42, !43, !"air-alias-scope-arg(2)"}
!43 = distinct !{!43, !"air-alias-scopes(fbd_dual_half)"}
!44 = !{!45}
!45 = distinct !{!45, !43, !"air-alias-scope-arg(3)"}
!46 = !{!47, !47, i64 0}
!47 = !{!"float", !39, i64 0}
!48 = !{!49}
!49 = distinct !{!49, !50, !"air-alias-scope-arg(2)"}
!50 = distinct !{!50, !"air-alias-scopes(fbd_dual_float)"}
!51 = !{!52}
!52 = distinct !{!52, !50, !"air-alias-scope-arg(3)"}
@@ -0,0 +1,139 @@
; Generated by scripts/regen-air-fixtures from fbl_fetch_dual.metal (llvm-dis of fbl_fetch_dual.air). Do not edit.
; ModuleID = '<stdin>'
source_filename = "-"
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024-n8:16:32"
target triple = "air64_v29-apple-macosx27.0.0"
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
define <{ <4 x float> }> @fbd_vertex(i32 noundef %0) local_unnamed_addr #0 {
%2 = shl i32 %0, 1
%3 = and i32 %2, 2
%4 = tail call fast float @air.convert.f.f32.u.i32(i32 %3) #3
%5 = insertelement <2 x float> undef, float %4, i64 0
%6 = and i32 %0, 2
%7 = tail call fast float @air.convert.f.f32.u.i32(i32 %6) #3
%8 = insertelement <2 x float> %5, float %7, i64 1
%9 = fmul fast <2 x float> %8, splat (float 2.000000e+00)
%10 = fadd fast <2 x float> %9, splat (float -1.000000e+00)
%11 = shufflevector <2 x float> %10, <2 x float> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
%12 = shufflevector <4 x float> %11, <4 x float> <float poison, float poison, float 0.000000e+00, float 1.000000e+00>, <4 x i32> <i32 0, i32 1, i32 6, i32 7>
%13 = insertvalue <{ <4 x float> }> undef, <4 x float> %12, 0
ret <{ <4 x float> }> %13
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare float @air.convert.f.f32.u.i32(i32) local_unnamed_addr #1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: read)
define <{ <4 x half>, <4 x half> }> @fbd_dual_half(<4 x float> %0, <4 x half> noundef %1, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %2, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %3) local_unnamed_addr #2 {
%5 = extractelement <4 x float> %0, i64 1
%6 = tail call i32 @air.convert.u.i32.f.f32(float %5) #3
%7 = shl i32 %6, 6
%8 = extractelement <4 x float> %0, i64 0
%9 = tail call i32 @air.convert.u.i32.f.f32(float %8) #3
%10 = add i32 %7, %9
%11 = extractelement <4 x half> %1, i64 3
%12 = fcmp fast oeq half %11, 0xH0000
%13 = add i32 %10, 4096
%14 = select i1 %12, i32 %13, i32 %10
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds <4 x half>, ptr addrspace(1) %2, i64 %15
%17 = load <4 x half>, ptr addrspace(1) %16, align 8, !tbaa !37, !alias.scope !41, !noalias !44
%18 = getelementptr inbounds <4 x half>, ptr addrspace(1) %3, i64 %15
%19 = load <4 x half>, ptr addrspace(1) %18, align 8, !tbaa !37, !alias.scope !44, !noalias !41
%20 = insertvalue <{ <4 x half>, <4 x half> }> undef, <4 x half> %17, 0
%21 = insertvalue <{ <4 x half>, <4 x half> }> %20, <4 x half> %19, 1
ret <{ <4 x half>, <4 x half> }> %21
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare i32 @air.convert.u.i32.f.f32(float) local_unnamed_addr #1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: read)
define <{ <4 x float>, <4 x float> }> @fbd_dual_float(<4 x float> %0, <4 x float> noundef %1, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %2, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %3) local_unnamed_addr #2 {
%5 = extractelement <4 x float> %0, i64 1
%6 = tail call i32 @air.convert.u.i32.f.f32(float %5) #3
%7 = shl i32 %6, 6
%8 = extractelement <4 x float> %0, i64 0
%9 = tail call i32 @air.convert.u.i32.f.f32(float %8) #3
%10 = add i32 %7, %9
%11 = extractelement <4 x float> %1, i64 3
%12 = fcmp fast oeq float %11, 0.000000e+00
%13 = add i32 %10, 4096
%14 = select i1 %12, i32 %13, i32 %10
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds <4 x float>, ptr addrspace(1) %2, i64 %15
%17 = load <4 x float>, ptr addrspace(1) %16, align 16, !tbaa !46, !alias.scope !48, !noalias !51
%18 = getelementptr inbounds <4 x float>, ptr addrspace(1) %3, i64 %15
%19 = load <4 x float>, ptr addrspace(1) %18, align 16, !tbaa !46, !alias.scope !51, !noalias !48
%20 = insertvalue <{ <4 x float>, <4 x float> }> undef, <4 x float> %17, 0
%21 = insertvalue <{ <4 x float>, <4 x float> }> %20, <4 x float> %19, 1
ret <{ <4 x float>, <4 x float> }> %21
}
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="0" "no-builtins" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" }
attributes #1 = { mustprogress nofree nosync nounwind willreturn memory(none) }
attributes #2 = { mustprogress nofree nosync nounwind willreturn memory(argmem: read) "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="128" "no-builtins" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" }
attributes #3 = { nounwind willreturn memory(none) }
!llvm.module.flags = !{!0, !1, !2, !3, !4, !5, !6, !7, !8}
!air.vertex = !{!9}
!air.fragment = !{!14, !23}
!air.compile_options = !{!31, !32, !33}
!llvm.ident = !{!34}
!air.version = !{!35}
!air.language_version = !{!36}
!0 = !{i32 2, !"SDK Version", [2 x i32] [i32 27, i32 0]}
!1 = !{i32 1, !"wchar_size", i32 4}
!2 = !{i32 7, !"frame-pointer", i32 2}
!3 = !{i32 7, !"air.max_device_buffers", i32 31}
!4 = !{i32 7, !"air.max_constant_buffers", i32 31}
!5 = !{i32 7, !"air.max_threadgroup_buffers", i32 31}
!6 = !{i32 7, !"air.max_textures", i32 128}
!7 = !{i32 7, !"air.max_read_write_textures", i32 8}
!8 = !{i32 7, !"air.max_samplers", i32 16}
!9 = !{ptr @fbd_vertex, !10, !12}
!10 = !{!11}
!11 = !{!"air.position", !"air.arg_type_name", !"float4", !"air.arg_name", !"position"}
!12 = !{!13}
!13 = !{i32 0, !"air.vertex_id", !"air.arg_type_name", !"uint", !"air.arg_name", !"vid"}
!14 = !{ptr @fbd_dual_half, !15, !18}
!15 = !{!16, !17}
!16 = !{!"air.render_target", i32 0, i32 0, !"air.arg_type_name", !"half4", !"air.arg_name", !"color"}
!17 = !{!"air.render_target", i32 0, i32 1, !"air.arg_type_name", !"half4", !"air.arg_name", !"second"}
!18 = !{!19, !20, !21, !22}
!19 = !{i32 0, !"air.position", !"air.center", !"air.no_perspective", !"air.arg_type_name", !"float4", !"air.arg_name", !"position"}
!20 = !{i32 1, !"air.render_target", i32 0, !"air.arg_type_name", !"half4", !"air.arg_name", !"dst"}
!21 = !{i32 2, !"air.buffer", !"air.location_index", i32 0, i32 1, !"air.read", !"air.address_space", i32 1, !"air.arg_type_size", i32 8, !"air.arg_type_align_size", i32 8, !"air.arg_type_name", !"half4", !"air.arg_name", !"src"}
!22 = !{i32 3, !"air.buffer", !"air.location_index", i32 1, i32 1, !"air.read", !"air.address_space", i32 1, !"air.arg_type_size", i32 8, !"air.arg_type_align_size", i32 8, !"air.arg_type_name", !"half4", !"air.arg_name", !"second"}
!23 = !{ptr @fbd_dual_float, !24, !27}
!24 = !{!25, !26}
!25 = !{!"air.render_target", i32 0, i32 0, !"air.arg_type_name", !"float4", !"air.arg_name", !"color"}
!26 = !{!"air.render_target", i32 0, i32 1, !"air.arg_type_name", !"float4", !"air.arg_name", !"second"}
!27 = !{!19, !28, !29, !30}
!28 = !{i32 1, !"air.render_target", i32 0, !"air.arg_type_name", !"float4", !"air.arg_name", !"dst"}
!29 = !{i32 2, !"air.buffer", !"air.location_index", i32 0, i32 1, !"air.read", !"air.address_space", i32 1, !"air.arg_type_size", i32 16, !"air.arg_type_align_size", i32 16, !"air.arg_type_name", !"float4", !"air.arg_name", !"src"}
!30 = !{i32 3, !"air.buffer", !"air.location_index", i32 1, i32 1, !"air.read", !"air.address_space", i32 1, !"air.arg_type_size", i32 16, !"air.arg_type_align_size", i32 16, !"air.arg_type_name", !"float4", !"air.arg_name", !"second"}
!31 = !{!"air.compile.denorms_disable"}
!32 = !{!"air.compile.fast_math_enable"}
!33 = !{!"air.compile.framebuffer_fetch_enable"}
!34 = !{!"Apple metal version 32023.921 (metalfe-32023.921.6)"}
!35 = !{i32 2, i32 9, i32 0}
!36 = !{!"Metal", i32 4, i32 1, i32 0}
!37 = !{!38, !38, i64 0}
!38 = !{!"half", !39, i64 0}
!39 = !{!"omnipotent char", !40, i64 0}
!40 = !{!"Simple C++ TBAA"}
!41 = !{!42}
!42 = distinct !{!42, !43, !"air-alias-scope-arg(2)"}
!43 = distinct !{!43, !"air-alias-scopes(fbd_dual_half)"}
!44 = !{!45}
!45 = distinct !{!45, !43, !"air-alias-scope-arg(3)"}
!46 = !{!47, !47, i64 0}
!47 = !{!"float", !39, i64 0}
!48 = !{!49}
!49 = distinct !{!49, !50, !"air-alias-scope-arg(2)"}
!50 = distinct !{!50, !"air-alias-scopes(fbd_dual_float)"}
!51 = !{!52}
!52 = distinct !{!52, !50, !"air-alias-scope-arg(3)"}
@@ -0,0 +1,61 @@
// Owned fixture: framebuffer fetch of an attachment blended with the second source. Each fragment
// function reads color attachment 0 ([[color(0)]]) and writes it through its first output and its
// second (index 1), under the compiler's default fast math. Metal makes and draws such a pipeline:
// the second output is the blend's second source. On a device that orders fetch through the pixel
// interlock alone the write goes to a storage image, which no Vulkan blend applies to, so the
// function computes the blend itself, reading the second source from its second output.
//
// - fbd_dual_half: `half4` outputs, each loaded from its own buffer at the fragment's texel (the
// texel after the target's last where the fetched alpha is zero).
// - fbd_dual_float: the same as `float4` outputs, reading the attachment as `float4`.
//
// fbd_vertex draws one fullscreen triangle. Loop-free.
// metal-macos-min: 27.0
#include <metal_stdlib>
using namespace metal;
struct FbdVertex {
float4 position [[position]];
};
vertex FbdVertex fbd_vertex(uint vid [[vertex_id]])
{
float2 p = float2(float((vid << 1) & 2u), float(vid & 2u));
FbdVertex o;
o.position = float4(p * 2.0f - 1.0f, 0.0f, 1.0f);
return o;
}
struct FbdHalf {
half4 color [[color(0), index(0)]];
half4 second [[color(0), index(1)]];
};
struct FbdFloat {
float4 color [[color(0), index(0)]];
float4 second [[color(0), index(1)]];
};
fragment FbdHalf fbd_dual_half(FbdVertex in [[stage_in]], half4 dst [[color(0)]],
const device half4 *src [[buffer(0)]],
const device half4 *second [[buffer(1)]])
{
uint i = uint(in.position.y) * 64u + uint(in.position.x);
uint j = dst.a == 0.0h ? i + 4096u : i;
FbdHalf o;
o.color = src[j];
o.second = second[j];
return o;
}
fragment FbdFloat fbd_dual_float(FbdVertex in [[stage_in]], float4 dst [[color(0)]],
const device float4 *src [[buffer(0)]],
const device float4 *second [[buffer(1)]])
{
uint i = uint(in.position.y) * 64u + uint(in.position.x);
uint j = dst.a == 0.0f ? i + 4096u : i;
FbdFloat o;
o.color = src[j];
o.second = second[j];
return o;
}
@@ -27,6 +27,16 @@
//! fast math Metal fuses the source-over product into its sum; a `half4` output's 10-bit and 8-bit
//! channels lie within one code (Metal reads them in `half`), the 16-bit normalized and 8-bit snorm
//! ones too.
//!
//! A blend of the second source (the owned fixture `fbl_fetch_dual`, fast math: `half4` and
//! `float4` outputs and second outputs, each loaded from its own buffer) into `RGBA32Float`,
//! `RGBA16Float`, `RGBA16Unorm` and `RGBA8Unorm`: the second output's color over one minus it, and
//! its alpha over one minus it, the second source clamped as the source; checked as above. Metal
//! makes and draws such a pipeline; against our probe of it (both outputs `half4` or `float4`,
//! fast and safe math) the model holds every channel of `RGBA32Float` without fast math and of
//! `RGBA8Unorm` of `float4` outputs, and `RGBA16Unorm`'s within one code; Metal blends
//! `RGBA16Float` in `half` and writes it toward zero, so there the model is a code off in about
//! half the channels, and further where a `half` step overflows.
use super::{form, library, through_inputs};
use crate::runtime_lane::degrade_notices::counts;
@@ -59,8 +69,10 @@ const COLOR: [f32; 4] = [0.25, 1.5, -0.5, 0.75];
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
enum Layout {
Float32,
Half16,
Unorm16,
Snorm8,
Unorm8,
Rgb10a2,
A8,
}
@@ -70,8 +82,8 @@ impl Layout {
fn bytes(self) -> usize {
match self {
Layout::Float32 => 16,
Layout::Unorm16 => 8,
Layout::Snorm8 | Layout::Rgb10a2 => 4,
Layout::Half16 | Layout::Unorm16 => 8,
Layout::Snorm8 | Layout::Unorm8 | Layout::Rgb10a2 => 4,
Layout::A8 => 1,
}
}
@@ -79,9 +91,9 @@ impl Layout {
/// The low end of the range a normalized format clamps the source to.
fn low(self) -> Option<f32> {
match self {
Layout::Float32 => None,
Layout::Float32 | Layout::Half16 => None,
Layout::Snorm8 => Some(-1.0),
Layout::Unorm16 | Layout::Rgb10a2 | Layout::A8 => Some(0.0),
Layout::Unorm16 | Layout::Unorm8 | Layout::Rgb10a2 | Layout::A8 => Some(0.0),
}
}
@@ -91,9 +103,13 @@ impl Layout {
Layout::Float32 => {
std::array::from_fn(|c| f32::from_le_bytes(b[4 * c..4 * c + 4].try_into().unwrap()))
}
Layout::Half16 => {
std::array::from_fn(|c| from_half(u16::from_le_bytes([b[2 * c], b[2 * c + 1]])))
}
Layout::Unorm16 => std::array::from_fn(|c| {
f32::from(u16::from_le_bytes([b[2 * c], b[2 * c + 1]])) / 65535.0
}),
Layout::Unorm8 => std::array::from_fn(|c| f32::from(b[c]) / 255.0),
Layout::Snorm8 => std::array::from_fn(|c| (f32::from(b[c] as i8) / 127.0).max(-1.0)),
Layout::Rgb10a2 => {
let w = u32::from_le_bytes(b.try_into().unwrap());
@@ -112,10 +128,11 @@ impl Layout {
Layout::Float32 => (0..4)
.map(|c| i64::from(u32::from_le_bytes(b[4 * c..4 * c + 4].try_into().unwrap())))
.collect(),
Layout::Unorm16 => (0..4)
Layout::Half16 | Layout::Unorm16 => (0..4)
.map(|c| i64::from(u16::from_le_bytes([b[2 * c], b[2 * c + 1]])))
.collect(),
Layout::Snorm8 => b.iter().map(|&x| i64::from(x as i8)).collect(),
Layout::Unorm8 => b.iter().map(|&x| i64::from(x)).collect(),
Layout::Rgb10a2 => {
let w = u32::from_le_bytes(b.try_into().unwrap());
vec![
@@ -137,8 +154,10 @@ impl Layout {
};
match self {
Layout::Float32 => v.iter().map(|x| i64::from(x.to_bits())).collect(),
Layout::Half16 => v.iter().map(|&x| i64::from(to_half(x))).collect(),
Layout::Unorm16 => v.iter().map(|&x| code(x, 0.0, 65535.0)).collect(),
Layout::Snorm8 => v.iter().map(|&x| code(x, -1.0, 127.0)).collect(),
Layout::Unorm8 => v.iter().map(|&x| code(x, 0.0, 255.0)).collect(),
Layout::Rgb10a2 => vec![
code(v[0], 0.0, 1023.0),
code(v[1], 0.0, 1023.0),
@@ -167,6 +186,9 @@ enum Blend {
/// Color: the blend color over one minus the blend alpha, reverse subtracted; alpha: the
/// destination alpha over one minus the source color, subtracted.
Constant,
/// The second source's color over one minus it, added, and its alpha over one minus it,
/// added: the function's second output weighs the first against the destination.
Dual,
}
impl Blend {
@@ -192,6 +214,14 @@ impl Blend {
F::OneMinusSourceColor,
O::Subtract,
),
Blend::Dual => (
F::Source1Color,
F::OneMinusSource1Color,
O::Add,
F::Source1Alpha,
F::OneMinusSource1Alpha,
O::Add,
),
};
a.source_rgb_blend_factor = sc;
a.destination_rgb_blend_factor = dc;
@@ -202,15 +232,16 @@ impl Blend {
a
}
/// The model's blend of source `s` over destination `d` into a format of `layout` (the
/// module docs).
fn model(self, layout: Layout, s: [f32; 4], d: [f32; 4]) -> [f32; 4] {
/// The model's blend of source `s` (and second source `s1`) over destination `d` into a
/// format of `layout` (the module docs).
fn model(self, layout: Layout, (s, s1): ([f32; 4], [f32; 4]), d: [f32; 4]) -> [f32; 4] {
let clamp = |x: f32| match layout.low() {
Some(low) if x.is_nan() => low,
Some(low) => x.clamp(low, 1.0),
None => x,
};
let s = s.map(clamp);
let s1 = s1.map(clamp);
let c = COLOR.map(clamp);
match self {
Blend::Over => {
@@ -225,6 +256,7 @@ impl Blend {
_ => d[k] * m - s[k] * c[k],
})
}
Blend::Dual => std::array::from_fn(|k| s[k] * s1[k] + d[k] * (1.0 - s1[k])),
}
}
}
@@ -297,8 +329,9 @@ fn from_half(b: u16) -> f32 {
}
}
/// The target's bytes before the draw, and the sources (two a pixel) as `half`s where `half`.
fn data(layout: Layout, half: bool) -> (Vec<u8>, Vec<[f32; 4]>) {
/// The target's bytes before the draw, and the sources and second sources (two of each a pixel),
/// as `half`s where `half`.
fn data(layout: Layout, half: bool) -> (Vec<u8>, [Vec<[f32; 4]>; 2]) {
let mut words = Words(0x51ab_1e8b_17c0_de55);
let bytes = match layout {
Layout::Float32 => (0..4 * TEXELS)
@@ -308,18 +341,21 @@ fn data(layout: Layout, half: bool) -> (Vec<u8>, Vec<[f32; 4]>) {
.map(|_| (words.next() >> 24) as u8)
.collect(),
};
let sources = (0..2 * TEXELS)
.map(|_| {
[0; 4].map(|_: u8| {
let x = words.lane(true);
match half {
true => from_half(to_half(x)),
false => x,
}
let mut sources = || {
(0..2 * TEXELS)
.map(|_| {
[0; 4].map(|_: u8| {
let x = words.lane(true);
match half {
true => from_half(to_half(x)),
false => x,
}
})
})
})
.collect();
(bytes, sources)
.collect()
};
let first = sources();
(bytes, [first, sources()])
}
/// A private `SIDE`² texture of `pf` holding `bytes`, `bpp` a texel.
@@ -389,13 +425,14 @@ fn pipeline(
}
}
/// One draw of `state` over a target of `pf` holding `bytes`, the sources `sources` (`half`s
/// where `half`): the target's bytes after it, and whether it announced `unmeasured-fetch-blend`.
/// One draw of `state` over a target of `pf` holding `bytes`, the sources and second sources
/// `sources` (`half`s where `half`) in buffers 0 and 1: the target's bytes after it, and whether it
/// announced `unmeasured-fetch-blend`.
fn draw(
(lane, messages): (&Lane, &Messages),
state: &RenderPipelineState,
(pf, layout): (PixelFormat, Layout),
(half, bytes, sources): (bool, &[u8], &[[f32; 4]]),
(half, bytes, sources): (bool, &[u8], &[Vec<[f32; 4]>; 2]),
) -> (Vec<u8>, bool) {
let kind = Degradation::from_precision_note(PrecisionNote::UnmeasuredFetchBlend);
let bpp = layout.bytes() as u64;
@@ -404,19 +441,21 @@ fn draw(
second.usage = TextureUsage::RENDER_TARGET;
second.resource_options = ResourceOptions::private();
let second = lane.device.new_texture(&second).unwrap();
let src: Vec<u8> = match half {
true => sources
.iter()
.flat_map(|s| s.map(to_half))
.flat_map(u16::to_le_bytes)
.collect(),
false => sources
.iter()
.flatten()
.flat_map(|v| v.to_le_bytes())
.collect(),
};
let src = buffer_with(&lane.device, &src).unwrap();
let buffers = sources.each_ref().map(|sources| {
let bytes: Vec<u8> = match half {
true => sources
.iter()
.flat_map(|s| s.map(to_half))
.flat_map(u16::to_le_bytes)
.collect(),
false => sources
.iter()
.flatten()
.flat_map(|v| v.to_le_bytes())
.collect(),
};
buffer_with(&lane.device, &bytes).unwrap()
});
let mut pass = RenderPassDescriptor::new();
let attachment = &mut pass.color_attachments[0];
attachment.texture = Some(target.clone());
@@ -431,7 +470,11 @@ fn draw(
lane.run(&pass, |_, encoder, _| {
encoder.set_render_pipeline_state(state).unwrap();
encoder.set_blend_color(COLOR[0], COLOR[1], COLOR[2], COLOR[3]);
encoder.set_fragment_buffer(Some(&src), 0, 0).unwrap();
for (index, buffer) in buffers.iter().enumerate() {
encoder
.set_fragment_buffer(Some(buffer), 0, index as u32)
.unwrap();
}
encoder
.draw_primitives(PrimitiveType::Triangle, 0, 3, 1, 0)
.unwrap();
@@ -441,6 +484,60 @@ fn draw(
(lane.read(&target, (0, 0), bpp, BlitOption::None), announced)
}
/// Draw `entry` of `library` (whose vertex function is `vertex`, whose outputs are `half`s where
/// `half`) into a target of `pf` blended by `blend`, and check it (the module docs): print its line,
/// and on a device that fetches through the pixel interlock assert that it announced
/// `unmeasured-fetch-blend` and that every channel lies within one code of the model's (a `float`
/// channel's exactly). Whether it drew.
fn checked(
(lane, messages): (&Lane, &Messages),
(library, vertex): (&Library, &str),
(entry, half): (&str, bool),
(pf, layout): (PixelFormat, Layout),
blend: Blend,
) -> bool {
let device = lane.device.name();
let Some(state) = pipeline(lane, (library, vertex), entry, blend.attachment(pf)) else {
return false;
};
let (bytes, sources) = data(layout, half);
let data = (half, bytes.as_slice(), &sources);
let (read, announced) = draw((lane, messages), &state, (pf, layout), data);
let bpp = layout.bytes();
let nan = |code: i64| match layout {
Layout::Float32 => f32::from_bits(code as u32).is_nan(),
Layout::Half16 => code & 0x7c00 == 0x7c00 && code & 0x3ff != 0,
_ => false,
};
let (mut equal, mut channels, mut worst) = (0, 0, 0);
for i in 0..TEXELS {
let d = layout.decode(&bytes[bpp * i..bpp * i + bpp]);
let chosen = if d[3] == 0.0 { i + TEXELS } else { i };
let s = (sources[0][chosen], sources[1][chosen]);
let want = layout.encode(blend.model(layout, s, d));
let got = layout.codes(&read[bpp * i..bpp * i + bpp]);
for (&w, &g) in want.iter().zip(&got) {
channels += 1;
match w == g || (nan(w) && nan(g)) {
true => equal += 1,
false if layout == Layout::Float32 => worst = i64::MAX,
false => worst = worst.max((w - g).abs()),
}
}
}
println!(
"FETCH-GENERIC {entry} {pf:?} {blend:?} | {device} | through {} | the model's \
{equal}/{channels} channels, worst {worst} | announced {announced}",
form(lane),
);
if !through_inputs(lane) {
let what = format!("{entry} {pf:?} {blend:?} on {device}");
assert!(announced, "{what}: no unmeasured-fetch-blend");
assert!(worst <= 1, "{what}: {equal}/{channels}, worst {worst}");
}
true
}
/// Each draw announces `unmeasured-fetch-blend` and stores the model's channels, a 32-bit float
/// target's exactly, another's within one code, on a device that fetches through the pixel
/// interlock (the module docs).
@@ -451,7 +548,6 @@ fn a_blended_fetch_of_another_format_stores_the_generic_blend() {
options.announce_each = [kind].into_iter().collect();
});
let device = lane.device.name();
let interlock = !through_inputs(&lane);
let mut drawn = 0;
for safe in [false, true] {
let (library, vertex) = match safe {
@@ -468,46 +564,12 @@ fn a_blended_fetch_of_another_format_stores_the_generic_blend() {
("fbl8_safe_loaded_float", false),
],
};
for (pf, layout) in FORMATS {
for format in FORMATS {
for blend in [Blend::Over, Blend::Constant] {
for (entry, half) in entries {
let blended = blend.attachment(pf);
let Some(state) = pipeline(&lane, (&library, vertex), entry, blended) else {
continue;
};
let (bytes, sources) = data(layout, half);
let data = (half, bytes.as_slice(), sources.as_slice());
let (read, announced) = draw((&lane, &messages), &state, (pf, layout), data);
let bpp = layout.bytes();
let (mut equal, mut channels, mut worst) = (0, 0, 0);
for i in 0..TEXELS {
let d = layout.decode(&bytes[bpp * i..bpp * i + bpp]);
let chosen = if d[3] == 0.0 { i + TEXELS } else { i };
let want = layout.encode(blend.model(layout, sources[chosen], d));
let got = layout.codes(&read[bpp * i..bpp * i + bpp]);
for (&w, &g) in want.iter().zip(&got) {
channels += 1;
let nans = layout == Layout::Float32
&& f32::from_bits(w as u32).is_nan()
&& f32::from_bits(g as u32).is_nan();
match w == g || nans {
true => equal += 1,
false if layout == Layout::Float32 => worst = i64::MAX,
false => worst = worst.max((w - g).abs()),
}
}
}
println!(
"FETCH-GENERIC {entry} {pf:?} {blend:?} | {device} | through {} | the \
model's {equal}/{channels} channels, worst {worst} | announced {announced}",
form(&lane),
);
if interlock {
let what = format!("{entry} {pf:?} {blend:?} on {device}");
assert!(announced, "{what}: no unmeasured-fetch-blend");
assert!(worst <= 1, "{what}: {equal}/{channels}, worst {worst}");
}
drawn += 1;
for entry in entries {
let fixture = (&library, vertex);
drawn +=
usize::from(checked((&lane, &messages), fixture, entry, format, blend));
}
}
}
@@ -516,3 +578,38 @@ fn a_blended_fetch_of_another_format_stores_the_generic_blend() {
let _ = messages.take_notices();
quiet(lane, &messages);
}
/// A blend of the second source, read from the function's second output (the owned fixture
/// `fbl_fetch_dual`), into a 32-bit float, a 16-bit float, a 16-bit unorm and an 8-bit unorm
/// target: each draw announces `unmeasured-fetch-blend` and stores the model's channels, as above.
#[test]
fn a_second_source_blend_of_a_fetched_attachment_stores_the_generic_blend() {
let kind = Degradation::from_precision_note(PrecisionNote::UnmeasuredFetchBlend);
let (messages, _cache, lane) = lane_with(|options| {
options.announce_each = [kind].into_iter().collect();
});
let device = lane.device.name();
let library = library(&lane, "fbl_fetch_dual");
let formats = [
(PixelFormat::RGBA32Float, Layout::Float32),
(PixelFormat::RGBA16Float, Layout::Half16),
(PixelFormat::RGBA16Unorm, Layout::Unorm16),
(PixelFormat::RGBA8Unorm, Layout::Unorm8),
];
let mut drawn = 0;
for format in formats {
for entry in [("fbd_dual_half", true), ("fbd_dual_float", false)] {
let fixture = (&library, "fbd_vertex");
drawn += usize::from(checked(
(&lane, &messages),
fixture,
entry,
format,
Blend::Dual,
));
}
}
assert!(drawn > 0, "no draw on {device}");
let _ = messages.take_notices();
quiet(lane, &messages);
}
@@ -1162,22 +1162,18 @@ impl Blend {
/// channel the format lacks counts as written), computed by [`blend_generic`]: in `float`, each
/// factor, product and sum rounded to `float`, nearest even, a factor of zero keeping its
/// product as IEEE 754 adds, the forms of [`BlendMath::Rounded`] whatever the module's math. A
/// factor of the second source is not built (`Feature::ExtendedRangeBlend` `DualSource`).
/// factor of the second source reads the function's second (index 1) output.
pub fn generic(
eq: &BlendEquation,
has_alpha: bool,
written: ColorWriteMask,
) -> Result<Blend, Error> {
let b = planned_for(
planned_for(
eq,
(has_alpha, Family::HalfFloat),
written,
(false, BlendMath::Rounded),
)?;
match b.reads_second() {
true => Err(refused(ExtendedRangeBlend::DualSource)),
false => Ok(b),
}
)
}
/// Metal's blend `eq` of a four-lane output of a module of math `math`, blended in `arith`
@@ -2206,12 +2202,14 @@ pub fn blend_unorm8(
/// lane, a NaN to the low end), as a fixed-function blend clamps them; `color`, the encoder's blend
/// color (a `uvec4` of its `f32`s' bits, `PushField::HalfBlendColor`, where `b` reads it,
/// [`Blend::reads_constant`]), is what `BlendColor` reads, and `OneMinusBlendColor` reads one minus
/// it. Not Metal's arithmetic for the format, which is not built: a near-equivalent.
/// it; `s1`, the second source (a `vec4` of `f32`, the function's second output, where `b` reads
/// it, [`Blend::reads_second`]), is clamped as `s`. Not Metal's arithmetic for the format, which is
/// not built: a near-equivalent.
pub fn blend_generic(
fb: &mut FunctionBuilder<'_>,
b: &Blend,
range: Option<(f32, f32)>,
(s, d): (Value, Value),
(s, s1, d): (Value, Option<Value>, Value),
color: Option<Value>,
) -> BResult<Value> {
let f = floats();
@@ -2226,6 +2224,10 @@ pub fn blend_generic(
fb.glsl(GlslOp::FClamp, &[v, low, high])
};
let s = clamp(fb, s)?;
let s1 = match s1 {
Some(v) => Some(clamp(fb, v)?),
None => None,
};
let constant = match color {
Some(words) => {
let ft = ty(fb, f)?;
@@ -2243,7 +2245,7 @@ pub fn blend_generic(
constant,
sf: None,
math: BlendMath::Rounded,
s1: None,
s1,
arith: BlendArith::Float,
negates_one_minus: false,
};
+73 -35
View File
@@ -172,7 +172,7 @@
//! applies to a storage write, so the shader computes Metal's, whatever `DevicePolicy::half_blend`
//! says: the write reads the texel at the pixel inside the interlock, blends the function's `half`
//! or `float` output of one to four lanes over it (a second (index 1) output beside it, and a
//! factor of the second source, are not built: `ExtendedRangeBlend` `DualSource`), and stores the
//! factor of the second source, take the generic blend, below), and stores the
//! result (`extended_range::Blend::half_float`, [`half_blended`]). Metal's compiler appends the
//! blend to the function, in the output's type: a `half` output blends in `half` arithmetic, a
//! `float` one in `float`, its result converted to `half` as Metal's write of a `float` converts it
@@ -237,7 +237,7 @@
//! value), so the blend is Metal's wherever the module states its math (`HalfOutputPrecision` for
//! one naming none). A format without alpha's fast-math lerp, common factor or contracted pair
//! (Metal sums those in forms of their own) and an output of fewer lanes take the generic blend
//! (below); a factor of the second source and a second (index 1) output are not built.
//! (below), as do a factor of the second source and a second (index 1) output.
//!
//! **Another format's blend** (a format held directly whose channels read as floats, but a 16-bit
//! float, an sRGB, a word or an extended-range one: a 32-bit float, 16-bit normalized, 8-bit
@@ -254,8 +254,12 @@
//! texel. Metal's blend arithmetic for these formats is not measured: the function records
//! `PrecisionNote::UnmeasuredFetchBlend`. An attachment the function does not read (one a draw
//! moved into the storage form) does not take it: the variant is refused and the render pass
//! splits around the draw, whose blend is the device's. A factor of the second source is not
//! built (`ExtendedRangeBlend` `DualSource`).
//! splits around the draw, whose blend is the device's. A factor of the second source reads the
//! function's second (index 1) output, four `half` or `float` lanes, clamped as the first (Metal
//! makes and draws a pipeline that fetches and blends so; one whose function writes no second
//! output is refused, `ExtendedRangeBlend` `DualSource`). The generic blend also takes a 16-bit
//! float or 8-bit unorm attachment's blend of the second source, or beside a second output, whose
//! Metal arithmetic is not measured.
//!
//! A blocked attachment is refused with the blocker's reason (what the device lacks, or
//! `NotImplemented`): no ordered path exists there. The storage form
@@ -972,15 +976,20 @@ pub(crate) fn storage_form(
// where Metal's measured model holds it (`extended_range::Blend`), its gap refused by name.
// And the blend of a 16-bit float attachment, which no Vulkan blend applies to a storage
// write: the shader computes Metal's, in the arithmetic of a four-lane `half` or `float`
// output, which [`plan`] checks (`extended_range::Blend::half_float`).
// output, which [`plan`] checks (`extended_range::Blend::half_float`: every factor and
// operation but the second source's, which the generic blend below takes). A channel the
// format lacks counts as written, as [`plan`] plans it.
let kept_zero = use_.math == extended_range::blend::BlendMath::Rounded;
let half_blend =
half_float_format(pf) && attachment.blending_enabled && (!attachment.replaces || kept_zero);
let written_of_four = ColorWriteMask::ALL.difference(kept);
let half_blend = half_float_format(pf)
&& attachment.blending_enabled
&& (!attachment.replaces || kept_zero)
&& attachment.equation.is_some_and(|eq| {
extended_range::Blend::half_float(&eq, pf, written_of_four, use_.math).is_ok()
});
// And the blend of an 8-bit unorm attachment where Metal's measured model holds it
// (`extended_range::Blend::unorm8`: every factor and operation but the second source's, any
// write mask); its other blends stay the gap below. A channel the format lacks counts as
// written, as [`plan`] plans it.
let written_of_four = ColorWriteMask::ALL.difference(kept);
// write mask); its other blends take the generic blend below.
let half = extended_range::blend::BlendArith::Half;
let unorm8_blend = unorm8_format(pf)
&& attachment.blending_enabled
@@ -1556,18 +1565,33 @@ pub(super) fn plan(cx: &mut SelectCx<'_>) -> Result<(), Error> {
// The generic float blend of a format whose Metal arithmetic is not built, a
// near-equivalent the function notes: taken only where the function reads the
// attachment. Elsewhere the device blends it, as the render pass splits around the draw.
let generic_of = |view: StorageView, exact: &mut bool| match fetched.contains(&color) {
true => {
*exact = false;
Ok((
StorageView {
generic_blend: true,
..view
},
None,
))
// A blend of the second source reads the function's second (index 1) output, four `half`
// or `float` lanes as the first's.
let second = second_output4(cx, color)?;
let generic_of = |view: StorageView, exact: &mut bool| {
let reads_second = view
.blend
.and_then(|eq| generic(&eq, view.pixel_format, written(view.kept)).ok())
.is_some_and(|b| b.reads_second());
match (fetched.contains(&color), reads_second, second) {
(false, _, _) => Err(not_implemented()),
(true, true, None) => Err(Unsupported::not_implemented(
Feature::ExtendedRangeBlend(ExtendedRangeBlend::DualSource),
)),
(true, true, Some(None)) => Err(Unsupported::not_implemented(
Feature::ExtendedRangeBlend(ExtendedRangeBlend::Output),
)),
(true, _, _) => {
*exact = false;
Ok((
StorageView {
generic_blend: true,
..view
},
None,
))
}
}
false => Err(not_implemented()),
};
let form = match form {
Ok(view) if view.generic_blend => generic_of(view, &mut sixteen_exact),
@@ -1618,6 +1642,11 @@ pub(super) fn plan(cx: &mut SelectCx<'_>) -> Result<(), Error> {
}
(Some(Err(Error::Unsupported(gap))), _) => Err(gap),
(Some(Err(e)), _) => return Err(tied(e)),
// A second (index 1) output beside the first, which Metal's measured blends
// do not read: the generic blend, which stores it nowhere.
(Some(Ok(_)), None) if second.is_some() && view.word.is_none() => {
generic_of(view, &mut sixteen_exact)
}
_ => Err(not_implemented()),
}
}
@@ -1892,21 +1921,19 @@ pub(super) fn second_output4(
}
/// Whether the function's second (index-1) output to attachment `color` is the second source of
/// an extended-range blend the shader computes in the storage form ([`select_second_output`]),
/// which no interface variable holds.
/// an extended-range or generic blend the shader computes in the storage form
/// ([`select_second_output`]), which no interface variable holds.
pub(crate) fn blends_second(cx: &SelectCx<'_>, color: u32) -> bool {
cx.families
.fragment
.fetch
.get(&color)
.is_some_and(|sc| sc.view.extended.is_some() && sc.view.blend.is_some())
cx.families.fragment.fetch.get(&color).is_some_and(|sc| {
sc.view.blend.is_some() && (sc.view.extended.is_some() || sc.view.generic_blend)
})
}
/// Plan the second (index-1) output of AIR type `ty` held in field `field` of the returned value
/// to storage-form attachment `color`, whose extended-range blend the shader computes
/// ([`blends_second`]): the blend reads it where its factors name the second source, rounded to
/// `half` and clamped as the first output; else nothing stores it, as Metal's blend there reads
/// none.
/// to storage-form attachment `color`, whose extended-range or generic blend the shader computes
/// ([`blends_second`]): the blend reads it where its factors name the second source (an
/// extended-range one's rounded to `half`), clamped as the first output; else nothing stores it,
/// as Metal's blend there reads none.
pub fn select_second_output(
cx: &mut SelectCx<'_>,
field: u32,
@@ -2524,7 +2551,7 @@ pub(super) fn emit_return(
// blend of four, or the generic blend, over the texel.
let part = match sc.view.blend {
Some(eq) if sc.view.generic_blend => {
generic_blended(cx, fb, color, &sc, eq, (form, part))?
generic_blended(cx, fb, color, &sc, eq, (form, part), second)?
}
Some(eq) if unorm8_format(sc.view.pixel_format) => {
unorm8_blended(cx, fb, color, &sc, eq, (form, part))?
@@ -2704,7 +2731,8 @@ fn unorm8_blended(
/// ([`StorageView::generic_blend`], `extended_range::Blend::generic`): the texel read first at the
/// invocation's pixel (and sample), inside the interlock, in Metal's channel order
/// ([`read_texel`]), and the blend of the output's four lanes (a missing one zero) over it in
/// `float`, each factor, product and sum rounded, the source and the blend color (from
/// `float`, each factor, product and sum rounded, the source, the second source (`second`, the
/// function's second output, where the blend reads it) and the blend color (from
/// `PushField::HalfBlendColor` where the blend reads it) clamped first to a normalized format's
/// range, `[0, 1]` or `[-1, 1]` (`extended_range::blend::blend_generic`). The result keeps the
/// output's lanes; the device's conversion stores it, and the channels a write mask keeps are
@@ -2717,6 +2745,7 @@ fn generic_blended(
sc: &StorageColor,
eq: BlendEquation,
(form, part): (Form, SValue),
second: Option<(Form, SValue)>,
) -> BResult<SValue> {
if !matches!(form.float_fmt(), Some(FloatFmt::Half | FloatFmt::F32)) {
return Err(cx.fail("a generic blend of another output"));
@@ -2724,6 +2753,15 @@ fn generic_blended(
let Ok(b) = generic(&eq, sc.view.pixel_format, written(sc.view.kept)) else {
return Err(cx.fail("a generic blend outside its forms"));
};
let s1 = match (b.reads_second(), second) {
(true, Some((form, s1)))
if matches!(form.float_fmt(), Some(FloatFmt::Half | FloatFmt::F32)) =>
{
Some(four_lanes(fb, form, s1)?)
}
(true, _) => return Err(cx.fail("a blend of the second source without its output")),
(false, _) => None,
};
let texel = read_texel(cx, fb, color, sc)?;
let d = as_held(fb, texel, sc.view.numeric)?;
let constant = match b.reads_constant() {
@@ -2739,7 +2777,7 @@ fn generic_blended(
_ => None,
};
let s = four_lanes(fb, form, part)?;
let v = extended_range::blend::blend_generic(fb, &b, range, (s, d), constant)?;
let v = extended_range::blend::blend_generic(fb, &b, range, (s, s1, d), constant)?;
output_lanes(fb, form, v)
}
@@ -655,8 +655,8 @@ fn a_replacing_blend_and_a_write_that_stores_nothing_take_the_storage_form() {
/// window server's one over one minus the source alpha among the factors and operations Metal's
/// model holds, the blend color's difference with its one minus (under fast math Metal's form, the
/// minuend's product fused and the subtrahend's rounded), and a write mask that keeps some
/// channels. A factor of the second source is
/// refused by name. A read-only attachment, a replacing blend under fast math and a write that
/// channels. A factor of the second source takes the generic blend
/// (`StorageView::generic_blend`). A read-only attachment, a replacing blend under fast math and a write that
/// stores nothing take the form without one; a replacing blend without fast math keeps the
/// destination's product by zero, so the shader computes it.
#[test]
@@ -688,11 +688,6 @@ fn a_sixteen_bit_float_blend_is_computed_in_the_storage_form() {
(F::SourceAlphaSaturated, F::One, O::Add),
(F::One, F::One, O::Max),
];
let refused = |gap| {
Err(Unsupported::not_implemented(Feature::ExtendedRangeBlend(
gap,
)))
};
let partial = ColorWriteMask::RED.union(ColorWriteMask::ALPHA);
for stem in [
"moltenvk-m3",
@@ -724,12 +719,12 @@ fn a_sixteen_bit_float_blend_is_computed_in_the_storage_form() {
}
}
let what = format!("{stem} {pf:?} {math:?}");
// A blend of the second source, which Metal's model does not hold: the generic
// blend.
let dual = descriptor(pf, (F::Source1Color, F::Zero, O::Add), ColorWriteMask::ALL);
assert_eq!(
form(&of(dual), false, writes, &p),
refused(ExtendedRangeBlend::DualSource),
"{what}"
);
let view = form(&of(dual), false, writes, &p)
.unwrap_or_else(|e| panic!("{what}: dual: {e:?}"));
assert!(view.generic_blend, "{what}: dual");
let differs = descriptor(
pf,
(F::BlendColor, F::OneMinusBlendColor, O::Subtract),
@@ -2226,8 +2226,8 @@ pub fn entry(cx: &mut SelectCx<'_>) -> Result<(), Error> {
if cx.stage == Stage::Fragment && cx.inputs.rotated_factors.contains_key(&color) {
continue;
}
// The second source of an extended-range blend the shader computes in the storage
// form, which the blend reads from the returned value.
// The second source of an extended-range or generic blend the shader computes in the
// storage form, which the blend reads from the returned value.
if cx.stage == Stage::Fragment
&& crate::lower::fragment::blends_second_through_storage(cx, color)
{
+6 -4
View File
@@ -1762,8 +1762,10 @@ pub enum PrecisionNote {
/// through the pixel interlock), of a format whose blend arithmetic of Metal's the translation
/// does not build: a format held directly whose channels read as floats, but a 16-bit float
/// one, an sRGB one and an extended-range one (a 32-bit float, 16-bit normalized, 8-bit signed
/// normalized, 10-bit, packed float or `A8Unorm` format, among others), and an 8-bit unorm one
/// written by an output of fewer than four lanes. No Vulkan blend applies to a storage write,
/// normalized, 10-bit, packed float or `A8Unorm` format, among others), an 8-bit unorm one
/// written by an output of fewer than four lanes, and a 16-bit float or 8-bit unorm one under a
/// blend of the second source or beside a second (index 1) output. No Vulkan blend applies to
/// a storage write,
/// so the shader computes the pipeline's blend itself: in `float`, each factor, product and sum
/// rounded to nearest even, a factor of zero keeping its product, the source and the blend
/// color clamped first to a normalized format's range (`[0, 1]`, `[-1, 1]`; a NaN to its low
@@ -1772,8 +1774,8 @@ pub enum PrecisionNote {
/// recorded bound is not known; a blend in `float` of a 32-bit float format agrees with one
/// that fuses a product within that product's rounding, and one of a format of fewer bits than
/// a `float` within the format's own rounding of the result where Metal's arithmetic is at
/// least as fine. A factor of the second source is not built. Validation derives no tolerance
/// from it.
/// least as fine. A factor of the second source reads the function's second output, clamped as
/// the source. Validation derives no tolerance from it.
UnmeasuredFetchBlend,
}
@@ -13,9 +13,11 @@
//! pushes the blend color as `PushField::HalfBlendColor` exactly where the blend reads it, and its
//! module passes L3; the whole pipeline is made there for `RGBA32Float`, color 0 a written storage
//! attachment and no color attachment of the subpass, its stages passing L3 and its fragment stage
//! carrying the note. Before, each was refused `NotImplemented(FramebufferFetch)` at its color. A
//! blend that reads the second source stays refused, `NotImplemented(ExtendedRangeBlend
//! (DualSource))`. No GPU is used.
//! carrying the note. Before, each was refused `NotImplemented(FramebufferFetch)` at its color.
//! A blend that reads the second source, or any blend beside a second (index 1) output (the owned
//! fixture `engine/fbl_fetch_dual`), takes the generic blend too, a 16-bit float and an 8-bit
//! unorm attachment's among them; one of a function that writes no second output stays refused,
//! `NotImplemented(ExtendedRangeBlend(DualSource))`. No GPU is used.
//!
//! `llvm-as` assembles the fixtures; a missing tool skips visibly.
@@ -373,10 +375,69 @@ fn a_narrow_output_takes_the_generic_blend() {
assert!(checked > 0, "no interlock profile took the storage form");
}
/// A generic blend that reads the second source is not built: refused
/// `NotImplemented(ExtendedRangeBlend(DualSource))` at color 0, an 8-bit unorm one's too.
/// A blend of the second source, or any blend beside a second (index 1) output, of a function that
/// reads the attachment (the owned fixture `engine/fbl_fetch_dual`, under fast math and not): the
/// generic blend, which reads the second output where the blend names it, into a 32-bit float, a
/// 16-bit normalized, a 16-bit float and an 8-bit unorm attachment alike (Metal makes and draws
/// such pipelines; its blend of a 16-bit float or 8-bit unorm one with the second source is not
/// measured). Noted, its module valid.
#[test]
fn a_second_source_generic_blend_stays_refused() {
fn a_second_source_blend_takes_the_generic_blend() {
let (Some(fast), Some(safe)) = (
assembled("fbl_fetch_dual", false),
assembled("fbl_fetch_dual", true),
) else {
return;
};
use BlendFactor as F;
let formats = [
PixelFormat::RGBA32Float,
PixelFormat::RGBA16Unorm,
PixelFormat::RGBA16Float,
PixelFormat::RGBA8Unorm,
];
let equations = [
BlendEquation {
source_rgb: F::Source1Color,
destination_rgb: F::OneMinusSource1Color,
..OVER
},
BlendEquation {
source_alpha: F::Source1Alpha,
destination_alpha: F::OneMinusSource1Alpha,
..OVER
},
OVER,
];
let mut checked = 0;
for (stem, p) in committed_profiles().expect("profiles") {
if !crate::lower::fragment::interlock_orders(&p) {
continue;
}
for pf in formats {
for eq in equations {
let r = attachments(0, pf, eq, ColorWriteMask::ALL);
let inputs = state(0, &r, &p);
for bc in [&fast, &safe] {
for entry in ["fbd_dual_half", "fbd_dual_float"] {
let what = format!("{stem} {pf:?} {entry} {eq:?}");
let Some(a) = compiled(bc, entry, &p, &inputs, &what) else {
continue;
};
check_generic(&a, &p, (0, eq, false), &what);
checked += 1;
}
}
}
}
}
assert!(checked > 0, "no interlock profile took the storage form");
}
/// A blend of the second source of a function that writes no second output: refused
/// `NotImplemented(ExtendedRangeBlend(DualSource))` at color 0, whatever the format.
#[test]
fn a_second_source_blend_without_its_output_stays_refused() {
let Some(fast) = assembled("fbl_fetch_blend8", false) else {
return;
};
@@ -396,6 +457,13 @@ fn a_second_source_generic_blend_stays_refused() {
..OVER
},
),
(
PixelFormat::RGBA16Float,
BlendEquation {
destination_rgb: F::Source1Alpha,
..OVER
},
),
];
let mut checked = 0;
for (stem, p) in committed_profiles().expect("profiles") {
@@ -0,0 +1,185 @@
target triple = "air64_v29-apple-macosx27.0.0"
source_filename = "-"
; datalayout DataLayout { endian: Little, pointers: {0: PointerSpec { size_bits: 64, abi_bits: 64, pref_bits: 64, index_bits: 64 }}, ints: {1: AlignSpec { abi_bits: 8, pref_bits: 8 }, 8: AlignSpec { abi_bits: 8, pref_bits: 8 }, 16: AlignSpec { abi_bits: 16, pref_bits: 16 }, 32: AlignSpec { abi_bits: 32, pref_bits: 32 }, 64: AlignSpec { abi_bits: 64, pref_bits: 64 }}, floats: {16: AlignSpec { abi_bits: 16, pref_bits: 16 }, 32: AlignSpec { abi_bits: 32, pref_bits: 32 }, 64: AlignSpec { abi_bits: 64, pref_bits: 64 }, 128: AlignSpec { abi_bits: 128, pref_bits: 128 }}, vectors: {16: AlignSpec { abi_bits: 16, pref_bits: 16 }, 24: AlignSpec { abi_bits: 32, pref_bits: 32 }, 32: AlignSpec { abi_bits: 32, pref_bits: 32 }, 48: AlignSpec { abi_bits: 64, pref_bits: 64 }, 64: AlignSpec { abi_bits: 64, pref_bits: 64 }, 96: AlignSpec { abi_bits: 128, pref_bits: 128 }, 128: AlignSpec { abi_bits: 128, pref_bits: 128 }, 192: AlignSpec { abi_bits: 256, pref_bits: 256 }, 256: AlignSpec { abi_bits: 256, pref_bits: 256 }, 512: AlignSpec { abi_bits: 512, pref_bits: 512 }, 1024: AlignSpec { abi_bits: 1024, pref_bits: 1024 }}, aggregate: AlignSpec { abi_bits: 0, pref_bits: 64 }, native_ints: [8, 16, 32], stack_align_bits: None, alloca_space: 0, program_space: 0, globals_space: 0, mangling: None, fn_ptr_align: None, non_integral: [] }
%t3 = type <{ <4 x float> }>
%t5 = type %t3 (i32)
%t6 = type float (i32)
%t9 = type <{ <4 x half>, <4 x half> }>
%t11 = type %t9 (<4 x float>, <4 x half>, ptr addrspace(1), ptr addrspace(1))
%t12 = type i32 (float)
%t13 = type <{ <4 x float>, <4 x float> }>
%t14 = type %t13 (<4 x float>, <4 x float>, ptr addrspace(1), ptr addrspace(1))
%t16 = type [2 x i32]
c8 = %t16 [27, 0]
c24 = <2 x float> [0x40000000, 0x40000000]
c25 = <2 x float> [0xBF800000, 0xBF800000]
c28 = <4 x i32> [0, 1, poison, poison]
c32 = <4 x float> [poison, poison, 0x0, 0x3F800000]
c33 = <4 x i32> [0, 1, 6, 7]
define %t5 @f0 "fbd_vertex" memory(NoModRef, NoModRef, NoModRef) "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="0" "no-builtins"="" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" {
bb0:
%i0 = shl i32 %a0, i32 1
%i1 = and i32 %i0, i32 2
%i2 = tail call reassoc nnan ninf nsz arcp contract afn float @f1 [air Convert(Convert { dst: NumTy { elem: F32, lanes: 1 }, dst_kind: Float, src: NumTy { elem: I32, lanes: 1 }, src_kind: Unsigned, src_fp8: None })](%i1)
%i3 = insertelement <2 x float> undef, %i2, i64 0
%i4 = and i32 %a0, i32 2
%i5 = tail call reassoc nnan ninf nsz arcp contract afn float @f1 [air Convert(Convert { dst: NumTy { elem: F32, lanes: 1 }, dst_kind: Float, src: NumTy { elem: I32, lanes: 1 }, src_kind: Unsigned, src_fp8: None })](%i4)
%i6 = insertelement %i3, %i5, i64 1
%i7 = fmul reassoc nnan ninf nsz arcp contract afn <2 x float> %i6, <2 x float> c24
%i8 = fadd reassoc nnan ninf nsz arcp contract afn <2 x float> %i7, <2 x float> c25
%i9 = shufflevector <4 x float> %i8, <2 x float> poison, <0, 1, poison, poison>
%i10 = shufflevector <4 x float> %i9, <4 x float> c32, <0, 1, 6, 7>
%i11 = insertvalue %t3 undef %i10, 0
ret %i11
}
declare %t6 @f1 "air.convert.f.f32.u.i32" memory(NoModRef, NoModRef, NoModRef)
define %t11 @f2 "fbd_dual_half" memory(Ref, NoModRef, NoModRef) "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="128" "no-builtins"="" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" %a2( Ref nocapture "air-buffer-no-alias"="" ) %a3( Ref nocapture "air-buffer-no-alias"="" ) {
bb0:
%i0 = extractelement %a0, i64 1
%i1 = tail call i32 @f3 [air Convert(Convert { dst: NumTy { elem: I32, lanes: 1 }, dst_kind: Unsigned, src: NumTy { elem: F32, lanes: 1 }, src_kind: Float, src_fp8: None })](%i0)
%i2 = shl i32 %i1, i32 6
%i3 = extractelement %a0, i64 0
%i4 = tail call i32 @f3 [air Convert(Convert { dst: NumTy { elem: I32, lanes: 1 }, dst_kind: Unsigned, src: NumTy { elem: F32, lanes: 1 }, src_kind: Float, src_fp8: None })](%i3)
%i5 = add i32 %i2, %i4
%i6 = extractelement %a1, i64 3
%i7 = fcmp reassoc nnan ninf nsz arcp contract afn oeq %i6, half 0x0
%i8 = add i32 %i5, i32 4096
%i9 = select i32 %i7, %i8, %i5
%i10 = zext %i9 to i64
%i11 = getelementptr inbounds <4 x half>, %a2, %i10
%i12 = load <4 x half>, %i11, align 8
%i13 = getelementptr inbounds <4 x half>, %a3, %i10
%i14 = load <4 x half>, %i13, align 8
%i15 = insertvalue %t9 undef %i12, 0
%i16 = insertvalue %i15 %i14, 1
ret %i16
}
declare %t12 @f3 "air.convert.u.i32.f.f32" memory(NoModRef, NoModRef, NoModRef)
define %t14 @f4 "fbd_dual_float" memory(Ref, NoModRef, NoModRef) "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="128" "no-builtins"="" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" %a2( Ref nocapture "air-buffer-no-alias"="" ) %a3( Ref nocapture "air-buffer-no-alias"="" ) {
bb0:
%i0 = extractelement %a0, i64 1
%i1 = tail call i32 @f3 [air Convert(Convert { dst: NumTy { elem: I32, lanes: 1 }, dst_kind: Unsigned, src: NumTy { elem: F32, lanes: 1 }, src_kind: Float, src_fp8: None })](%i0)
%i2 = shl i32 %i1, i32 6
%i3 = extractelement %a0, i64 0
%i4 = tail call i32 @f3 [air Convert(Convert { dst: NumTy { elem: I32, lanes: 1 }, dst_kind: Unsigned, src: NumTy { elem: F32, lanes: 1 }, src_kind: Float, src_fp8: None })](%i3)
%i5 = add i32 %i2, %i4
%i6 = extractelement %a1, i64 3
%i7 = fcmp reassoc nnan ninf nsz arcp contract afn oeq %i6, float 0x0
%i8 = add i32 %i5, i32 4096
%i9 = select i32 %i7, %i8, %i5
%i10 = zext %i9 to i64
%i11 = getelementptr inbounds <4 x float>, %a2, %i10
%i12 = load <4 x float>, %i11, align 16
%i13 = getelementptr inbounds <4 x float>, %a3, %i10
%i14 = load <4 x float>, %i13, align 16
%i15 = insertvalue %t13 undef %i12, 0
%i16 = insertvalue %i15 %i14, 1
ret %i16
}
!md0 = !"SDK Version"
!md1 = !"wchar_size"
!md2 = !"frame-pointer"
!md3 = !"air.max_device_buffers"
!md4 = !"air.max_constant_buffers"
!md5 = !"air.max_threadgroup_buffers"
!md6 = !"air.max_textures"
!md7 = !"air.max_read_write_textures"
!md8 = !"air.max_samplers"
!md9 = !"air.position"
!md10 = !"air.arg_type_name"
!md11 = !"float4"
!md12 = !"air.arg_name"
!md13 = !"position"
!md14 = !"air.vertex_id"
!md15 = !"uint"
!md16 = !"vid"
!md17 = !"air.render_target"
!md18 = !"half4"
!md19 = !"color"
!md20 = !"second"
!md21 = !"air.center"
!md22 = !"air.no_perspective"
!md23 = !"dst"
!md24 = !"air.buffer"
!md25 = !"air.location_index"
!md26 = !"air.read"
!md27 = !"air.address_space"
!md28 = !"air.arg_type_size"
!md29 = !"air.arg_type_align_size"
!md30 = !"src"
!md31 = !"air.compile.denorms_disable"
!md32 = !"air.compile.fast_math_enable"
!md33 = !"air.compile.framebuffer_fetch_enable"
!md34 = !"Apple metal version 32023.921 (metalfe-32023.921.6)"
!md35 = !"Metal"
!md36 = !"omnipotent char"
!md37 = !"Simple C++ TBAA"
!md38 = !"air-alias-scope-arg(2)"
!md39 = !"air-alias-scope-arg(3)"
!md40 = i32 2
!md41 = %t16 c8
!md42 = i32 1
!md43 = i32 4
!md44 = i32 7
!md45 = i32 31
!md46 = i32 128
!md47 = i32 8
!md48 = i32 16
!md49 = ptr addrspace(0) @f0
!md50 = i32 0
!md51 = ptr addrspace(0) @f2
!md52 = i32 3
!md53 = ptr addrspace(0) @f4
!md54 = i32 9
!md55 = i64 0
!md56 = !{!md40, !md0, !md41}
!md57 = !{!md42, !md1, !md43}
!md58 = !{!md44, !md2, !md40}
!md59 = !{!md44, !md3, !md45}
!md60 = !{!md44, !md4, !md45}
!md61 = !{!md44, !md5, !md45}
!md62 = !{!md44, !md6, !md46}
!md63 = !{!md44, !md7, !md47}
!md64 = !{!md44, !md8, !md48}
!md65 = !{!md9, !md10, !md11, !md12, !md13}
!md66 = !{!md65}
!md67 = !{!md50, !md14, !md10, !md15, !md12, !md16}
!md68 = !{!md67}
!md69 = !{!md49, !md66, !md68}
!md70 = !{!md17, !md50, !md50, !md10, !md18, !md12, !md19}
!md71 = !{!md17, !md50, !md42, !md10, !md18, !md12, !md20}
!md72 = !{!md70, !md71}
!md73 = !{!md50, !md9, !md21, !md22, !md10, !md11, !md12, !md13}
!md74 = !{!md42, !md17, !md50, !md10, !md18, !md12, !md23}
!md75 = !{!md40, !md24, !md25, !md50, !md42, !md26, !md27, !md42, !md28, !md47, !md29, !md47, !md10, !md18, !md12, !md30}
!md76 = !{!md52, !md24, !md25, !md42, !md42, !md26, !md27, !md42, !md28, !md47, !md29, !md47, !md10, !md18, !md12, !md20}
!md77 = !{!md73, !md74, !md75, !md76}
!md78 = !{!md51, !md72, !md77}
!md79 = !{!md17, !md50, !md50, !md10, !md11, !md12, !md19}
!md80 = !{!md17, !md50, !md42, !md10, !md11, !md12, !md20}
!md81 = !{!md79, !md80}
!md82 = !{!md42, !md17, !md50, !md10, !md11, !md12, !md23}
!md83 = !{!md40, !md24, !md25, !md50, !md42, !md26, !md27, !md42, !md28, !md48, !md29, !md48, !md10, !md11, !md12, !md30}
!md84 = !{!md52, !md24, !md25, !md42, !md42, !md26, !md27, !md42, !md28, !md48, !md29, !md48, !md10, !md11, !md12, !md20}
!md85 = !{!md73, !md82, !md83, !md84}
!md86 = !{!md53, !md81, !md85}
!md87 = !{!md31}
!md88 = !{!md32}
!md89 = !{!md33}
!md90 = !{!md34}
!md91 = !{!md40, !md54, !md50}
!md92 = !{!md35, !md43, !md42, !md50}
!md93 = !{!md37}
!md94 = !{!md36, !md93, !md55}
!"llvm.module.flags" = !{!md56, !md57, !md58, !md59, !md60, !md61, !md62, !md63, !md64}
!"air.vertex" = !{!md69}
!"air.fragment" = !{!md78, !md86}
!"air.compile_options" = !{!md87, !md88, !md89}
!"llvm.ident" = !{!md90}
!"air.version" = !{!md91}
!"air.language_version" = !{!md92}
@@ -705,6 +705,12 @@ engine/fbl_fetch_blend8_safe.ll fbl8_safe_vertex ok ok ok ok ok ok ok ok ok ok o
engine/fbl_fetch_blend8_safe.ll fbl8_safe_loaded NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} ok ok NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} ok Unsupported{FramebufferFetch; AnyOf[[Feature(RasterizationOrderColorAttachmentAccess)], [Feature(FragmentShaderPixelInterlock)]]} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} Unsupported{FramebufferFetch; AnyOf[[Feature(RasterizationOrderColorAttachmentAccess)], [Feature(FragmentShaderPixelInterlock)]]} ok Unsupported{FramebufferFetch; AnyOf[[Feature(RasterizationOrderColorAttachmentAccess)], [Feature(FragmentShaderPixelInterlock), Feature(FragmentStoresAndAtomics)]]}
engine/fbl_fetch_blend8_safe.ll fbl8_safe_loaded_float NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} ok ok NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} ok Unsupported{FramebufferFetch; AnyOf[[Feature(RasterizationOrderColorAttachmentAccess)], [Feature(FragmentShaderPixelInterlock)]]} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} Unsupported{FramebufferFetch; AnyOf[[Feature(RasterizationOrderColorAttachmentAccess)], [Feature(FragmentShaderPixelInterlock)]]} ok Unsupported{FramebufferFetch; AnyOf[[Feature(RasterizationOrderColorAttachmentAccess)], [Feature(FragmentShaderPixelInterlock), Feature(FragmentStoresAndAtomics)]]}
engine/fbl_fetch_blend8_safe.ll fbl8_safe_product NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} ok ok NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} ok Unsupported{FramebufferFetch; AnyOf[[Feature(RasterizationOrderColorAttachmentAccess)], [Feature(FragmentShaderPixelInterlock)]]} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} Unsupported{FramebufferFetch; AnyOf[[Feature(RasterizationOrderColorAttachmentAccess)], [Feature(FragmentShaderPixelInterlock)]]} ok Unsupported{FramebufferFetch; AnyOf[[Feature(RasterizationOrderColorAttachmentAccess)], [Feature(FragmentShaderPixelInterlock), Feature(FragmentStoresAndAtomics)]]}
engine/fbl_fetch_dual.air.ll fbd_vertex ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok
engine/fbl_fetch_dual.air.ll fbd_dual_half NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} ok ok NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} ok Unsupported{FramebufferFetch; AnyOf[[Feature(RasterizationOrderColorAttachmentAccess)], [Feature(FragmentShaderPixelInterlock)]]} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} Unsupported{DualSourceBlending; AnyOf[[Feature(DualSrcBlend)]]} Unsupported{DualSourceBlending; AnyOf[[Feature(DualSrcBlend)]]} Unsupported{DualSourceBlending; AnyOf[[Feature(DualSrcBlend)]]}
engine/fbl_fetch_dual.air.ll fbd_dual_float NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} ok ok NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} ok Unsupported{FramebufferFetch; AnyOf[[Feature(RasterizationOrderColorAttachmentAccess)], [Feature(FragmentShaderPixelInterlock)]]} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} Unsupported{DualSourceBlending; AnyOf[[Feature(DualSrcBlend)]]} Unsupported{DualSourceBlending; AnyOf[[Feature(DualSrcBlend)]]} Unsupported{DualSourceBlending; AnyOf[[Feature(DualSrcBlend)]]}
engine/fbl_fetch_dual.ll fbd_vertex ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok
engine/fbl_fetch_dual.ll fbd_dual_half NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} ok ok NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} ok Unsupported{FramebufferFetch; AnyOf[[Feature(RasterizationOrderColorAttachmentAccess)], [Feature(FragmentShaderPixelInterlock)]]} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} Unsupported{DualSourceBlending; AnyOf[[Feature(DualSrcBlend)]]} Unsupported{DualSourceBlending; AnyOf[[Feature(DualSrcBlend)]]} Unsupported{DualSourceBlending; AnyOf[[Feature(DualSrcBlend)]]}
engine/fbl_fetch_dual.ll fbd_dual_float NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} ok ok NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} ok Unsupported{FramebufferFetch; AnyOf[[Feature(RasterizationOrderColorAttachmentAccess)], [Feature(FragmentShaderPixelInterlock)]]} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} NeedsInput{FramebufferFetch} Unsupported{DualSourceBlending; AnyOf[[Feature(DualSrcBlend)]]} Unsupported{DualSourceBlending; AnyOf[[Feature(DualSrcBlend)]]} Unsupported{DualSourceBlending; AnyOf[[Feature(DualSrcBlend)]]}
engine/fca_fragment_absent_inputs.air.ll fca_fragment_absent_inputs ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok
engine/fca_fragment_absent_inputs.ll fca_fragment_absent_inputs ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok ok
engine/fca_kernel_absent_builtin.air.ll fca_kernel_absent_builtin ok ok ok ok ok 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.
+6 -4
View File
@@ -2474,13 +2474,15 @@ fast forms record, and each `PrecisionNote`'s rustdoc states its bound.
framebuffer fetch only through the pixel interlock (MoltenVK, RADV, ANV), of a format whose Metal
blend arithmetic is not built: a format whose channels read as floats but a 16-bit float, an
sRGB and an extended-range one (a 32-bit float, 16-bit normalized, 8-bit signed normalized,
10-bit, packed float or `A8Unorm` format, among others), or an 8-bit unorm one written by an
output of fewer than four lanes. No Vulkan blend applies to the storage write, so the shader
10-bit, packed float or `A8Unorm` format, among others), an 8-bit unorm one written by an
output of fewer than four lanes, or a 16-bit float or 8-bit unorm one under a blend of the second
source or beside a second (index 1) output. No Vulkan blend applies to the storage write, so the
shader
computes the pipeline's blend in `float`: each factor, product and sum rounded to nearest even,
the source and the blend color clamped first to a normalized format's range (a NaN to its low
end), an output's missing lane zero, and the result stored through the device's conversion.
Metal's blend arithmetic for these formats is not measured, so the bound is not known. A blend
of the second source there is refused.
Metal's blend arithmetic for these formats is not measured, so the bound is not known. A factor
of the second source reads the function's second output, clamped as the source.
- `metal2vulkan-degrade-fp8-value` (precision). `PrecisionNote::Fp8Value`: An 8-bit float converts
to an integer from the format's documented value with Metal's saturating float-to-integer rule,
where Metal's device here answers otherwise: Metal on Apple M3 compiles these reads but extends
+5 -4
View File
@@ -72,7 +72,7 @@ known. The rest of the differences are docs/API.md section 9's precision notes.
| Signed zeros, infinities and NaNs where the device lacks `SignedZeroInfNanPreserve` at the operation's width. | A device capability. | `DeviceSignedZeroInfNan` (`device-signed-zero-inf-nan`) |
| Every device but MoltenVK interpolates varyings by its own rounding, up to about `1.5e-4` from Metal's (`3e-4` on lavapipe). MoltenVK hands the varyings to Metal. | The exact path needs Metal's interpolation formula, which is not known. | `DeviceInterpolation` (`device-interpolation`) |
| A fast-math function's `half` color into a blend: within three `half` ulps (16-bit float) or two `float` ulps (32-bit float). A fetched 16-bit float attachment's blend, computed in the pixel interlock, where Metal folds the output's own arithmetic into it or regroups it: within 2 `half` ulps at the operands' magnitude, 16 at the stored value's under cancellation; exact elsewhere. | Metal's compiler regroups the blend per pipeline, following its passes over the whole function; no form the function and the blend state decide is Metal's. | `HalfOutputFastMathBlend` (`half-output-fast-math-blend`) |
| A fetched blended attachment of a format whose Metal blend arithmetic is not built (32-bit float, 16-bit normalized, 8-bit signed normalized, 10-bit, packed float, `A8Unorm`; an 8-bit unorm one through fewer than four output lanes), on a device that orders fetch only through the pixel interlock (MoltenVK, RADV, ANV): the shader blends in `float`, each step rounded, the source and blend color clamped to a normalized format's range, the device's conversion storing the result. Bound not measured. | No Vulkan blend applies to the interlock's storage write, and Metal's blend arithmetic for these formats is not measured, so no exact form is known. | `UnmeasuredFetchBlend` (`unmeasured-fetch-blend`) |
| A fetched blended attachment of a format whose Metal blend arithmetic is not built (32-bit float, 16-bit normalized, 8-bit signed normalized, 10-bit, packed float, `A8Unorm`; an 8-bit unorm one through fewer than four output lanes; a 16-bit float or 8-bit unorm one under a blend of the second source), on a device that orders fetch only through the pixel interlock (MoltenVK, RADV, ANV): the shader blends in `float`, each step rounded, the source and blend color clamped to a normalized format's range, the device's conversion storing the result. Bound not measured. | No Vulkan blend applies to the interlock's storage write, and Metal's blend arithmetic for these formats is not measured, so no exact form is known. | `UnmeasuredFetchBlend` (`unmeasured-fetch-blend`) |
| Float simdgroup reductions sum in the device's association order. | Apple's order is not modelled. | `ReductionOrder` (`reduction-order`) |
| A vertex or fragment function keeps more than 16 KiB a thread of private memory, up to the 192 KiB Metal holds, on a device whose Function storage was not measured: it runs on the driver's scratch, which past what the driver holds answers wrongly or hangs the GPU with no error. | Vulkan states no amount of Function storage; only a measurement of the device does. No other form is exact: a fragment function's helper invocations may not write the memory it would move to, and a vertex function's, a compute pre-pass, is not built. | `FunctionStorageAssumed` (`function-storage-assumed`) |
| A render pipeline of more color attachments than the device draws at once (the lesser of `maxColorAttachments` and `maxFragmentOutputAttachments`, four at Vulkan's floor; Metal takes eight) draws each draw once per group of that many, each group in a render pass of its own over a twin of the pass's depth and stencil. Every variant's vertex stage is one module, `Position` invariant, and every fragment variant's `FragDepth`, `SampleMask` and `FragStencilRefEXT` are `Invariant`; groups past the first may differ at discard or depth edges if the driver compiles the variants differently. | The device holds no more attachments in one subpass. Vulkan's invariance rules make only identical pipelines repeat exactly, and the groups' fragment modules and attachments differ. | `ColorAttachmentGroups` (`color-attachment-groups`) |
@@ -530,9 +530,10 @@ driver's. Each is open work.
for an extended-range or 16-bit float attachment, and for an 8-bit unorm one (`R8Unorm`,
`RG8Unorm`, `RGBA8Unorm`, `BGRA8Unorm`) of a four-lane output under any factor, operation,
write mask and blend color; the generic `float` blend, announced (`UnmeasuredFetchBlend`, the
row above), for every other format whose channels read as floats. Refused: a factor of the
second source (`ExtendedRangeBlend`, `DualSource`), and a blend into an 8-bit `_sRGB` format
(`FramebufferFetch`, `NotImplemented`). A source-over survey on the M3 fits the 8-bit model to
row above), for every other format whose channels read as floats and for a blend of the second
source. Refused: a blend into an 8-bit `_sRGB` format (`FramebufferFetch`, `NotImplemented`),
and a blend of the second source by a function that writes no second output (`ExtendedRangeBlend`,
`DualSource`). A source-over survey on the M3 fits the 8-bit model to
the 10-bit unorm and 8-bit snorm formats (with their clamps), and shows the 16-bit norms and
`RGBA32Float` blending in `float` even for a `half4` output; their factor sets are not measured,
so their exact forms are not built.
+11 -11
View File
@@ -14,7 +14,7 @@ Columns:
- `none`: no public API path: malformed or non-Metal input, Apple-private calls, or a cap no valid program of ordinary size meets;
- `?`: not assessed yet.
Generated at `ca047b755`.
Generated at `129bf087e`.
## Totals
@@ -135,7 +135,7 @@ Generated at `ca047b755`.
| `TextureSwizzle` | A texture swizzle whose Metal behavior is not measured | devices short of a Vulkan feature the site names; every device (not implemented) | 7: `crates/metal2vulkan-runtime/src/binding_view.rs:167`, `crates/metal2vulkan-runtime/src/texture.rs:996` (+5) | `app`: texture swizzles whose Metal behaviour is unmeasured |
| `MipmapGeneration` | `generateMipmapsForTexture:` where the device's filter is not shown to give Metal's answer | devices without VkFeature::ShaderInt64; devices without a format's usage; every device (not implemented) | 7: `crates/metal2vulkan-runtime/src/blit_texture.rs:1850`, `crates/metal2vulkan-runtime/src/mipmap_pick.rs:37` (+5) | `app`: generateMipmapsForTexture: where the device's filter is not Metal's |
| `HostMemory` | A buffer over the caller's host memory without a copy (`newBufferWithBytesNoCopy:`) | devices without VkExtension::ExtExternalMemoryHost; every device (no Vulkan mechanism); every device (not implemented) | 5: `crates/metal2vulkan-runtime/src/host_memory.rs:430`, `crates/metal2vulkan-runtime/src/host_memory.rs:470` (+3) | `system`: newBufferWithBytesNoCopy: where the device cannot import the memory |
| `GpuTimes` | A command buffer's GPU times (`GPUStartTime`, `GPUEndTime`) on a device whose queue family writes no timestamps (`timestampValidBits` 0) | every device (no Vulkan mechanism) | 1: `crates/metal2vulkan-runtime/src/command_buffer/mod.rs:2814` | `rare`: GPU times on a queue without timestamps |
| `GpuTimes` | A command buffer's GPU times (`GPUStartTime`, `GPUEndTime`) on a device whose queue family writes no timestamps (`timestampValidBits` 0) | every device (no Vulkan mechanism) | 1: `crates/metal2vulkan-runtime/src/command_buffer/mod.rs:2783` | `rare`: GPU times on a queue without timestamps |
| `CountingVisibility` | A `Counting` visibility result (`MTLVisibilityResultModeCounting`) on a device without `occlusionQueryPrecise` | devices without VkFeature::OcclusionQueryPrecise | 1: `crates/metal2vulkan-runtime/src/visibility.rs:452` | `rare`: counting occlusion queries on a device without precise queries |
| `ViewFormatReinterpretation` | A texture view whose format has other components, or components of other widths, than its texture's (`RGBA8Unorm` as `R32Uint`), on a device whose... | every device (no Vulkan mechanism) | 1: `crates/metal2vulkan-runtime/src/view_plan.rs:570` | `app`: a view of another component layout on a portability subset (MoltenVK) |
| `SeparateMultisampledDepthStencil` | A render pass whose depth and stencil attachments are separate multisampled textures that it loads or may store, on a device without maintenance8,... | - | via a helper: 7: `crates/metal2vulkan-runtime/src/depth_stencil_scratch.rs:188`, `crates/metal2vulkan-runtime/src/depth_stencil_scratch.rs:294` (+5) | `rare`: separate multisampled depth and stencil textures |
@@ -153,7 +153,7 @@ Generated at `ca047b755`.
| `IndirectRenderState` | A render state a function sets on an indirect render command (`render_command::set_cull_mode`, `set_front_facing_winding`,... | every device (not implemented) | 1: `crates/metal2vulkan/src/lower/access/encode.rs:568` | `rare`: render state set by a kernel on an indirect command |
| `GlobalBuiltinInFragment` | A fragment function's read of a Metal 3.1 program-scope built-in variable that Metal does not lower there | every device (not implemented) | 1: `crates/metal2vulkan/src/lower/select.rs:912` | `rare`: Metal 3.1 global built-ins in fragment functions |
| `PrivateRenderState` | A private fixed-function property of Metal's pipeline descriptor (Apple SPI, OpenGL on Metal's) set to a value whose effect the translation has... | devices without VkFeature::LogicOp; every device (not implemented) | 7: `crates/metal2vulkan/src/bind/heap.rs:1300`, `crates/metal2vulkan/src/bind/plan/resources.rs:887` (+5) | `none`: Apple-private pipeline fields of OpenGL on Metal (no public header) |
| `ExtendedRangeBlend` | Metal's blend into an extended-range attachment (`BGRA10_XR`, `BGR10_XR`, `RGB10A8_2P_XR10` and their `_sRGB` twins), which the function computes... | every device (not implemented) | 4: `crates/metal2vulkan/src/lower/arith/extended_range/blend.rs:305`, `crates/metal2vulkan/src/lower/fragment/fetch.rs:1629` (+2) | `system`: the parts of a blend into an extended-range (XR10) attachment the measured model does not hold (second-source factors, the color blend color difference, a one-color-channel mask, float4 and sRGB outside the measured forms); the consumer's guests blend RGB10A8_2P_XR10 attachments |
| `ExtendedRangeBlend` | Metal's blend into an extended-range attachment (`BGRA10_XR`, `BGR10_XR`, `RGB10A8_2P_XR10` and their `_sRGB` twins), which the function computes... | every device (not implemented) | 6: `crates/metal2vulkan/src/lower/arith/extended_range/blend.rs:305`, `crates/metal2vulkan/src/lower/fragment/fetch.rs:1578` (+4) | `system`: the parts of a blend into an extended-range (XR10) attachment the measured model does not hold (second-source factors, the color blend color difference, a one-color-channel mask, float4 and sRGB outside the measured forms); the consumer's guests blend RGB10A8_2P_XR10 attachments |
| `TileReach` | The tiles a render pass's primitives reach, binned on the device ([`tile_reach_module`](crate::bind::tile_reach_module)), on a device without what... | devices short of a Vulkan feature the site names; devices without a capability the site computes (`vec![int64]`); every device (not implemented) | 3: `crates/metal2vulkan/src/bind/tile_reach.rs:270`, `crates/metal2vulkan/src/lower/stage_io/plan.rs:2517` (+1) | `app`: the tiles a pass's draws reach, binned on a device without shaderInt64 |
| `ProgramScopeBinding` | A program-scope buffer binding of MSL 3.2 (macOS 15 and later), `constant T* constant p [[buffer(n)]];` in Apple's `!air.global_bindings` list,... | - | via a helper: 2: `crates/metal2vulkan-air/src/abi/module.rs:77`, `crates/metal2vulkan/src/error/mod.rs:267` | `app`: MSL 3.2 program-scope buffer bindings (macOS 15 and later) |
| `SeqCstFence` | A sequentially consistent fence (`seq_cst` `atomic_thread_fence`, an LLVM `fence seq_cst`, or a `seq_cst` barrier ordering device memory), whose... | devices short of a Vulkan feature the site names | 1: `crates/metal2vulkan/src/lower/sync/barrier.rs:443` | `rare`: a seq_cst fence in a vertex or fragment stage without its stores and atomics |
@@ -172,7 +172,7 @@ Generated at `ca047b755`.
| `HeapTextureMemory` | A heap texture whose image the heap's memory type does not take | every device (runtime piece not built) | 5: `crates/metal2vulkan-runtime/src/texture/heap.rs:1510`, `crates/metal2vulkan-runtime/src/texture/heap.rs:1517` (+3) | `app`: a heap texture the heap's memory type does not take |
| `FunctionTablePastMaxBufferLength` | A visible-function table of more entries than one buffer of the device's `max_buffer_length` holds words for, or than its size word holds | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/function_table.rs:622` | `none`: a function table past one buffer |
| `IndirectCommandBufferPastMaxBufferLength` | An indirect command buffer of more commands than one buffer of the device's `max_buffer_length` holds the records of | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/indirect_command_buffer.rs:522` | `none`: an ICB past one buffer |
| `IndirectRenderCommands` | What indirect command buffers lack of their render commands | every device (runtime piece not built) | 15: `crates/metal2vulkan-runtime/src/compute.rs:1144`, `crates/metal2vulkan-runtime/src/compute.rs:1225` (+13) | `rare`: indirect render commands' remaining pieces |
| `IndirectRenderCommands` | What indirect command buffers lack of their render commands | every device (runtime piece not built) | 16: `crates/metal2vulkan-runtime/src/compute.rs:1144`, `crates/metal2vulkan-runtime/src/compute.rs:1225` (+14) | `rare`: indirect render commands' remaining pieces |
| `IndirectImageblockSize` | An indirect compute command's imageblock side past 65535, which Metal keeps | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/indirect_command_buffer.rs:3363` | `none`: an imageblock side past 65535 |
| `CommandReplay` | The device replay of indirect command buffers | every device (runtime piece not built) | 2: `crates/metal2vulkan-runtime/src/binding.rs:723`, `crates/metal2vulkan-runtime/src/binding.rs:726` | `rare`: the device replay of indirect command buffers |
| `RenderAttachments` | Render attachments and their binding forms | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/binding.rs:1794` | `rare`: render attachment forms not built |
@@ -235,7 +235,7 @@ Generated at `ca047b755`.
| Variant | What it blocks | Where | Sites | Reach |
|---|---|---|---|---|
| `ProtectedContent` | Protection options whose answer on Metal is not measured (`command_buffer/protection.rs`) | every device (Apple-private, Metal's answer not measured) | 3: `crates/metal2vulkan-runtime/src/command_buffer/mod.rs:2372`, `crates/metal2vulkan-runtime/src/command_buffer/protection.rs:126` (+1) | `none`: Apple-private (no public header) |
| `ProtectedContent` | Protection options whose answer on Metal is not measured (`command_buffer/protection.rs`) | every device (Apple-private, Metal's answer not measured) | 3: `crates/metal2vulkan-runtime/src/command_buffer/mod.rs:2358`, `crates/metal2vulkan-runtime/src/command_buffer/protection.rs:126` (+1) | `none`: Apple-private (no public header) |
| `LineWidth` | A line width other than 1 (`setLineWidth:`) | every device (Apple-private, Metal's answer not measured) | 1: `crates/metal2vulkan-runtime/src/apple_only.rs:189` | `none`: Apple-private (no public header) |
| `ViewportTransformDisabled` | The viewport transform turned off (`setViewportTransformEnabled:NO`) | every device (Apple-private, Metal's answer not measured) | 1: `crates/metal2vulkan-runtime/src/apple_only.rs:191` | `none`: Apple-private (no public header) |
| `VertexAmplificationMode` | `setVertexAmplificationMode:value:` of a count (the value's set bits in mode 1, else the value) of 0, whose copies change from run to run on... | every device (Apple-private, Metal's answer not measured) | 2: `crates/metal2vulkan-runtime/src/apple_only.rs:195`, `crates/metal2vulkan-runtime/src/apple_only.rs:312` | `none`: Apple-private (no public header) |
@@ -330,7 +330,7 @@ Each refusal's sites, with the function that builds it.
- `feature::BufferRange`: `crates/metal2vulkan-runtime/src/function_table.rs:569 (past_storage_buffer_range)`; `crates/metal2vulkan/src/bind/graphics.rs:3658 (patch_binding)`; `crates/metal2vulkan/src/bind/graphics.rs:3702 (patch_binding)`; `crates/metal2vulkan/src/bind/graphics.rs:3740 (patch_binding)`; `crates/metal2vulkan/src/bind/instantiate.rs:659 (bind_buffers)`; `crates/metal2vulkan/src/lower/access/function_table.rs:226 (select)`; `crates/metal2vulkan/src/lower/access/mod.rs:1184 (place_slots)`
- `feature::Int64Arithmetic`: `crates/metal2vulkan/src/lower/arith/legal.rs:582 (check_scalar)`; `crates/metal2vulkan/src/lower/select.rs:1133 (selector_form)`
- `feature::Float64Arithmetic`: `crates/metal2vulkan/src/device/metal.rs:230 (unsupported_features)`; `crates/metal2vulkan/src/lower/arith/legal.rs:587 (check_scalar)`
- `feature::Format`: `crates/metal2vulkan-runtime/src/binding_view.rs:146 (binding_view)`; `crates/metal2vulkan-runtime/src/blit_plan.rs:523 (check_formats)`; `crates/metal2vulkan-runtime/src/blit_plan.rs:530 (check_formats)`; `crates/metal2vulkan-runtime/src/blit_plan.rs:545 (check_formats)`; `crates/metal2vulkan-runtime/src/blit_plan.rs:602 (pair_unit)`; `crates/metal2vulkan-runtime/src/blit_plan.rs:694 (plan_levels_copy)`; `crates/metal2vulkan-runtime/src/blit_texture.rs:2150 (through_buffer)`; `crates/metal2vulkan-runtime/src/buffer_texture.rs:519 (make_texture_over)`; `crates/metal2vulkan-runtime/src/buffer_texture.rs:582 (make_texture_over)`; `crates/metal2vulkan-runtime/src/buffer_texture.rs:614 (make_texture_over)`; `crates/metal2vulkan-runtime/src/buffer_texture.rs:851 (texture_buffer_texel)`; `crates/metal2vulkan-runtime/src/copy_plan.rs:270 (colour_unit)`; `crates/metal2vulkan-runtime/src/copy_plan.rs:298 (copy_unit)`; `crates/metal2vulkan-runtime/src/copy_plan.rs:344 (copy_unit)`; `crates/metal2vulkan-runtime/src/depth_stencil_scratch.rs:346 (scratch)`; `crates/metal2vulkan-runtime/src/depth_stencil_scratch.rs:526 (usable_twin)`; `crates/metal2vulkan-runtime/src/families/features.rs:1625 (read_write_tier)`; `crates/metal2vulkan-runtime/src/families/formats.rs:1628 (sparse_missing)`; `crates/metal2vulkan-runtime/src/families/formats.rs:227 (none)`; `crates/metal2vulkan-runtime/src/families/formats.rs:271 (answers)`; `crates/metal2vulkan-runtime/src/families/formats.rs:291 (answers)`; `crates/metal2vulkan-runtime/src/families/formats.rs:306 (answers)`; `crates/metal2vulkan-runtime/src/families/formats.rs:353 (answers)`; `crates/metal2vulkan-runtime/src/families/formats.rs:392 (answers)`; `crates/metal2vulkan-runtime/src/families/formats.rs:474 (atomic_gap)`; `crates/metal2vulkan-runtime/src/families/formats.rs:508 (lacking)`; `crates/metal2vulkan-runtime/src/families/formats.rs:522 (unsupported)`; `crates/metal2vulkan-runtime/src/image_plan.rs:544 (check_own_memory)`; `crates/metal2vulkan-runtime/src/image_plan.rs:670 (plan_held)`; `crates/metal2vulkan-runtime/src/image_plan.rs:787 (plan_held)`; `crates/metal2vulkan-runtime/src/image_plan.rs:907 (plan_held)`; `crates/metal2vulkan-runtime/src/render.rs:2292 (viewing)`; `crates/metal2vulkan-runtime/src/render_pass.rs:1031 (check_target)`; `crates/metal2vulkan-runtime/src/render_pass.rs:1369 (layout)`; `crates/metal2vulkan-runtime/src/render_pass.rs:1709 (target)`; `crates/metal2vulkan-runtime/src/render_pass.rs:1802 (attachment_format)`; `crates/metal2vulkan-runtime/src/resolve.rs:409 (unmodelled_resolve)`; `crates/metal2vulkan-runtime/src/resolve.rs:616 (color)`; `crates/metal2vulkan-runtime/src/sample_copy.rs:176 (checked_twin)`; `crates/metal2vulkan-runtime/src/sample_copy.rs:204 (plan)`; `crates/metal2vulkan-runtime/src/sample_interleave.rs:301 (interleave_merge)`; `crates/metal2vulkan-runtime/src/shadow.rs:648 (unmerged)`; `crates/metal2vulkan-runtime/src/shadow.rs:655 (unmerged)`; `crates/metal2vulkan-runtime/src/texture.rs:2047 (texture_as)`; `crates/metal2vulkan-runtime/src/texture.rs:3588 (two_planes_refused)`; `crates/metal2vulkan-runtime/src/texture/decoded_twin.rs:498 (astc_texels)`; `crates/metal2vulkan-runtime/src/texture/decoded_twin.rs:534 (etc_texels)`; `crates/metal2vulkan-runtime/src/texture/heap.rs:1949 (planned_heap_texture)`; `crates/metal2vulkan-runtime/src/texture/surface_two_planes.rs:80 (refused)`; `crates/metal2vulkan-runtime/src/texture/ycbcr_image.rs:115 (converted_storage)`; `crates/metal2vulkan-runtime/src/texture/ycbcr_image.rs:278 (ycbcr_write_shadow)`; `crates/metal2vulkan-runtime/src/texture/ycbcr_image.rs:384 (new_render_shadow)`; `crates/metal2vulkan-runtime/src/two_planes.rs:150 (unmeasured)`; `crates/metal2vulkan-runtime/src/view_plan.rs:380 (check_format)`; `crates/metal2vulkan-runtime/src/view_plan.rs:393 (check_format)`; `crates/metal2vulkan-runtime/src/view_plan.rs:400 (check_format)`; `crates/metal2vulkan-runtime/src/view_plan.rs:412 (check_format)`; `crates/metal2vulkan-runtime/src/view_plan.rs:422 (check_format)`; `crates/metal2vulkan-runtime/src/ycbcr.rs:285 (refused)`; `crates/metal2vulkan/src/bind/extended_shadow.rs:184 (extended_shadow_module)`; `crates/metal2vulkan/src/bind/plan/resources.rs:1134 (plain_texture)`; `crates/metal2vulkan/src/bind/plan/resources.rs:1814 (extended_sampler)`; `crates/metal2vulkan/src/bind/plan/resources.rs:193 (require_filter_features)`; `crates/metal2vulkan/src/bind/plan/resources.rs:959 (plain_texture)`; `crates/metal2vulkan/src/bind/sample_interleave.rs:304 (finish)`; `crates/metal2vulkan/src/bind/sample_interleave.rs:328 (interleave_split_module)`; `crates/metal2vulkan/src/bind/shadow_copy_in.rs:259 (shadow_copy_in_module)`; `crates/metal2vulkan/src/bind/unused_bits.rs:687 (unused_bits_module)`; `crates/metal2vulkan/src/lower/access/tile.rs:1029 (storage_format)`; `crates/metal2vulkan/src/lower/fragment/color.rs:160 (select_param)`; `crates/metal2vulkan/src/lower/fraLine truncated
- `feature::Format`: `crates/metal2vulkan-runtime/src/binding_view.rs:146 (binding_view)`; `crates/metal2vulkan-runtime/src/blit_plan.rs:523 (check_formats)`; `crates/metal2vulkan-runtime/src/blit_plan.rs:530 (check_formats)`; `crates/metal2vulkan-runtime/src/blit_plan.rs:545 (check_formats)`; `crates/metal2vulkan-runtime/src/blit_plan.rs:602 (pair_unit)`; `crates/metal2vulkan-runtime/src/blit_plan.rs:694 (plan_levels_copy)`; `crates/metal2vulkan-runtime/src/blit_texture.rs:2150 (through_buffer)`; `crates/metal2vulkan-runtime/src/buffer_texture.rs:519 (make_texture_over)`; `crates/metal2vulkan-runtime/src/buffer_texture.rs:582 (make_texture_over)`; `crates/metal2vulkan-runtime/src/buffer_texture.rs:614 (make_texture_over)`; `crates/metal2vulkan-runtime/src/buffer_texture.rs:851 (texture_buffer_texel)`; `crates/metal2vulkan-runtime/src/copy_plan.rs:270 (colour_unit)`; `crates/metal2vulkan-runtime/src/copy_plan.rs:298 (copy_unit)`; `crates/metal2vulkan-runtime/src/copy_plan.rs:344 (copy_unit)`; `crates/metal2vulkan-runtime/src/depth_stencil_scratch.rs:346 (scratch)`; `crates/metal2vulkan-runtime/src/depth_stencil_scratch.rs:526 (usable_twin)`; `crates/metal2vulkan-runtime/src/families/features.rs:1625 (read_write_tier)`; `crates/metal2vulkan-runtime/src/families/formats.rs:1628 (sparse_missing)`; `crates/metal2vulkan-runtime/src/families/formats.rs:227 (none)`; `crates/metal2vulkan-runtime/src/families/formats.rs:271 (answers)`; `crates/metal2vulkan-runtime/src/families/formats.rs:291 (answers)`; `crates/metal2vulkan-runtime/src/families/formats.rs:306 (answers)`; `crates/metal2vulkan-runtime/src/families/formats.rs:353 (answers)`; `crates/metal2vulkan-runtime/src/families/formats.rs:392 (answers)`; `crates/metal2vulkan-runtime/src/families/formats.rs:474 (atomic_gap)`; `crates/metal2vulkan-runtime/src/families/formats.rs:508 (lacking)`; `crates/metal2vulkan-runtime/src/families/formats.rs:522 (unsupported)`; `crates/metal2vulkan-runtime/src/image_plan.rs:544 (check_own_memory)`; `crates/metal2vulkan-runtime/src/image_plan.rs:670 (plan_held)`; `crates/metal2vulkan-runtime/src/image_plan.rs:787 (plan_held)`; `crates/metal2vulkan-runtime/src/image_plan.rs:907 (plan_held)`; `crates/metal2vulkan-runtime/src/render.rs:2292 (viewing)`; `crates/metal2vulkan-runtime/src/render_pass.rs:1031 (check_target)`; `crates/metal2vulkan-runtime/src/render_pass.rs:1369 (layout)`; `crates/metal2vulkan-runtime/src/render_pass.rs:1709 (target)`; `crates/metal2vulkan-runtime/src/render_pass.rs:1802 (attachment_format)`; `crates/metal2vulkan-runtime/src/resolve.rs:409 (unmodelled_resolve)`; `crates/metal2vulkan-runtime/src/resolve.rs:616 (color)`; `crates/metal2vulkan-runtime/src/sample_copy.rs:176 (checked_twin)`; `crates/metal2vulkan-runtime/src/sample_copy.rs:204 (plan)`; `crates/metal2vulkan-runtime/src/sample_interleave.rs:301 (interleave_merge)`; `crates/metal2vulkan-runtime/src/shadow.rs:648 (unmerged)`; `crates/metal2vulkan-runtime/src/shadow.rs:655 (unmerged)`; `crates/metal2vulkan-runtime/src/texture.rs:2047 (texture_as)`; `crates/metal2vulkan-runtime/src/texture.rs:3588 (two_planes_refused)`; `crates/metal2vulkan-runtime/src/texture/decoded_twin.rs:498 (astc_texels)`; `crates/metal2vulkan-runtime/src/texture/decoded_twin.rs:534 (etc_texels)`; `crates/metal2vulkan-runtime/src/texture/heap.rs:1949 (planned_heap_texture)`; `crates/metal2vulkan-runtime/src/texture/surface_two_planes.rs:80 (refused)`; `crates/metal2vulkan-runtime/src/texture/ycbcr_image.rs:115 (converted_storage)`; `crates/metal2vulkan-runtime/src/texture/ycbcr_image.rs:278 (ycbcr_write_shadow)`; `crates/metal2vulkan-runtime/src/texture/ycbcr_image.rs:384 (new_render_shadow)`; `crates/metal2vulkan-runtime/src/two_planes.rs:150 (unmeasured)`; `crates/metal2vulkan-runtime/src/view_plan.rs:380 (check_format)`; `crates/metal2vulkan-runtime/src/view_plan.rs:393 (check_format)`; `crates/metal2vulkan-runtime/src/view_plan.rs:400 (check_format)`; `crates/metal2vulkan-runtime/src/view_plan.rs:412 (check_format)`; `crates/metal2vulkan-runtime/src/view_plan.rs:422 (check_format)`; `crates/metal2vulkan-runtime/src/ycbcr.rs:285 (refused)`; `crates/metal2vulkan/src/bind/extended_shadow.rs:184 (extended_shadow_module)`; `crates/metal2vulkan/src/bind/plan/resources.rs:1134 (plain_texture)`; `crates/metal2vulkan/src/bind/plan/resources.rs:1814 (extended_sampler)`; `crates/metal2vulkan/src/bind/plan/resources.rs:193 (require_filter_features)`; `crates/metal2vulkan/src/bind/plan/resources.rs:959 (plain_texture)`; `crates/metal2vulkan/src/bind/sample_interleave.rs:304 (finish)`; `crates/metal2vulkan/src/bind/sample_interleave.rs:328 (interleave_split_module)`; `crates/metal2vulkan/src/bind/shadow_copy_in.rs:259 (shadow_copy_in_module)`; `crates/metal2vulkan/src/bind/unused_bits.rs:687 (unused_bits_module)`; `crates/metal2vulkan/src/lower/access/tile.rs:1029 (storage_format)`; `crates/metal2vulkan/src/lower/fragment/color.rs:160 (select_param)`; `crates/metal2vulkan/src/lower/fraLine truncated
- `feature::DivergentImplicitLod`: `crates/metal2vulkan/src/lower/sampler/select.rs:352 (select_sampling)`
- `feature::ImplicitLodOutsideFragment`: `crates/metal2vulkan/src/lower/sampler/constexpr.rs:136 (query_min_level)`; `crates/metal2vulkan/src/lower/sampler/select.rs:229 (query_level_measured)`; `crates/metal2vulkan/src/lower/sampler/select.rs:255 (query_min_level)`
- `feature::MinLodClamp`: `crates/metal2vulkan/src/lower/sampler/select.rs:1572 (select_one)`; `crates/metal2vulkan/src/lower/sampler/select.rs:973 (min_lod)`
@@ -346,7 +346,7 @@ Each refusal's sites, with the function that builds it.
- `feature::PixelSamplerCompare`: `crates/metal2vulkan/src/lower/sampler/constexpr.rs:115 (lowered)`
- `feature::TexelBuffer`: `crates/metal2vulkan/src/bind/instantiate.rs:880 (texel_ranges)`; `crates/metal2vulkan/src/bind/instantiate.rs:886 (texel_ranges)`; `crates/metal2vulkan/src/bind/plan/resources.rs:1147 (plain_texture)`
- `feature::RasterOrderGroups`: `crates/metal2vulkan/src/device/metal.rs:242 (unsupported_features)`; `crates/metal2vulkan/src/lower/fragment/rog.rs:151 (mode)`; `crates/metal2vulkan/src/lower/fragment/rog.rs:172 (mode)`; `crates/metal2vulkan/src/lower/fragment/snapshot.rs:158 (finish)`
- `feature::FramebufferFetch`: `crates/metal2vulkan-runtime/src/families/features.rs:1018 (state)`; `crates/metal2vulkan-runtime/src/render.rs:5894 (next_instance)`; `crates/metal2vulkan-runtime/src/sample_planes.rs:120 (lacks)`; `crates/metal2vulkan-runtime/src/sample_planes.rs:147 (new)`; `crates/metal2vulkan-runtime/src/sample_planes.rs:518 (planes_merge)`; `crates/metal2vulkan/src/bind/extended_shadow.rs:190 (extended_shadow_module)`; `crates/metal2vulkan/src/bind/sample_planes.rs:477 (finish)`; `crates/metal2vulkan/src/device/metal.rs:252 (unsupported_features)`; `crates/metal2vulkan/src/lower/arith/extended_range/blend.rs:1222 (unorm8)`; `crates/metal2vulkan/src/lower/arith/extended_range/blend.rs:1240 (unorm8)`; `crates/metal2vulkan/src/lower/arith/extended_range/blend.rs:1254 (unorm8)`; `crates/metal2vulkan/src/lower/arith/extended_range/blend.rs:1297 (packed16)`; `crates/metal2vulkan/src/lower/fragment/color.rs:215 (select_param)`; `crates/metal2vulkan/src/lower/fragment/color.rs:279 (unordered)`; `crates/metal2vulkan/src/lower/fragment/depth_test.rs:195 (not_implemented)`; `crates/metal2vulkan/src/lower/fragment/depth_test.rs:272 (depth_test_form)`; `crates/metal2vulkan/src/lower/fragment/depth_test.rs:318 (stencil_test_form)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1078 (storage_form)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1169 (storage_form)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1206 (extended_range_blend)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1798 (plan_sample)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:785 (not_implemented)`; `crates/metal2vulkan/src/pipeline/link/fetch.rs:164 (storage_attachments)`
- `feature::FramebufferFetch`: `crates/metal2vulkan-runtime/src/families/features.rs:1018 (state)`; `crates/metal2vulkan-runtime/src/render.rs:5894 (next_instance)`; `crates/metal2vulkan-runtime/src/sample_planes.rs:120 (lacks)`; `crates/metal2vulkan-runtime/src/sample_planes.rs:147 (new)`; `crates/metal2vulkan-runtime/src/sample_planes.rs:518 (planes_merge)`; `crates/metal2vulkan/src/bind/extended_shadow.rs:190 (extended_shadow_module)`; `crates/metal2vulkan/src/bind/sample_planes.rs:477 (finish)`; `crates/metal2vulkan/src/device/metal.rs:252 (unsupported_features)`; `crates/metal2vulkan/src/lower/arith/extended_range/blend.rs:1218 (unorm8)`; `crates/metal2vulkan/src/lower/arith/extended_range/blend.rs:1236 (unorm8)`; `crates/metal2vulkan/src/lower/arith/extended_range/blend.rs:1250 (unorm8)`; `crates/metal2vulkan/src/lower/arith/extended_range/blend.rs:1293 (packed16)`; `crates/metal2vulkan/src/lower/fragment/color.rs:215 (select_param)`; `crates/metal2vulkan/src/lower/fragment/color.rs:279 (unordered)`; `crates/metal2vulkan/src/lower/fragment/depth_test.rs:195 (not_implemented)`; `crates/metal2vulkan/src/lower/fragment/depth_test.rs:272 (depth_test_form)`; `crates/metal2vulkan/src/lower/fragment/depth_test.rs:318 (stencil_test_form)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1087 (storage_form)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1178 (storage_form)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1215 (extended_range_blend)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1827 (plan_sample)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:789 (not_implemented)`; `crates/metal2vulkan/src/pipeline/link/fetch.rs:164 (storage_attachments)`
- `feature::PrimitiveId`: `crates/metal2vulkan-runtime/src/families/features.rs:1127 (state)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs:3211 (finish)`; `crates/metal2vulkan/src/pipeline/link/varyings.rs:240 (check_primitive_id)`
- `feature::PrivatePrimitives`: `crates/metal2vulkan/src/lower/stage_io/plan.rs:2601 (indices_feature)`
- `feature::VertexAmplification`: `crates/metal2vulkan/src/bind/graphics.rs:3999 (multiview_instances)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs:1312 (own_index_store)`; `crates/metal2vulkan/src/lower/tessellation/mod.rs:718 (select_param)`; `crates/metal2vulkan/src/pipeline/link/graphics.rs:258 (vertex_amplification)`; `crates/metal2vulkan/src/pipeline/link/tessellation/mod.rs:228 (control_plan)`
@@ -397,7 +397,7 @@ Each refusal's sites, with the function that builds it.
- `feature::TextureSwizzle`: `crates/metal2vulkan-runtime/src/binding_view.rs:167 (binding_view)`; `crates/metal2vulkan-runtime/src/texture.rs:996 (may_view)`; `crates/metal2vulkan/src/bind/plan/resources.rs:1102 (plain_texture)`; `crates/metal2vulkan/src/lower/sampler/select.rs:2587 (select_one)`; `crates/metal2vulkan/src/lower/texture/mod.rs:3409 (select_read_as)`; `crates/metal2vulkan/src/lower/texture/mod.rs:3756 (select_write)`; `crates/metal2vulkan/src/lower/texture/slice.rs:307 (select)`
- `feature::MipmapGeneration`: `crates/metal2vulkan-runtime/src/blit_texture.rs:1850 (mipmaps)`; `crates/metal2vulkan-runtime/src/mipmap_pick.rs:37 (pick_mipmaps)`; `crates/metal2vulkan-runtime/src/mipmap_plan.rs:262 (plan_mipmaps)`; `crates/metal2vulkan-runtime/src/mipmap_plan.rs:270 (plan_mipmaps)`; `crates/metal2vulkan-runtime/src/mipmap_plan.rs:275 (plan_mipmaps)`; `crates/metal2vulkan-runtime/src/mipmap_plan.rs:304 (plan_mipmaps)`; `crates/metal2vulkan/src/bind/mipmap_filter.rs:973 (mipmap_filter_module)`
- `feature::HostMemory`: `crates/metal2vulkan-runtime/src/host_memory.rs:430 (not_importable)`; `crates/metal2vulkan-runtime/src/host_memory.rs:470 (refuse_unwritable)`; `crates/metal2vulkan-runtime/src/host_memory.rs:689 (new)`; `crates/metal2vulkan-runtime/src/host_memory.rs:694 (new)`; `crates/metal2vulkan-runtime/src/host_memory.rs:712 (new)`
- `feature::GpuTimes`: `crates/metal2vulkan-runtime/src/command_buffer/mod.rs:2814 (gpu_times)`
- `feature::GpuTimes`: `crates/metal2vulkan-runtime/src/command_buffer/mod.rs:2783 (gpu_times)`
- `feature::CountingVisibility`: `crates/metal2vulkan-runtime/src/visibility.rs:452 (check_mode)`
- `feature::ViewFormatReinterpretation`: `crates/metal2vulkan-runtime/src/view_plan.rs:570 (reinterpretation_refused)`
- `feature::SeparateMultisampledDepthStencil`: `crates/metal2vulkan-runtime/src/depth_stencil_scratch.rs:188 (sampled_candidate)`; `crates/metal2vulkan-runtime/src/depth_stencil_scratch.rs:294 (by_draws)`; `crates/metal2vulkan-runtime/src/depth_stencil_scratch.rs:336 (scratch)`; `crates/metal2vulkan-runtime/src/depth_stencil_scratch.rs:376 (scratch)`; `crates/metal2vulkan-runtime/src/depth_stencil_scratch.rs:777 (plan)`; `crates/metal2vulkan-runtime/src/nan_clear.rs:658 (nan_write)`; `crates/metal2vulkan-runtime/src/texture/signed_depth.rs:191 (sample_strip)`
@@ -415,7 +415,7 @@ Each refusal's sites, with the function that builds it.
- `feature::IndirectRenderState`: `crates/metal2vulkan/src/lower/access/encode.rs:568 (select_command)`
- `feature::GlobalBuiltinInFragment`: `crates/metal2vulkan/src/lower/select.rs:912 (route_air)`
- `feature::PrivateRenderState`: `crates/metal2vulkan/src/bind/heap.rs:1300 (array)`; `crates/metal2vulkan/src/bind/plan/resources.rs:887 (write_rounding)`; `crates/metal2vulkan/src/lower/sampler/select.rs:2710 (clamps_reference)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs:3438 (alpha_test_refused)`; `crates/metal2vulkan/src/lower/texture/mod.rs:2920 (mode_rounded_write)`; `crates/metal2vulkan/src/pipeline/private_state.rs:378 (logic_operation)`; `crates/metal2vulkan/src/pipeline/private_state.rs:97 (refused)`
- `feature::ExtendedRangeBlend`: `crates/metal2vulkan/src/lower/arith/extended_range/blend.rs:305 (refused)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1629 (plan)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1632 (plan)`; `crates/metal2vulkan/src/lower/fragment/input_blend.rs:153 (plan)`
- `feature::ExtendedRangeBlend`: `crates/metal2vulkan/src/lower/arith/extended_range/blend.rs:305 (refused)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1578 (plan)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1581 (plan)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1658 (plan)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1661 (plan)`; `crates/metal2vulkan/src/lower/fragment/input_blend.rs:153 (plan)`
- `feature::TileReach`: `crates/metal2vulkan/src/bind/tile_reach.rs:270 (tile_reach_module)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs:2517 (capture)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs:2543 (capture)`
- `feature::ProgramScopeBinding`: `crates/metal2vulkan-air/src/abi/module.rs:77 (decode)`; `crates/metal2vulkan/src/error/mod.rs:267 (from)`
- `feature::SeqCstFence`: `crates/metal2vulkan/src/lower/sync/barrier.rs:443 (require_seq_cst)`
@@ -429,7 +429,7 @@ Each refusal's sites, with the function that builds it.
- `gap::HeapTextureMemory`: `crates/metal2vulkan-runtime/src/texture/heap.rs:1510 (heap_plan)`; `crates/metal2vulkan-runtime/src/texture/heap.rs:1517 (heap_plan)`; `crates/metal2vulkan-runtime/src/texture/heap.rs:2059 (host_heap_plan)`; `crates/metal2vulkan-runtime/src/texture/heap.rs:2291 (memory_shadow)`; `crates/metal2vulkan-runtime/src/texture/heap.rs:554 (memory_refusal)`
- `gap::FunctionTablePastMaxBufferLength`: `crates/metal2vulkan-runtime/src/function_table.rs:622 (past_limit)`
- `gap::IndirectCommandBufferPastMaxBufferLength`: `crates/metal2vulkan-runtime/src/indirect_command_buffer.rs:522 (new_indirect_command_buffer)`
- `gap::IndirectRenderCommands`: `crates/metal2vulkan-runtime/src/compute.rs:1144 (execute_range)`; `crates/metal2vulkan-runtime/src/compute.rs:1225 (execute_indirect_range)`; `crates/metal2vulkan-runtime/src/depth_stencil.rs:85 (gpu_resource_id)`; `crates/metal2vulkan-runtime/src/indirect_command_buffer.rs:4368 (render_state)`; `crates/metal2vulkan-runtime/src/indirect_command_buffer.rs:517 (new_indirect_command_buffer)`; `crates/metal2vulkan-runtime/src/pipeline/mod.rs:1632 (compile_error)`; `crates/metal2vulkan-runtime/src/render.rs:7196 (draw_resident)`; `crates/metal2vulkan-runtime/src/render.rs:7681 (draw_resident)`; `crates/metal2vulkan-runtime/src/render.rs:8098 (draw_resident)`; `crates/metal2vulkan-runtime/src/render.rs:8605 (draw_resident)`; `crates/metal2vulkan-runtime/src/render/executions.rs:1106 (back_memoryless)`; `crates/metal2vulkan-runtime/src/render/executions.rs:2916 (record_forms)`; `crates/metal2vulkan-runtime/src/render/executions.rs:382 (execute_range)`; `crates/metal2vulkan-runtime/src/render/executions.rs:441 (execute_indirect_range)`; `crates/metal2vulkan-runtime/src/render/executions.rs:456 (execute_indirect_range)`
- `gap::IndirectRenderCommands`: `crates/metal2vulkan-runtime/src/compute.rs:1144 (execute_range)`; `crates/metal2vulkan-runtime/src/compute.rs:1225 (execute_indirect_range)`; `crates/metal2vulkan-runtime/src/depth_stencil.rs:85 (gpu_resource_id)`; `crates/metal2vulkan-runtime/src/indirect_command_buffer.rs:4358 (render_state)`; `crates/metal2vulkan-runtime/src/indirect_command_buffer.rs:517 (new_indirect_command_buffer)`; `crates/metal2vulkan-runtime/src/pipeline/mod.rs:1632 (compile_error)`; `crates/metal2vulkan-runtime/src/render.rs:7196 (draw_resident)`; `crates/metal2vulkan-runtime/src/render.rs:7681 (draw_resident)`; `crates/metal2vulkan-runtime/src/render.rs:8098 (draw_resident)`; `crates/metal2vulkan-runtime/src/render.rs:8605 (draw_resident)`; `crates/metal2vulkan-runtime/src/render/executions.rs:1106 (back_memoryless)`; `crates/metal2vulkan-runtime/src/render/executions.rs:2057 (record)`; `crates/metal2vulkan-runtime/src/render/executions.rs:2906 (record_forms)`; `crates/metal2vulkan-runtime/src/render/executions.rs:382 (execute_range)`; `crates/metal2vulkan-runtime/src/render/executions.rs:441 (execute_indirect_range)`; `crates/metal2vulkan-runtime/src/render/executions.rs:456 (execute_indirect_range)`
- `gap::IndirectImageblockSize`: `crates/metal2vulkan-runtime/src/indirect_command_buffer.rs:3363 (set_imageblock_size)`
- `gap::CommandReplay`: `crates/metal2vulkan-runtime/src/binding.rs:723 (bind_into)`; `crates/metal2vulkan-runtime/src/binding.rs:726 (bind_into)`
- `gap::RenderAttachments`: `crates/metal2vulkan-runtime/src/binding.rs:1794 (unexpected)`
@@ -487,7 +487,7 @@ Each refusal's sites, with the function that builds it.
- `gap::MultisampledBufferCopy`: `crates/metal2vulkan-runtime/src/blit_texture.rs:527 (copy_from_buffer_to_texture)`; `crates/metal2vulkan-runtime/src/blit_texture.rs:674 (copy_from_texture_to_buffer)`
- `gap::MultisampledBufferLayout`: `crates/metal2vulkan-runtime/src/sample_interleave.rs:1020 (plan)`
- `gap::ColorAttachmentGroups`: `crates/metal2vulkan-runtime/src/render/color_groups.rs:106 (gap)`
- `apple::ProtectedContent`: `crates/metal2vulkan-runtime/src/command_buffer/mod.rs:2372 (commit_now)`; `crates/metal2vulkan-runtime/src/command_buffer/protection.rs:126 (refuse_protected_state_encoder)`; `crates/metal2vulkan-runtime/src/command_buffer/protection.rs:52 (set)`
- `apple::ProtectedContent`: `crates/metal2vulkan-runtime/src/command_buffer/mod.rs:2358 (commit_now)`; `crates/metal2vulkan-runtime/src/command_buffer/protection.rs:126 (refuse_protected_state_encoder)`; `crates/metal2vulkan-runtime/src/command_buffer/protection.rs:52 (set)`
- `apple::LineWidth`: `crates/metal2vulkan-runtime/src/apple_only.rs:189 (check)`
- `apple::ViewportTransformDisabled`: `crates/metal2vulkan-runtime/src/apple_only.rs:191 (check)`
- `apple::VertexAmplificationMode`: `crates/metal2vulkan-runtime/src/apple_only.rs:195 (check)`; `crates/metal2vulkan-runtime/src/apple_only.rs:312 (set_vertex_amplification_mode)`