From 4459efdfe7d5c4ae5c5cc1c723d6b0565158eeae Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Tue, 10 Nov 2026 05:48:50 -0800 Subject: [PATCH] Fixture rgbx_sample_half: AIR companions (scripts/regen-air-fixtures, metal 32023.922, SDK 27.2) (cherry picked from commit 38eeaead0844f69205ae736f53dc90aca52f61f3) --- .../fixtures/public/engine/TOOLCHAIN | 1 + .../public/engine/rgbx_sample_half.air.ll | 76 +++++++++++++++++++ .../public/engine/rgbx_sample_half.ll | 73 ++++++++++++++++++ 3 files changed, 150 insertions(+) create mode 100644 crates/metal2vulkan-validation/fixtures/public/engine/rgbx_sample_half.air.ll create mode 100644 crates/metal2vulkan-validation/fixtures/public/engine/rgbx_sample_half.ll diff --git a/crates/metal2vulkan-validation/fixtures/public/engine/TOOLCHAIN b/crates/metal2vulkan-validation/fixtures/public/engine/TOOLCHAIN index f1edc5799..4056753a2 100644 --- a/crates/metal2vulkan-validation/fixtures/public/engine/TOOLCHAIN +++ b/crates/metal2vulkan-validation/fixtures/public/engine/TOOLCHAIN @@ -274,6 +274,7 @@ fixture rfs_agx_yield: metal: Apple metal version 32023.921 (metalfe-32023.921.6 fixture rfs_async_copy: metal: Apple metal version 32023.921 (metalfe-32023.921.6); macosx-sdk: 27.0 (26A425) fixture rfs_imageblock_cover: metal: Apple metal version 32023.921 (metalfe-32023.921.6); macosx-sdk: 27.0 (26A425) fixture rfs_kernel_lod: metal: Apple metal version 32023.921 (metalfe-32023.921.6); macosx-sdk: 27.0 (26A425) +fixture rgbx_sample_half: metal: Apple metal version 32023.922 (metalfe-32023.922.4); macosx-sdk: 27.2 (26B118) fixture rrp_mirror_clamp: metal: Apple metal version 32023.921 (metalfe-32023.921.6); macosx-sdk: 27.0 (26A425) fixture rrp_swizzled_storage: metal: Apple metal version 32023.921 (metalfe-32023.921.6); macosx-sdk: 27.0 (26A425) fixture rrs_tile_writer: metal: Apple metal version 32023.921 (metalfe-32023.921.6); macosx-sdk: 27.0 (26A425) diff --git a/crates/metal2vulkan-validation/fixtures/public/engine/rgbx_sample_half.air.ll b/crates/metal2vulkan-validation/fixtures/public/engine/rgbx_sample_half.air.ll new file mode 100644 index 000000000..277ffed8a --- /dev/null +++ b/crates/metal2vulkan-validation/fixtures/public/engine/rgbx_sample_half.air.ll @@ -0,0 +1,76 @@ +; Generated by scripts/regen-air-fixtures from rgbx_sample_half.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_v28-apple-macosx26.0.0" + +%struct._texture_2d_t = type opaque +%struct._sampler_t = type opaque + +; Function Attrs: convergent mustprogress nofree nounwind willreturn +define void @rgbx_sample_half(%struct._texture_2d_t addrspace(1)* %0, %struct._sampler_t addrspace(2)* nocapture readonly %1, <4 x half> addrspace(1)* nocapture noundef writeonly "air-buffer-no-alias" %2, <2 x float> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %3, <2 x i32> noundef %4) local_unnamed_addr #0 { + %6 = extractelement <2 x i32> %4, i64 1 + %7 = shl i32 %6, 4 + %8 = extractelement <2 x i32> %4, i64 0 + %9 = add i32 %7, %8 + %10 = zext i32 %9 to i64 + %11 = getelementptr inbounds <2 x float>, <2 x float> addrspace(1)* %3, i64 %10 + %12 = load <2 x float>, <2 x float> addrspace(1)* %11, align 8, !tbaa !23, !alias.scope !26, !noalias !29 + %13 = tail call { <4 x half>, i8 } @air.sample_texture_2d.v4f16(%struct._texture_2d_t addrspace(1)* nocapture readonly %0, %struct._sampler_t addrspace(2)* nocapture readonly %1, <2 x float> %12, i1 true, <2 x i32> zeroinitializer, i1 false, float 0.000000e+00, float 0.000000e+00, i32 0) #2, !alias.scope !33, !noalias !34 + %14 = extractvalue { <4 x half>, i8 } %13, 0 + %15 = getelementptr inbounds <4 x half>, <4 x half> addrspace(1)* %2, i64 %10 + store <4 x half> %14, <4 x half> addrspace(1)* %15, align 8, !tbaa !23, !alias.scope !35, !noalias !36 + ret void +} + +; Function Attrs: argmemonly convergent mustprogress nofree nounwind readonly willreturn +declare { <4 x half>, i8 } @air.sample_texture_2d.v4f16(%struct._texture_2d_t addrspace(1)* nocapture readonly, %struct._sampler_t addrspace(2)* nocapture readonly, <2 x float>, i1, <2 x i32>, i1, float, float, i32) local_unnamed_addr #1 + +attributes #0 = { convergent mustprogress nofree nounwind willreturn "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="64" "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 = { argmemonly convergent mustprogress nofree nounwind readonly willreturn } +attributes #2 = { argmemonly convergent nounwind readonly willreturn } + +!llvm.module.flags = !{!0, !1, !2, !3, !4, !5, !6, !7, !8} +!air.kernel = !{!9} +!air.compile_options = !{!17, !18, !19} +!llvm.ident = !{!20} +!air.version = !{!21} +!air.language_version = !{!22} + +!0 = !{i32 2, !"SDK Version", [2 x i32] [i32 27, i32 2]} +!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 = !{void (%struct._texture_2d_t addrspace(1)*, %struct._sampler_t addrspace(2)*, <4 x half> addrspace(1)*, <2 x float> addrspace(1)*, <2 x i32>)* @rgbx_sample_half, !10, !11} +!10 = !{} +!11 = !{!12, !13, !14, !15, !16} +!12 = !{i32 0, !"air.texture", !"air.location_index", i32 0, i32 1, !"air.sample", !"air.arg_type_name", !"texture2d", !"air.arg_name", !"t"} +!13 = !{i32 1, !"air.sampler", !"air.location_index", i32 0, i32 1, !"air.arg_type_name", !"sampler", !"air.arg_name", !"s"} +!14 = !{i32 2, !"air.buffer", !"air.location_index", i32 0, i32 1, !"air.read_write", !"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", !"out"} +!15 = !{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", !"float2", !"air.arg_name", !"where"} +!16 = !{i32 4, !"air.thread_position_in_grid", !"air.arg_type_name", !"uint2", !"air.arg_name", !"g"} +!17 = !{!"air.compile.denorms_disable"} +!18 = !{!"air.compile.fast_math_enable"} +!19 = !{!"air.compile.framebuffer_fetch_enable"} +!20 = !{!"Apple metal version 32023.922 (metalfe-32023.922.4)"} +!21 = !{i32 2, i32 8, i32 0} +!22 = !{!"Metal", i32 4, i32 0, i32 0} +!23 = !{!24, !24, i64 0} +!24 = !{!"omnipotent char", !25, i64 0} +!25 = !{!"Simple C++ TBAA"} +!26 = !{!27} +!27 = distinct !{!27, !28, !"air-alias-scope-arg(3)"} +!28 = distinct !{!28, !"air-alias-scopes(rgbx_sample_half)"} +!29 = !{!30, !31, !32} +!30 = distinct !{!30, !28, !"air-alias-scope-textures"} +!31 = distinct !{!31, !28, !"air-alias-scope-samplers"} +!32 = distinct !{!32, !28, !"air-alias-scope-arg(2)"} +!33 = !{!30, !31} +!34 = !{!32, !27} +!35 = !{!32} +!36 = !{!30, !31, !27} diff --git a/crates/metal2vulkan-validation/fixtures/public/engine/rgbx_sample_half.ll b/crates/metal2vulkan-validation/fixtures/public/engine/rgbx_sample_half.ll new file mode 100644 index 000000000..be56a9fb4 --- /dev/null +++ b/crates/metal2vulkan-validation/fixtures/public/engine/rgbx_sample_half.ll @@ -0,0 +1,73 @@ +; Generated by scripts/regen-air-fixtures from rgbx_sample_half.metal (llvm-dis of rgbx_sample_half.air). 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_v28-apple-macosx26.0.0" + +; Function Attrs: convergent mustprogress nofree nounwind willreturn +define void @rgbx_sample_half(ptr addrspace(1) %0, ptr addrspace(2) readonly captures(none) %1, ptr addrspace(1) noundef writeonly captures(none) "air-buffer-no-alias" %2, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %3, <2 x i32> noundef %4) local_unnamed_addr #0 { + %6 = extractelement <2 x i32> %4, i64 1 + %7 = shl i32 %6, 4 + %8 = extractelement <2 x i32> %4, i64 0 + %9 = add i32 %7, %8 + %10 = zext i32 %9 to i64 + %11 = getelementptr inbounds <2 x float>, ptr addrspace(1) %3, i64 %10 + %12 = load <2 x float>, ptr addrspace(1) %11, align 8, !tbaa !23, !alias.scope !26, !noalias !29 + %13 = tail call { <4 x half>, i8 } @air.sample_texture_2d.v4f16(ptr addrspace(1) readonly captures(none) %0, ptr addrspace(2) readonly captures(none) %1, <2 x float> %12, i1 true, <2 x i32> zeroinitializer, i1 false, float 0.000000e+00, float 0.000000e+00, i32 0) #2, !alias.scope !33, !noalias !34 + %14 = extractvalue { <4 x half>, i8 } %13, 0 + %15 = getelementptr inbounds <4 x half>, ptr addrspace(1) %2, i64 %10 + store <4 x half> %14, ptr addrspace(1) %15, align 8, !tbaa !23, !alias.scope !35, !noalias !36 + ret void +} + +; Function Attrs: convergent mustprogress nofree nounwind willreturn memory(argmem: read) +declare { <4 x half>, i8 } @air.sample_texture_2d.v4f16(ptr addrspace(1) readonly captures(none), ptr addrspace(2) readonly captures(none), <2 x float>, i1, <2 x i32>, i1, float, float, i32) local_unnamed_addr #1 + +attributes #0 = { convergent mustprogress nofree nounwind willreturn "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="64" "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 = { convergent mustprogress nofree nounwind willreturn memory(argmem: read) } +attributes #2 = { convergent nounwind willreturn memory(argmem: read) } + +!llvm.module.flags = !{!0, !1, !2, !3, !4, !5, !6, !7, !8} +!air.kernel = !{!9} +!air.compile_options = !{!17, !18, !19} +!llvm.ident = !{!20} +!air.version = !{!21} +!air.language_version = !{!22} + +!0 = !{i32 2, !"SDK Version", [2 x i32] [i32 27, i32 2]} +!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 @rgbx_sample_half, !10, !11} +!10 = !{} +!11 = !{!12, !13, !14, !15, !16} +!12 = !{i32 0, !"air.texture", !"air.location_index", i32 0, i32 1, !"air.sample", !"air.arg_type_name", !"texture2d", !"air.arg_name", !"t"} +!13 = !{i32 1, !"air.sampler", !"air.location_index", i32 0, i32 1, !"air.arg_type_name", !"sampler", !"air.arg_name", !"s"} +!14 = !{i32 2, !"air.buffer", !"air.location_index", i32 0, i32 1, !"air.read_write", !"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", !"out"} +!15 = !{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", !"float2", !"air.arg_name", !"where"} +!16 = !{i32 4, !"air.thread_position_in_grid", !"air.arg_type_name", !"uint2", !"air.arg_name", !"g"} +!17 = !{!"air.compile.denorms_disable"} +!18 = !{!"air.compile.fast_math_enable"} +!19 = !{!"air.compile.framebuffer_fetch_enable"} +!20 = !{!"Apple metal version 32023.922 (metalfe-32023.922.4)"} +!21 = !{i32 2, i32 8, i32 0} +!22 = !{!"Metal", i32 4, i32 0, i32 0} +!23 = !{!24, !24, i64 0} +!24 = !{!"omnipotent char", !25, i64 0} +!25 = !{!"Simple C++ TBAA"} +!26 = !{!27} +!27 = distinct !{!27, !28, !"air-alias-scope-arg(3)"} +!28 = distinct !{!28, !"air-alias-scopes(rgbx_sample_half)"} +!29 = !{!30, !31, !32} +!30 = distinct !{!30, !28, !"air-alias-scope-textures"} +!31 = distinct !{!31, !28, !"air-alias-scope-samplers"} +!32 = distinct !{!32, !28, !"air-alias-scope-arg(2)"} +!33 = !{!30, !31} +!34 = !{!32, !27} +!35 = !{!32} +!36 = !{!30, !31, !27}