How to build angle with vulkan backend on macos with apple silicon

132 views
Skip to first unread message

OMO L

unread,
Oct 7, 2024, 7:12:51 AM10/7/24
to angleproject
Is  angle with vulkan backend already supported on macos with help of moltenVK?

I try to build angle with vulkan enabled on macos, but when i run samples, it just failed with vulkan backend, such as:
 ./hello_triangle --use-angle=vulkan

the error message is:
Using ANGLE back-end API: vulkan
eglInitialize failed: 0x3001

No matter how I config the compile args, it just failed, I try some build args:
is_debug= false
angle_shared_libvulkan=true
angle_use_vulkan_display=true

the whole compile args are listed in the annex file.

Thanks you all a lot!
compile_args.txt

Shahbaz Youssefi

unread,
Oct 7, 2024, 12:30:36 PM10/7/24
to angleproject
Hi,

There have been users that have successfully done that. I asked one, who mentioned:

- Make VK_ICD_FILENAMES point to MoltenVK_icd.json and then load up ANGLE
- Keep MoltenVK and ANGLE inside the same macOS app bundle

They mentioned they use these in args.gn (although a lot of it is redundant with the default values):

```
target_cpu = "arm64"
angle_enable_gl = true
angle_enable_gl_desktop_backend = true
angle_enable_d3d11 = false
angle_enable_d3d9 = false
angle_enable_glsl = true
angle_enable_metal = true
angle_enable_null = false
angle_enable_swiftshader = false
angle_enable_trace = false
angle_enable_annotator_run_time_checks = false
angle_enable_vulkan_validation_layers = false
angle_enable_vulkan_gpu_trace_events = false
angle_enable_vulkan = true
angle_enable_wgpu = false
angle_expose_non_conformant_extensions_and_versions = true
#angle_enable_custom_vulkan_cmd_buffers = false
angle_enable_overlay = true
angle_enable_share_context_lock = false
angle_enable_global_mutex_recursion = true
angle_has_astc_encoder = false
is_component_build = false
enable_stripping = false
dcheck_always_on = false
angle_use_wayland = false
is_debug = false
use_custom_libcxx = true
is_clang = true
use_thin_lto = true
treat_warnings_as_errors = false
angle_use_custom_libvulkan = true
is_asan = false
is_tsan = false
# Explicitly disable debugging features we don't want in non is_debug builds
angle_build_all = false
angle_has_histograms = false
angle_has_rapidjson = false
angle_has_frame_capture = false
# macOS-specific configuration
mac_deployment_target = "11.0"
angle_shared_libvulkan = true
enable_dsyms = true
# Support ccache wrapper for faster repeated builds
cc_wrapper = "/opt/homebrew/bin/ccache"
```
Reply all
Reply to author
Forward
0 new messages