| # Copyright 2016 The Chromium Authors |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/config/cast.gni") |
| import("//build/config/chrome_build.gni") |
| import("//build/config/gclient_args.gni") |
| |
| # This is the default set of Android configurations for which we support |
| # WebXR. This flag should not be checked directly and is instead intended to |
| # ease setting the default value for the various WebXr platforms that we would |
| # like to support on Android by default. Embedders can still override any of |
| # the particular runtimes if they do not wish to enable them. |
| _is_xr_supported_android = is_android && !is_cast_android && |
| (current_cpu == "arm" || current_cpu == "arm64" || |
| current_cpu == "x86" || current_cpu == "x64") |
| |
| declare_args() { |
| enable_cardboard = _is_xr_supported_android |
| |
| enable_arcore = _is_xr_supported_android |
| |
| # The VR browser overlay UI renders its shaders through the command-buffer GL |
| # bindings (VR_USE_COMMAND_BUFFER); Linux must select the same mode Windows |
| # does. Otherwise the overlay renderers compile against the native ui/gl |
| # bindings (VR_USE_NATIVE_GL), which are never made current on the browser's |
| # VR UI thread, and the first glCreateShader() dereferences a null |
| # gl::g_current_gl_context. The WebXR data path is unaffected -- it uses |
| # gpu::gles2::GLES2Interface directly, not these bindings. |
| use_command_buffer = is_win || is_linux |
| |
| # To build with OpenXR support, the OpenXR Loader needs to be pulled to |
| # third_party/openxr. |
| enable_openxr = |
| checkout_openxr && |
| (is_win || is_linux || (_is_xr_supported_android && |
| (current_cpu == "arm" || current_cpu == "arm64"))) |
| } |
| |
| # The OpenXR platforms where the runtime is an externally-installed desktop |
| # runtime discovered through the loader, rather than part of the OS image as on |
| # Android. They share the polling-for-availability and context-provider plumbing |
| # in //content/services/isolated_xr_device, so it is guarded on this rather than |
| # repeating (is_win || is_linux) at every site. |
| is_desktop_openxr = is_win || is_linux |
| |
| declare_args() { |
| # Enable VR device support whenever VR device SDK(s) are supported. |
| # We enable VR on Linux even though VR features aren't usable because |
| # the binary size impact is small and allows many VR tests to run on Linux |
| enable_vr = |
| enable_openxr || enable_cardboard || enable_arcore || |
| (is_linux && !is_castos && |
| (current_cpu == "x64" || current_cpu == "x86" || current_cpu == "arm64")) |
| } |