mpvkit / MPVKit

mpv library for iOS, macOS, tvOS applications
GNU Lesser General Public License v3.0
37 stars 14 forks source link

A VisionOS demo project would be a great addition #6

Open jnorris441 opened 3 months ago

jnorris441 commented 3 months ago

Thanks for this project. I took the tvOS demo project and tried building it for VisionOS. It builds successfully.

It does not play anything. I get a SIGABRT from vo, caused by libplacebo I believe.

It would be great if you could add a VisionOS demo similar to the other OSs. Thanks

[cplayer] debug: Setting option 'wid' = 12891317632 (flags = 0) -> 0
[cplayer] debug: Setting option 'subs-match-os-language' = "yes" (flags = 0) -> 0
[cplayer] debug: Setting option 'subs-fallback' = "yes" (flags = 0) -> 0
[cplayer] debug: Setting option 'vo' = "gpu-next" (flags = 0) -> 0
[cplayer] debug: Setting option 'gpu-api' = "vulkan" (flags = 0) -> 0
[cplayer] debug: Setting option 'gpu-debug' = "yes" (flags = 0) -> 0
[cplayer] debug: Setting option 'hwdec' = "videotoolbox" (flags = 0) -> 0
[cplayer] v: mpv v0.38.0-dirty Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
[cplayer] v:  built on Jul 19 2024 03:52:43
[cplayer] v: libplacebo version: v7.349.0 (v7.349.0)
[cplayer] v: FFmpeg version: n7.0.1
[cplayer] v: FFmpeg library versions:
[cplayer] v:    libavutil       59.8.100
[cplayer] v:    libavcodec      61.3.100
[cplayer] v:    libavformat     61.1.100
[cplayer] v:    libswscale      8.1.100
[cplayer] v:    libavfilter     10.1.100
[cplayer] v:    libswresample   5.1.100
[cplayer] v: 
[cplayer] v: Configuration: -Dlibmpv=true -Dgl=enabled -Dplain-gl=enabled -Diconv=enabled -Duchardet=enabled -Dvulkan=enabled -Dmoltenvk=enabled -Djavascript=disabled -Dzimg=disabled -Djpeg=disabled -Dvapoursynth=disabled -Drubberband=disabled -Dgpl=false -Dlibbluray=enabled -Dcplayer=false -Dvideotoolbox-gl=disabled -Dswift-build=disabled -Daudiounit=enabled -Davfoundation=disabled -Dlua=disabled -Dios-gl=disabled --cross-file=/Users/runner/work/MPVKit/MPVKit/dist/libmpv/xros/scratch/arm64/crossFile.meson
[cplayer] v: List of enabled features: audiounit av-channel-layout avif-muxer bsd-fstatfs build-date cplugins darwin ffmpeg gl glob glob-posix iconv jpegxl lavu-uuid lcms2 libass libbluray libdl libplacebo mac-thread-name moltenvk posix posix-shm uchardet vector videotoolbox-pl vulkan zlib
[global] debug: home path: '' -> '-'
[global] debug: user path: '~~home/' -> ''
[global] debug: user path: '~~old_home/' -> ''
[cplayer] debug: Run command: loadfile, flags=64, args=[url="https://vjs.zencdn.net/v/oceans.mp4", flags="replace", index="-1", options=""]
event: start-file
[global] debug: state path: 'watch_later' -> '-'
[ffmpeg] v: Opening https://vjs.zencdn.net/v/oceans.mp4
[ffmpeg] debug: tcp: Starting connection attempt to 2a04:4e42:5::729 port 443
[ffmpeg] debug: tcp: Successfully connected to 2a04:4e42:5::729 port 443
nw_socket_initialize_socket [C1:2] setsockopt SO_NECP_CLIENTUUID failed [22: Invalid argument]
nw_socket_initialize_socket setsockopt SO_NECP_CLIENTUUID failed [22: Invalid argument]
nw_socket_copy_info [C1:2] getsockopt TCP_INFO failed [102: Operation not supported on socket]
nw_socket_copy_info getsockopt TCP_INFO failed [102: Operation not supported on socket]
cannot add handler to 0 from 1 - dropping
[ffmpeg] debug: resize stream to 131072 bytes, drop 0 bytes
[ffmpeg] v: Mime-type: 'video/mp4'
[ffmpeg] debug: Stream opened successfully.
[demux] v: Trying demuxers for level=normal.
[demux] debug: Trying demuxer: disc (force-level: normal)
[demux] debug: Trying demuxer: edl (force-level: normal)
[demux] debug: Trying demuxer: cue (force-level: normal)
[demux] debug: Trying demuxer: rawaudio (force-level: normal)
[demux] debug: Trying demuxer: rawvideo (force-level: normal)
[demux] debug: Trying demuxer: mkv (force-level: normal)
[demux] debug: Trying demuxer: lavf (force-level: normal)
[lavf] v: Found 'mov,mp4,m4a,3gp,3g2,mj2' at score=100 size=2048.
[ffmpeg/demuxer] debug: mov,mp4,m4a,3gp,3g2,mj2: Reconfiguring buffers to size 3473898
[demux] v: Detected file format: mov,mp4,m4a,3gp,3g2,mj2 (libavformat)
[cplayer] v: Opening done: https://vjs.zencdn.net/v/oceans.mp4
[lavf] v: select track 0
[lavf] v: select track 1
[cplayer] info:  (+) Video --vid=1 (*) (h264 960x400 23.976fps)
[cplayer] info:  (+) Audio --aid=1 (*) (aac 2ch 48000Hz)
[vo/gpu-next] v: Probing for best GPU context.
[vo/gpu-next/vulkan] v: Initializing GPU context 'moltenvk'
[vo/gpu-next/libplacebo] v: Initialized libplacebo v7.349.0 (v7.349.0) (API v349)
[vo/gpu-next/libplacebo] debug: Available instance version: 1.2.283
[vo/gpu-next/libplacebo] debug: Spent 0.457 ms enumerating instance layers
[vo/gpu-next/libplacebo] debug: Available layers:
[vo/gpu-next/libplacebo] debug:     MoltenVK (v1.2.283)
[vo/gpu-next/libplacebo] v: API debugging requested but no debug meta layers present... ignoring
[vo/gpu-next/libplacebo] debug: Spent 0.024 ms enumerating instance extensions
[vo/gpu-next/libplacebo] debug: Available instance extensions:
[vo/gpu-next/libplacebo] debug:     VK_KHR_device_group_creation
[vo/gpu-next/libplacebo] debug:     VK_KHR_external_fence_capabilities
[vo/gpu-next/libplacebo] debug:     VK_KHR_external_memory_capabilities
[vo/gpu-next/libplacebo] debug:     VK_KHR_external_semaphore_capabilities
[vo/gpu-next/libplacebo] debug:     VK_KHR_get_physical_device_properties2
[vo/gpu-next/libplacebo] debug:     VK_KHR_get_surface_capabilities2
[vo/gpu-next/libplacebo] debug:     VK_KHR_surface
[vo/gpu-next/libplacebo] debug:     VK_EXT_debug_report
[vo/gpu-next/libplacebo] debug:     VK_EXT_debug_utils
[vo/gpu-next/libplacebo] debug:     VK_EXT_headless_surface
[vo/gpu-next/libplacebo] debug:     VK_EXT_layer_settings
[vo/gpu-next/libplacebo] debug:     VK_EXT_metal_surface
[vo/gpu-next/libplacebo] debug:     VK_EXT_surface_maintenance1
[vo/gpu-next/libplacebo] debug:     VK_EXT_swapchain_colorspace
[vo/gpu-next/libplacebo] debug:     VK_MVK_moltenvk
[vo/gpu-next/libplacebo] v: Creating vulkan instance with extensions:
[vo/gpu-next/libplacebo] v:     VK_KHR_get_physical_device_properties2
[vo/gpu-next/libplacebo] v:     VK_KHR_surface
[vo/gpu-next/libplacebo] v:     VK_EXT_swapchain_colorspace
[vo/gpu-next/libplacebo] v:     VK_KHR_external_memory_capabilities
[vo/gpu-next/libplacebo] v:     VK_KHR_external_semaphore_capabilities
[vo/gpu-next/libplacebo] v:     VK_KHR_get_surface_capabilities2
[vo/gpu-next/libplacebo] v:     VK_KHR_surface
[vo/gpu-next/libplacebo] v:     VK_EXT_metal_surface
[mvk-info] MoltenVK version 1.2.9, supporting Vulkan version 1.2.283.
    The following 108 Vulkan extensions are supported:
        VK_KHR_16bit_storage v1
        VK_KHR_8bit_storage v1
        VK_KHR_bind_memory2 v1
        VK_KHR_buffer_device_address v1
        VK_KHR_calibrated_timestamps v1
        VK_KHR_copy_commands2 v1
        VK_KHR_create_renderpass2 v1
        VK_KHR_dedicated_allocation v3
        VK_KHR_deferred_host_operations v4
        VK_KHR_depth_stencil_resolve v1
        VK_KHR_descriptor_update_template v1
        VK_KHR_device_group v4
        VK_KHR_device_group_creation v1
        VK_KHR_driver_properties v1
        VK_KHR_dynamic_rendering v1
        VK_KHR_external_fence v1
        VK_KHR_external_fence_capabilities v1
        VK_KHR_external_memory v1
        VK_KHR_external_memory_capabilities v1
        VK_KHR_external_semaphore v1
        VK_KHR_external_semaphore_capabilities v1
        VK_KHR_fragment_shader_barycentric v1
        VK_KHR_format_feature_flags2 v2
        VK_KHR_get_memory_requirements2 v1
        VK_KHR_get_physical_device_properties2 v2
        VK_KHR_get_surface_capabilities2 v1
        VK_KHR_imageless_framebuffer v1
        VK_KHR_image_format_list v1
        VK_KHR_incremental_present v2
        VK_KHR_maintenance1 v2
        VK_KHR_maintenance2 v1
        VK_KHR_maintenance3 v1
        VK_KHR_map_memory2 v1
        VK_KHR_multiview v1
        VK_KHR_portability_subset v1
        VK_KHR_push_descriptor v2
        VK_KHR_relaxed_block_layout v1
        VK_KHR_sampler_mirror_clamp_to_edge v3
        VK_KHR_sampler_ycbcr_conversion v14
        VK_KHR_separate_depth_stencil_layouts v1
        VK_KHR_shader_draw_parameters v1
        VK_KHR_shader_float_controls v4
        VK_KHR_shader_float16_int8 v1
        VK_KHR_shader_integer_dot_product v1
        VK_KHR_shader_non_semantic_info v1
        VK_KHR_shader_subgroup_extended_types v1
        VK_KHR_spirv_1_4 v1
        VK_KHR_storage_buffer_storage_class v1
        VK_KHR_surface v25
        VK_KHR_swapchain v70
        VK_KHR_swapchain_mutable_format v1
        VK_KHR_synchronization2 v1
        VK_KHR_timeline_semaphore v2
        VK_KHR_uniform_buffer_standard_layout v1
        VK_KHR_variable_pointers v1
        VK_KHR_vertex_attribute_divisor v1
        VK_EXT_4444_formats v1
        VK_EXT_buffer_device_address v2
        VK_EXT_calibrated_timestamps v2
        VK_EXT_debug_marker v4
        VK_EXT_debug_report v10
        VK_EXT_debug_utils v2
        VK_EXT_descriptor_indexing v2
        VK_EXT_extended_dynamic_state v1
        VK_EXT_extended_dynamic_state2 v1
        VK_EXT_extended_dynamic_state3 v2
        VK_EXT_external_memory_host v1
        VK_EXT_fragment_shader_interlock v1
        VK_EXT_headless_surface v1
        VK_EXT_host_image_copy v1
        VK_EXT_host_query_reset v1
        VK_EXT_image_robustness v1
        VK_EXT_inline_uniform_block v1
        VK_EXT_layer_settings v2
        VK_EXT_memory_budget v1
        VK_EXT_metal_objects v2
        VK_EXT_metal_surface v1
        VK_EXT_pipeline_creation_cache_control v3
        VK_EXT_pipeline_creation_feedback v1
        VK_EXT_post_depth_coverage v1
        VK_EXT_private_data v1
        VK_EXT_robustness2 v1
        VK_EXT_sample_locations v1
        VK_EXT_scalar_block_layout v1
        VK_EXT_separate_stencil_usage v1
        VK_EXT_shader_atomic_float v1
        VK_EXT_shader_demote_to_helper_invocation v1
        VK_EXT_shader_stencil_export v1
        VK_EXT_shader_subgroup_ballot v1
        VK_EXT_shader_subgroup_vote v1
        VK_EXT_shader_viewport_index_layer v1
        VK_EXT_subgroup_size_control v2
        VK_EXT_surface_maintenance1 v1
        VK_EXT_swapchain_colorspace v4
        VK_EXT_swapchain_maintenance1 v1
        VK_EXT_texel_buffer_alignment v1
        VK_EXT_texture_compression_astc_hdr v1
        VK_EXT_vertex_attribute_divisor v3
        VK_AMD_gpu_shader_half_float v2
        VK_AMD_negative_viewport_height v1
        VK_AMD_shader_image_load_store_lod v1
        VK_AMD_shader_trinary_minmax v1
        VK_IMG_format_pvrtc v1
        VK_INTEL_shader_integer_functions2 v1
        VK_GOOGLE_display_timing v1
        VK_MVK_moltenvk v37
        VK_NV_fragment_shader_barycentric v1
        VK_NV_glsl_shader v1
