@@ -34,7 +34,7 @@ impl crate::Adapter for super::Adapter {
34
34
. shared
35
35
. device
36
36
. lock ( )
37
- . new_command_queue_with_max_command_buffer_count ( MAX_COMMAND_BUFFERS )
37
+ . newCommandQueueWithMaxCommandBufferCount ( MAX_COMMAND_BUFFERS )
38
38
. unwrap ( ) ;
39
39
40
40
// Acquiring the meaning of timestamp ticks is hard with Metal!
@@ -489,7 +489,7 @@ impl super::PrivateCapabilities {
489
489
features_sets
490
490
. iter ( )
491
491
. cloned ( )
492
- . any ( |x| raw. supports_feature_set ( x) )
492
+ . any ( |x| raw. supportsFeatureSet ( x) )
493
493
}
494
494
495
495
pub fn new ( device : & ProtocolObject < dyn MTLDevice > ) -> Self {
@@ -523,27 +523,27 @@ impl super::PrivateCapabilities {
523
523
524
524
let version = NSProcessInfo :: processInfo ( ) . operatingSystemVersion ( ) ;
525
525
526
- let os_is_mac = device. supports_feature_set ( MTLFeatureSet :: _macOS_GPUFamily1_v1) ;
526
+ let os_is_mac = device. supportsFeatureSet ( MTLFeatureSet :: _macOS_GPUFamily1_v1) ;
527
527
// Metal was first introduced in OS X 10.11 and iOS 8. The current version number of visionOS is 1.0.0. Additionally,
528
528
// on the Simulator, Apple only provides the Apple2 GPU capability, and the Apple2+ GPU capability covers the capabilities of Apple2.
529
529
// Therefore, the following conditions can be used to determine if it is visionOS.
530
530
// https://developer.apple.com/documentation/metal/developing_metal_apps_that_run_in_simulator
531
- let os_is_xr = version. majorVersion < 8 && device. supports_family ( MTLGPUFamily :: Apple2 ) ;
531
+ let os_is_xr = version. majorVersion < 8 && device. supportsFamily ( MTLGPUFamily :: Apple2 ) ;
532
532
let family_check = os_is_xr || version. at_least ( ( 10 , 15 ) , ( 13 , 0 ) , os_is_mac) ;
533
533
534
534
let mut sample_count_mask = crate :: TextureFormatCapabilities :: MULTISAMPLE_X4 ; // 1 and 4 samples are supported on all devices
535
- if device. supports_texture_sample_count ( 2 ) {
535
+ if device. supportsTextureSampleCount ( 2 ) {
536
536
sample_count_mask |= crate :: TextureFormatCapabilities :: MULTISAMPLE_X2 ;
537
537
}
538
- if device. supports_texture_sample_count ( 8 ) {
538
+ if device. supportsTextureSampleCount ( 8 ) {
539
539
sample_count_mask |= crate :: TextureFormatCapabilities :: MULTISAMPLE_X8 ;
540
540
}
541
- if device. supports_texture_sample_count ( 16 ) {
541
+ if device. supportsTextureSampleCount ( 16 ) {
542
542
sample_count_mask |= crate :: TextureFormatCapabilities :: MULTISAMPLE_X16 ;
543
543
}
544
544
545
545
let rw_texture_tier = if version. at_least ( ( 10 , 13 ) , ( 11 , 0 ) , os_is_mac) {
546
- device. read_write_texture_support ( )
546
+ device. readWriteTextureSupport ( )
547
547
} else if version. at_least ( ( 10 , 12 ) , OS_NOT_SUPPORT , os_is_mac) {
548
548
if Self :: supports_any ( device, & [ MTLFeatureSet :: _macOS_ReadWriteTextureTier2] ) {
549
549
MTLReadWriteTextureTier :: MTLReadWriteTextureTier2
@@ -556,18 +556,18 @@ impl super::PrivateCapabilities {
556
556
557
557
let mut timestamp_query_support = TimestampQuerySupport :: empty ( ) ;
558
558
if version. at_least ( ( 11 , 0 ) , ( 14 , 0 ) , os_is_mac)
559
- && device. supports_counter_sampling ( MTLCounterSamplingPoint :: AtStageBoundary )
559
+ && device. supportsCounterSampling ( MTLCounterSamplingPoint :: AtStageBoundary )
560
560
{
561
561
// If we don't support at stage boundary, don't support anything else.
562
562
timestamp_query_support. insert ( TimestampQuerySupport :: STAGE_BOUNDARIES ) ;
563
563
564
- if device. supports_counter_sampling ( MTLCounterSamplingPoint :: AtDrawBoundary ) {
564
+ if device. supportsCounterSampling ( MTLCounterSamplingPoint :: AtDrawBoundary ) {
565
565
timestamp_query_support. insert ( TimestampQuerySupport :: ON_RENDER_ENCODER ) ;
566
566
}
567
- if device. supports_counter_sampling ( MTLCounterSamplingPoint :: AtDispatchBoundary ) {
567
+ if device. supportsCounterSampling ( MTLCounterSamplingPoint :: AtDispatchBoundary ) {
568
568
timestamp_query_support. insert ( TimestampQuerySupport :: ON_COMPUTE_ENCODER ) ;
569
569
}
570
- if device. supports_counter_sampling ( MTLCounterSamplingPoint :: AtBlitBoundary ) {
570
+ if device. supportsCounterSampling ( MTLCounterSamplingPoint :: AtBlitBoundary ) {
571
571
timestamp_query_support. insert ( TimestampQuerySupport :: ON_BLIT_ENCODER ) ;
572
572
}
573
573
// `TimestampQuerySupport::INSIDE_WGPU_PASSES` emerges from the other flags.
@@ -601,11 +601,11 @@ impl super::PrivateCapabilities {
601
601
read_write_texture_tier : rw_texture_tier,
602
602
msaa_desktop : os_is_mac,
603
603
msaa_apple3 : if family_check {
604
- device. supports_family ( MTLGPUFamily :: Apple3 )
604
+ device. supportsFamily ( MTLGPUFamily :: Apple3 )
605
605
} else {
606
- device. supports_feature_set ( MTLFeatureSet :: _iOS_GPUFamily3_v4)
606
+ device. supportsFeatureSet ( MTLFeatureSet :: _iOS_GPUFamily3_v4)
607
607
} ,
608
- msaa_apple7 : family_check && device. supports_family ( MTLGPUFamily :: Apple7 ) ,
608
+ msaa_apple7 : family_check && device. supportsFamily ( MTLGPUFamily :: Apple7 ) ,
609
609
resource_heaps : Self :: supports_any ( device, RESOURCE_HEAP_SUPPORT ) ,
610
610
argument_buffers : Self :: supports_any ( device, ARGUMENT_BUFFER_SUPPORT ) ,
611
611
shared_textures : !os_is_mac,
@@ -620,30 +620,29 @@ impl super::PrivateCapabilities {
620
620
BASE_VERTEX_FIRST_INSTANCE_SUPPORT ,
621
621
) ,
622
622
dual_source_blending : Self :: supports_any ( device, DUAL_SOURCE_BLEND_SUPPORT ) ,
623
- low_power : !os_is_mac || device. is_low_power ( ) ,
624
- headless : os_is_mac && device. is_headless ( ) ,
623
+ low_power : !os_is_mac || device. isLowPower ( ) ,
624
+ headless : os_is_mac && device. isHeadless ( ) ,
625
625
layered_rendering : Self :: supports_any ( device, LAYERED_RENDERING_SUPPORT ) ,
626
626
function_specialization : Self :: supports_any ( device, FUNCTION_SPECIALIZATION_SUPPORT ) ,
627
627
depth_clip_mode : Self :: supports_any ( device, DEPTH_CLIP_MODE ) ,
628
628
texture_cube_array : Self :: supports_any ( device, TEXTURE_CUBE_ARRAY_SUPPORT ) ,
629
629
supports_float_filtering : os_is_mac
630
630
|| ( version. at_least ( ( 11 , 0 ) , ( 14 , 0 ) , os_is_mac)
631
- && device. supports32_bit_float_filtering ( ) ) ,
632
- format_depth24_stencil8 : os_is_mac
633
- && device. is_depth24_stencil8_pixel_format_supported ( ) ,
631
+ && device. supports32BitFloatFiltering ( ) ) ,
632
+ format_depth24_stencil8 : os_is_mac && device. isDepth24Stencil8PixelFormatSupported ( ) ,
634
633
format_depth32_stencil8_filter : os_is_mac,
635
634
format_depth32_stencil8_none : !os_is_mac,
636
635
format_min_srgb_channels : if os_is_mac { 4 } else { 1 } ,
637
636
format_b5 : !os_is_mac,
638
637
format_bc : os_is_mac,
639
638
format_eac_etc : !os_is_mac
640
639
// M1 in macOS supports EAC/ETC2
641
- || ( family_check && device. supports_family ( MTLGPUFamily :: Apple7 ) ) ,
640
+ || ( family_check && device. supportsFamily ( MTLGPUFamily :: Apple7 ) ) ,
642
641
// A8(Apple2) and later always support ASTC pixel formats
643
- format_astc : ( family_check && device. supports_family ( MTLGPUFamily :: Apple2 ) )
642
+ format_astc : ( family_check && device. supportsFamily ( MTLGPUFamily :: Apple2 ) )
644
643
|| Self :: supports_any ( device, ASTC_PIXEL_FORMAT_FEATURES ) ,
645
644
// A13(Apple6) M1(Apple7) and later always support HDR ASTC pixel formats
646
- format_astc_hdr : family_check && device. supports_family ( MTLGPUFamily :: Apple6 ) ,
645
+ format_astc_hdr : family_check && device. supportsFamily ( MTLGPUFamily :: Apple6 ) ,
647
646
format_any8_unorm_srgb_all : Self :: supports_any ( device, ANY8_UNORM_SRGB_ALL ) ,
648
647
format_any8_unorm_srgb_no_write : !Self :: supports_any ( device, ANY8_UNORM_SRGB_ALL )
649
648
&& !os_is_mac,
@@ -698,10 +697,10 @@ impl super::PrivateCapabilities {
698
697
max_buffers_per_stage : 31 ,
699
698
max_vertex_buffers : 31 . min ( crate :: MAX_VERTEX_BUFFERS as u32 ) ,
700
699
max_textures_per_stage : if os_is_mac
701
- || ( family_check && device. supports_family ( MTLGPUFamily :: Apple6 ) )
700
+ || ( family_check && device. supportsFamily ( MTLGPUFamily :: Apple6 ) )
702
701
{
703
702
128
704
- } else if family_check && device. supports_family ( MTLGPUFamily :: Apple4 ) {
703
+ } else if family_check && device. supportsFamily ( MTLGPUFamily :: Apple4 ) {
705
704
96
706
705
} else {
707
706
31
@@ -710,7 +709,7 @@ impl super::PrivateCapabilities {
710
709
buffer_alignment : if os_is_mac || os_is_xr { 256 } else { 64 } ,
711
710
max_buffer_size : if version. at_least ( ( 10 , 14 ) , ( 12 , 0 ) , os_is_mac) {
712
711
// maxBufferLength available on macOS 10.14+ and iOS 12.0+
713
- device. max_buffer_length ( ) as u64
712
+ device. maxBufferLength ( ) as u64
714
713
} else if os_is_mac {
715
714
1 << 30 // 1GB on macOS 10.11 and up
716
715
} else {
@@ -731,7 +730,7 @@ impl super::PrivateCapabilities {
731
730
max_texture_3d_size : 2048 ,
732
731
max_texture_layers : 2048 ,
733
732
max_fragment_input_components : if os_is_mac
734
- || device. supports_feature_set ( MTLFeatureSet :: _iOS_GPUFamily4_v1)
733
+ || device. supportsFeatureSet ( MTLFeatureSet :: _iOS_GPUFamily4_v1)
735
734
{
736
735
124
737
736
} else {
@@ -751,14 +750,14 @@ impl super::PrivateCapabilities {
751
750
} ,
752
751
// Per https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf
753
752
max_color_attachment_bytes_per_sample : if family_check
754
- && device. supports_family ( MTLGPUFamily :: Apple4 )
753
+ && device. supportsFamily ( MTLGPUFamily :: Apple4 )
755
754
{
756
755
64
757
756
} else {
758
757
32
759
758
} ,
760
759
max_varying_components : if device
761
- . supports_feature_set ( MTLFeatureSet :: _macOS_GPUFamily1_v1)
760
+ . supportsFeatureSet ( MTLFeatureSet :: _macOS_GPUFamily1_v1)
762
761
{
763
762
124
764
763
} else {
@@ -796,8 +795,8 @@ impl super::PrivateCapabilities {
796
795
] ,
797
796
) ,
798
797
supports_binary_archives : family_check
799
- && ( device. supports_family ( MTLGPUFamily :: Apple3 )
800
- || device. supports_family ( MTLGPUFamily :: Mac1 ) ) ,
798
+ && ( device. supportsFamily ( MTLGPUFamily :: Apple3 )
799
+ || device. supportsFamily ( MTLGPUFamily :: Mac1 ) ) ,
801
800
supports_capture_manager : version. at_least ( ( 10 , 13 ) , ( 11 , 0 ) , os_is_mac) ,
802
801
can_set_maximum_drawables_count : version. at_least ( ( 10 , 14 ) , ( 11 , 2 ) , os_is_mac) ,
803
802
can_set_display_sync : version. at_least ( ( 10 , 13 ) , OS_NOT_SUPPORT , os_is_mac) ,
@@ -811,30 +810,30 @@ impl super::PrivateCapabilities {
811
810
] ,
812
811
) ,
813
812
supports_arrays_of_textures_write : family_check
814
- && ( device. supports_family ( MTLGPUFamily :: Apple6 )
815
- || device. supports_family ( MTLGPUFamily :: Mac1 )
816
- || device. supports_family ( MTLGPUFamily :: MacCatalyst1 ) ) ,
813
+ && ( device. supportsFamily ( MTLGPUFamily :: Apple6 )
814
+ || device. supportsFamily ( MTLGPUFamily :: Mac1 )
815
+ || device. supportsFamily ( MTLGPUFamily :: MacCatalyst1 ) ) ,
817
816
supports_mutability : version. at_least ( ( 10 , 13 ) , ( 11 , 0 ) , os_is_mac) ,
818
817
//Depth clipping is supported on all macOS GPU families and iOS family 4 and later
819
818
supports_depth_clip_control : os_is_mac
820
- || device. supports_feature_set ( MTLFeatureSet :: _iOS_GPUFamily4_v1) ,
819
+ || device. supportsFeatureSet ( MTLFeatureSet :: _iOS_GPUFamily4_v1) ,
821
820
supports_preserve_invariance : version. at_least ( ( 11 , 0 ) , ( 13 , 0 ) , os_is_mac) ,
822
821
// Metal 2.2 on mac, 2.3 on iOS.
823
822
supports_shader_primitive_index : version. at_least ( ( 10 , 15 ) , ( 14 , 0 ) , os_is_mac) ,
824
823
has_unified_memory : if version. at_least ( ( 10 , 15 ) , ( 13 , 0 ) , os_is_mac) {
825
- Some ( device. has_unified_memory ( ) )
824
+ Some ( device. hasUnifiedMemory ( ) )
826
825
} else {
827
826
None
828
827
} ,
829
828
timestamp_query_support,
830
829
supports_simd_scoped_operations : family_check
831
- && ( device. supports_family ( MTLGPUFamily :: Metal3 )
832
- || device. supports_family ( MTLGPUFamily :: Mac2 )
833
- || device. supports_family ( MTLGPUFamily :: Apple7 ) ) ,
830
+ && ( device. supportsFamily ( MTLGPUFamily :: Metal3 )
831
+ || device. supportsFamily ( MTLGPUFamily :: Mac2 )
832
+ || device. supportsFamily ( MTLGPUFamily :: Apple7 ) ) ,
834
833
// https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf#page=5
835
834
int64 : family_check
836
- && ( device. supports_family ( MTLGPUFamily :: Apple3 )
837
- || device. supports_family ( MTLGPUFamily :: Metal3 ) ) ,
835
+ && ( device. supportsFamily ( MTLGPUFamily :: Apple3 )
836
+ || device. supportsFamily ( MTLGPUFamily :: Metal3 ) ) ,
838
837
}
839
838
}
840
839
@@ -1179,7 +1178,7 @@ impl super::PrivateDisabilities {
1179
1178
let is_intel = device. name ( ) . to_string ( ) . starts_with ( "Intel" ) ;
1180
1179
Self {
1181
1180
broken_viewport_near_depth : is_intel
1182
- && !device. supports_feature_set ( MTLFeatureSet :: _macOS_GPUFamily1_v4) ,
1181
+ && !device. supportsFeatureSet ( MTLFeatureSet :: _macOS_GPUFamily1_v4) ,
1183
1182
broken_layered_clear_image : is_intel,
1184
1183
}
1185
1184
}
0 commit comments