Hash :
9637185c
Author :
Date :
2022-03-10T15:38:13
Add ForceGPUSwitch to EGL_ANGLE_power_preference eglHandleGPUSwitch() does not work with WebKit sandbox profile. The root cause is that we do not know the primary display, and as such we do not know which GPU drives this. Add eglForceGPUSwitchANGLE(display, gpuIDHigh, gpuIDLow). This lets the caller figure out the GPU in another process. Then the caller can just set the GPU in the sandboxed process. Add tests that are disabled by default until the runner and the infrastructure supports running the tests with automatic switching enabled. Bug: angleproject:7092 Change-Id: I316ee431156596effbdb89659a5e24291719a204 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3516274 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
//
// Copyright 2022 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// system_info_util.h:
// Implementation of common test utilities for operating with SystemInfo.
//
#ifndef ANGLE_TESTS_SYSTEM_INFO_UTIL_H_
#define ANGLE_TESTS_SYSTEM_INFO_UTIL_H_
#include <stddef.h>
namespace angle
{
struct SystemInfo;
} // namespace angle
// Returns the index of the low power GPU in SystemInfo.
size_t FindLowPowerGPU(const angle::SystemInfo &);
// Returns the index of the high power GPU in SystemInfo.
size_t FindHighPowerGPU(const angle::SystemInfo &);
// Returns the index of the GPU in SystemInfo based on the OpenGL renderer string.
size_t FindActiveOpenGLGPU(const angle::SystemInfo &);
#endif // ANGLE_TESTS_SYSTEM_INFO_UTIL_H_