[mvk-info] GPU device:
        model: Apple M2 GPU
        type: Integrated
        vendorID: 0x106b
        deviceID: 0x20003f0
        pipelineCacheUUID: BF097EDC-0200-03F0-0000-000000000000
        GPU memory available: 10922 MB
        GPU memory used: 1 MB
    supports the following Metal Versions, GPU's and Feature Sets:
        Metal Shading Language 0.0
        GPU Family Apple 8
        GPU Family Apple 5
        GPU Family Apple 4
        GPU Family Apple 3
        GPU Family Apple 2
        GPU Family Apple 1
        GPU Family Common 3
        GPU Family Common 2
        GPU Family Common 1
[mvk-info] Created VkInstance for Vulkan version 1.2.283, as requested by app, with the following 7 Vulkan extensions enabled:
        VK_KHR_external_memory_capabilities v1
        VK_KHR_external_semaphore_capabilities v1
        VK_KHR_get_physical_device_properties2 v2
        VK_KHR_get_surface_capabilities2 v1
        VK_KHR_surface v25
        VK_EXT_metal_surface v1
        VK_EXT_swapchain_colorspace v4
[vo/gpu-next/libplacebo] debug: Spent 2.954 ms creating vulkan instance
[vo/gpu-next/libplacebo] v: Probing for vulkan devices:
[vo/gpu-next/libplacebo] debug: Spent 0.001 ms enumerating physical devices
[vo/gpu-next/libplacebo] v:     GPU 0: Apple M2 GPU v1.2.283 (integrated)
[vo/gpu-next/libplacebo] v:            uuid: 00:00:10:6B:02:00:03:F0:00:00:00:00:00:00:00:00
[vo/gpu-next/libplacebo] v: Vulkan device properties:
[vo/gpu-next/libplacebo] v:     Device Name: Apple M2 GPU
[vo/gpu-next/libplacebo] v:     Device ID: 106b:20003f0
[vo/gpu-next/libplacebo] v:     Device UUID: 00:00:10:6B:02:00:03:F0:00:00:00:00:00:00:00:00
[vo/gpu-next/libplacebo] v:     Driver version: 27e1
[vo/gpu-next/libplacebo] v:     API version: 1.2.283
[vo/gpu-next/libplacebo] debug: Queue families supported by device:
[vo/gpu-next/libplacebo] debug:     0: flags 0x7 num 1
[vo/gpu-next/libplacebo] debug: Using graphics queue 0
[vo/gpu-next/libplacebo] debug: Spent 0.015 ms enumerating device extensions
[vo/gpu-next/libplacebo] debug: Available device extensions:
[vo/gpu-next/libplacebo] debug:     VK_KHR_16bit_storage
[vo/gpu-next/libplacebo] debug:     VK_KHR_8bit_storage
[vo/gpu-next/libplacebo] debug:     VK_KHR_bind_memory2
[vo/gpu-next/libplacebo] debug:     VK_KHR_buffer_device_address
[vo/gpu-next/libplacebo] debug:     VK_KHR_calibrated_timestamps
[vo/gpu-next/libplacebo] debug:     VK_KHR_copy_commands2
[vo/gpu-next/libplacebo] debug:     VK_KHR_create_renderpass2
[vo/gpu-next/libplacebo] debug:     VK_KHR_dedicated_allocation
[vo/gpu-next/libplacebo] debug:     VK_KHR_deferred_host_operations
[vo/gpu-next/libplacebo] debug:     VK_KHR_depth_stencil_resolve
[vo/gpu-next/libplacebo] debug:     VK_KHR_descriptor_update_template
[vo/gpu-next/libplacebo] debug:     VK_KHR_device_group
[vo/gpu-next/libplacebo] debug:     VK_KHR_driver_properties
[vo/gpu-next/libplacebo] debug:     VK_KHR_dynamic_rendering
[vo/gpu-next/libplacebo] debug:     VK_KHR_external_fence
[vo/gpu-next/libplacebo] debug:     VK_KHR_external_memory
[vo/gpu-next/libplacebo] debug:     VK_KHR_external_semaphore
[vo/gpu-next/libplacebo] debug:     VK_KHR_format_feature_flags2
[vo/gpu-next/libplacebo] debug:     VK_KHR_get_memory_requirements2
[vo/gpu-next/libplacebo] debug:     VK_KHR_imageless_framebuffer
[vo/gpu-next/libplacebo] debug:     VK_KHR_image_format_list
[vo/gpu-next/libplacebo] debug:     VK_KHR_incremental_present
[vo/gpu-next/libplacebo] debug:     VK_KHR_maintenance1
[vo/gpu-next/libplacebo] debug:     VK_KHR_maintenance2
[vo/gpu-next/libplacebo] debug:     VK_KHR_maintenance3
[vo/gpu-next/libplacebo] debug:     VK_KHR_map_memory2
[vo/gpu-next/libplacebo] debug:     VK_KHR_multiview
[vo/gpu-next/libplacebo] debug:     VK_KHR_portability_subset
[vo/gpu-next/libplacebo] debug:     VK_KHR_push_descriptor
[vo/gpu-next/libplacebo] debug:     VK_KHR_relaxed_block_layout
[vo/gpu-next/libplacebo] debug:     VK_KHR_sampler_ycbcr_conversion
[vo/gpu-next/libplacebo] debug:     VK_KHR_separate_depth_stencil_layouts
[vo/gpu-next/libplacebo] debug:     VK_KHR_shader_draw_parameters
[vo/gpu-next/libplacebo] debug:     VK_KHR_shader_float_controls
[vo/gpu-next/libplacebo] debug:     VK_KHR_shader_float16_int8
[vo/gpu-next/libplacebo] debug:     VK_KHR_shader_integer_dot_product
[vo/gpu-next/libplacebo] debug:     VK_KHR_shader_non_semantic_info
[vo/gpu-next/libplacebo] debug:     VK_KHR_spirv_1_4
[vo/gpu-next/libplacebo] debug:     VK_KHR_storage_buffer_storage_class
[vo/gpu-next/libplacebo] debug:     VK_KHR_swapchain
[vo/gpu-next/libplacebo] debug:     VK_KHR_swapchain_mutable_format
[vo/gpu-next/libplacebo] debug:     VK_KHR_synchronization2
[vo/gpu-next/libplacebo] debug:     VK_KHR_timeline_semaphore
[vo/gpu-next/libplacebo] debug:     VK_KHR_uniform_buffer_standard_layout
[vo/gpu-next/libplacebo] debug:     VK_KHR_variable_pointers
[vo/gpu-next/libplacebo] debug:     VK_KHR_vertex_attribute_divisor
[vo/gpu-next/libplacebo] debug:     VK_EXT_4444_formats
[vo/gpu-next/libplacebo] debug:     VK_EXT_buffer_device_address
[vo/gpu-next/libplacebo] debug:     VK_EXT_calibrated_timestamps
[vo/gpu-next/libplacebo] debug:     VK_EXT_debug_marker
[vo/gpu-next/libplacebo] debug:     VK_EXT_extended_dynamic_state
[vo/gpu-next/libplacebo] debug:     VK_EXT_extended_dynamic_state2
[vo/gpu-next/libplacebo] debug:     VK_EXT_extended_dynamic_state3
[vo/gpu-next/libplacebo] debug:     VK_EXT_external_memory_host
[vo/gpu-next/libplacebo] debug:     VK_EXT_fragment_shader_interlock
[vo/gpu-next/libplacebo] debug:     VK_EXT_host_image_copy
[vo/gpu-next/libplacebo] debug:     VK_EXT_host_query_reset
[vo/gpu-next/libplacebo] debug:     VK_EXT_image_robustness
[vo/gpu-next/libplacebo] debug:     VK_EXT_inline_uniform_block
[vo/gpu-next/libplacebo] debug:     VK_EXT_memory_budget
[vo/gpu-next/libplacebo] debug:     VK_EXT_metal_objects
[vo/gpu-next/libplacebo] debug:     VK_EXT_pipeline_creation_cache_control
[vo/gpu-next/libplacebo] debug:     VK_EXT_pipeline_creation_feedback
[vo/gpu-next/libplacebo] debug:     VK_EXT_private_data
[vo/gpu-next/libplacebo] debug:     VK_EXT_robustness2
[vo/gpu-next/libplacebo] debug:     VK_EXT_sample_locations
[vo/gpu-next/libplacebo] debug:     VK_EXT_scalar_block_layout
[vo/gpu-next/libplacebo] debug:     VK_EXT_separate_stencil_usage
[vo/gpu-next/libplacebo] debug:     VK_EXT_shader_atomic_float
[vo/gpu-next/libplacebo] debug:     VK_EXT_shader_demote_to_helper_invocation
[vo/gpu-next/libplacebo] debug:     VK_EXT_shader_viewport_index_layer
[vo/gpu-next/libplacebo] debug:     VK_EXT_subgroup_size_control
[vo/gpu-next/libplacebo] debug:     VK_EXT_swapchain_maintenance1
[vo/gpu-next/libplacebo] debug:     VK_EXT_texel_buffer_alignment
[vo/gpu-next/libplacebo] debug:     VK_EXT_vertex_attribute_divisor
[vo/gpu-next/libplacebo] debug:     VK_AMD_gpu_shader_half_float
[vo/gpu-next/libplacebo] debug:     VK_AMD_negative_viewport_height
[vo/gpu-next/libplacebo] debug:     VK_AMD_shader_image_load_store_lod
[vo/gpu-next/libplacebo] debug:     VK_AMD_shader_trinary_minmax
[vo/gpu-next/libplacebo] debug:     VK_IMG_format_pvrtc
[vo/gpu-next/libplacebo] debug:     VK_INTEL_shader_integer_functions2
[vo/gpu-next/libplacebo] debug:     VK_GOOGLE_display_timing
[vo/gpu-next/libplacebo] debug:     VK_NV_glsl_shader
[vo/gpu-next/libplacebo] v: Creating vulkan device with extensions:
[vo/gpu-next/libplacebo] v:     VK_KHR_swapchain
[vo/gpu-next/libplacebo] v:     VK_KHR_swapchain
[vo/gpu-next/libplacebo] v:     VK_KHR_push_descriptor
[vo/gpu-next/libplacebo] v:     VK_EXT_external_memory_host
[vo/gpu-next/libplacebo] v:     VK_KHR_portability_subset
[vo/gpu-next/libplacebo] v:     VK_EXT_metal_objects
[vo/gpu-next/libplacebo] v:     VK_KHR_synchronization2
[mvk-info] Vulkan semaphores using Metal implicit guarantees within a single queue.
Compiler failed to build request
[mvk-error] Could not compile command shaders (Error code 3):
error: invalid value 'ios-metal0.0' in '-std=ios-metal0.0'
note: use 'ios-metal1.0' for 'Metal 1.0 (iOS)' standard
note: use 'ios-metal1.1' for 'Metal 1.1 (iOS)' standard
note: use 'ios-metal1.2' for 'Metal 1.2 (iOS)' standard
note: use 'ios-metal2.0' for 'Metal 2.0 (iOS)' standard
note: use 'ios-metal2.1' for 'Metal 2.1 (iOS)' standard
note: use 'ios-metal2.2' for 'Metal 2.2 (iOS)' standard
note: use 'ios-metal2.3' for 'Metal 2.3 (iOS)' standard
note: use 'ios-metal2.4' for 'Metal 2.4 (iOS)' standard
note: use 'macos-metal1.0' or 'osx-metal1.0' for 'Metal 1.0 (macOS)' standard
note: use 'macos-metal1.1' or 'osx-metal1.1' for 'Metal 1.1 (macOS)' standard
note: use 'macos-metal1.2' or 'osx-metal1.2' for 'Metal 1.2 (macOS)' standard
note: use 'macos-metal2.0' or 'osx-metal2.0' for 'Metal 2.0 (macOS)' standard
note: use 'macos-metal2.1' for 'Metal 2.1 (macOS)' standard
note: use 'macos-metal2.2' for 'Metal 2.2 (macOS)' standard
note: use 'macos-metal2.3' for 'Metal 2.3 (macOS)' standard
note: use 'macos-metal2.4' for 'Metal 2.4 (macOS)' standard
note: use 'metal3.0' for 'Metal 3.0' standard
note: use 'metal3.1' for 'Metal 3.1' standard
note: use 'metal3.2' for 'Metal 3.2' standard

[mvk-info] Created VkDevice to run on GPU Apple M2 GPU with the following 6 Vulkan extensions enabled:
        VK_KHR_portability_subset v1
        VK_KHR_push_descriptor v2
        VK_KHR_swapchain v70
        VK_KHR_synchronization2 v1
        VK_EXT_external_memory_host v1
        VK_EXT_metal_objects v2
[vo/gpu-next/libplacebo] v: Spent 12.466 ms creating vulkan device
[vo/gpu-next/libplacebo] v: Memory heaps supported by device:
[vo/gpu-next/libplacebo] v:     0: flags 0x1 size   15G
[vo/gpu-next/libplacebo] debug: Memory types supported by device:
[vo/gpu-next/libplacebo] debug:     0: flags 0x1 heap 0
[vo/gpu-next/libplacebo] debug:     1: flags 0xf heap 0
[vo/gpu-next/libplacebo] v: Memory summary:     0 used     0 res     0 alloc, efficiency 100.00%, utilization 100.00%, max page:  979M
[vo/gpu-next/libplacebo] v: shaderc SPIR-V version 1.6 rev 1
[vo/gpu-next/libplacebo] v: Initialized SPIR-V compiler 'shaderc'
Assertion failed: (x && y), function pl_lcm, file common.h, line 154.
cxfksword commented 3 months ago

It appears that MoltenVK does not yet support visionOS. I will include a visionOS demo once I obtain an Apple Silicon MacBook. Contributions via PR are also welcome.

jnorris441 commented 3 months ago

@cxfksword I thought when they fixed building for VisionOS it would mean it was supported. I hope it gets straightened out

AdamGoodApp commented 3 weeks ago

Any update on this?

cxfksword commented 3 weeks ago

Not fixed yet. https://github.com/KhronosGroup/MoltenVK/issues/1984

HyperCed commented 1 week ago

Hi, I got the same result as above trying to port iOS code to VisionOS : [mvk-error] Could not compile command shaders (Error code 3): error: invalid value 'ios-metal0.0' in '-std=ios-metal0.0'

Is there a new version which fixes this issue ? Which one ? Do I need to specify a version to make it work ? I am trying on a simulator.

HyperCed commented 4 days ago

I was able to launch my Vulkan App with success and shaders working using a patch on MoltenVK. It's working on VisionOS simulator. I did not test on real VisionOS device because I don't have one. I changed some tests on MVKDevice.mm, MVKCommonEnvironnement.h and SPIRVToMSLConverter.cpp.

I did not make a PR because I'm not sure that all I've done is ok on real VisionOS device and if I did all correctly.

If some people want my sources, I can fork the MoltenVK project or upload modified files. Just ask.

AdamGoodApp commented 4 days ago

@HyperCed Great work. I have a Vision Pro I can test on. Could you make a fork and let me know?

drewbaumann commented 4 days ago

I'd be happy to try as well!

HyperCed commented 4 days ago

You can try on https://github.com/HyperCed/MoltenVK On visionOSSimulator branch

AdamGoodApp commented 1 day ago

@HyperCed I downloaded the MoltenVK-all binary from the Github action running your branch. How do I actually get MPVKit to use it?