Commit 0449a902 by Jonah Ryan-Davis Committed by Commit Bot

Move gpu_test_expectations from third_party into ANGLE.

1. Copy the code from src/tests/third_party/gpu_test_expectations to src/test/test_expectations, rename .cc files to .cpp. Put these in a new static library and update dEQP to link against it in src/tests/BUILD.gn. 2. Merge the code in angle_config.h into the rest of the expectations parser, this code was added so that the rest of the parser would compile in ANGLE's tree with minimal modification. Still need to follow up with the third step to close the issue. Bug: angleproject:2677 Change-Id: Icf09b4eeed83a6d09b1964ad2adcfa85cabb4b63 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1536312 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 4ae2c12f
......@@ -659,26 +659,34 @@ if (build_angle_deqp_tests && !is_fuchsia) {
}
}
config("angle_deqp_gtest_support_config") {
include_dirs = [ "third_party/gpu_test_expectations" ]
config("angle_deqp_test_expectations_config") {
include_dirs = [ "${angle_root}:angle_common" ]
}
angle_static_library("angle_deqp_test_expectations") {
public_configs += [ ":angle_deqp_test_expectations_config" ]
public_deps = [
"${angle_root}:angle_common",
"${angle_root}:angle_util",
]
sources = deqp_test_expectations_sources
if (is_mac) {
sources += deqp_test_expectations_sources_mac
libs = [ "Cocoa.framework" ]
}
}
angle_source_set("angle_deqp_gtest_support") {
testonly = true
public_deps = [
":angle_deqp_test_expectations",
":angle_deqp_tests_main",
"${angle_root}:angle_common",
"${angle_root}:angle_util",
]
public_configs += [ ":angle_deqp_gtest_support_config" ]
sources = deqp_gpu_test_expectations_sources
if (is_mac) {
sources += deqp_gpu_test_expectations_sources_mac
libs = [ "Cocoa.framework" ]
}
libs = []
if (!is_android) {
public_deps += [ "${angle_root}:angle_gpu_info_util" ]
......
......@@ -1143,15 +1143,15 @@ deqp_libtester_sources_android = [
"$_deqp_path/framework/platform/android/tcuAndroidInternals.cpp",
"$_deqp_path/framework/platform/android/tcuAndroidInternals.hpp",
]
deqp_gpu_test_expectations_sources = [
"third_party/gpu_test_expectations/gpu_info.cc",
"third_party/gpu_test_expectations/gpu_info.h",
"third_party/gpu_test_expectations/gpu_test_config.cc",
"third_party/gpu_test_expectations/gpu_test_config.h",
"third_party/gpu_test_expectations/gpu_test_expectations_parser.cc",
"third_party/gpu_test_expectations/gpu_test_expectations_parser.h",
deqp_test_expectations_sources = [
"test_expectations/gpu_info.cpp",
"test_expectations/gpu_info.h",
"test_expectations/gpu_test_config.cpp",
"test_expectations/gpu_test_config.h",
"test_expectations/gpu_test_expectations_parser.cpp",
"test_expectations/gpu_test_expectations_parser.h",
]
deqp_gpu_test_expectations_sources_mac = [
"third_party/gpu_test_expectations/gpu_test_config_mac.mm",
"third_party/gpu_test_expectations/gpu_test_config_mac.h",
deqp_test_expectations_sources_mac = [
"test_expectations/gpu_test_config_mac.mm",
"test_expectations/gpu_test_config_mac.h",
]
......@@ -19,8 +19,8 @@
#include "common/debug.h"
#include "common/platform.h"
#include "common/string_utils.h"
#include "gpu_test_expectations_parser.h"
#include "platform/Platform.h"
#include "tests/test_expectations/gpu_test_expectations_parser.h"
#include "util/system_utils.h"
namespace
......
......@@ -13,17 +13,19 @@
#include <string>
#include <vector>
#include "angle_config.h"
#include "gpu_test_config.h"
#if defined(USE_X11)
typedef unsigned long VisualID;
#endif
namespace gpu {
namespace gpu
{
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum class GpuSeriesType {
enum class GpuSeriesType
{
kUnknown = 0,
// Intel 6th gen
kIntelSandyBridge = 1,
......@@ -45,7 +47,8 @@ enum class GpuSeriesType {
};
// Video profile. This *must* match media::VideoCodecProfile.
enum VideoCodecProfile {
enum VideoCodecProfile
{
VIDEO_CODEC_PROFILE_UNKNOWN = -1,
VIDEO_CODEC_PROFILE_MIN = VIDEO_CODEC_PROFILE_UNKNOWN,
H264PROFILE_BASELINE = 0,
......@@ -79,59 +82,60 @@ enum VideoCodecProfile {
};
// Specification of a decoding profile supported by a hardware decoder.
struct GPU_EXPORT VideoDecodeAcceleratorSupportedProfile {
struct GPU_EXPORT VideoDecodeAcceleratorSupportedProfile
{
VideoCodecProfile profile;
gfx::Size max_resolution;
gfx::Size min_resolution;
bool encrypted_only;
};
using VideoDecodeAcceleratorSupportedProfiles =
std::vector<VideoDecodeAcceleratorSupportedProfile>;
using VideoDecodeAcceleratorSupportedProfiles = std::vector<VideoDecodeAcceleratorSupportedProfile>;
struct GPU_EXPORT VideoDecodeAcceleratorCapabilities {
struct GPU_EXPORT VideoDecodeAcceleratorCapabilities
{
VideoDecodeAcceleratorCapabilities();
VideoDecodeAcceleratorCapabilities(
const VideoDecodeAcceleratorCapabilities& other);
VideoDecodeAcceleratorCapabilities(const VideoDecodeAcceleratorCapabilities &other);
~VideoDecodeAcceleratorCapabilities();
VideoDecodeAcceleratorSupportedProfiles supported_profiles;
uint32_t flags;
};
// Specification of an encoding profile supported by a hardware encoder.
struct GPU_EXPORT VideoEncodeAcceleratorSupportedProfile {
struct GPU_EXPORT VideoEncodeAcceleratorSupportedProfile
{
VideoCodecProfile profile;
gfx::Size max_resolution;
uint32_t max_framerate_numerator;
uint32_t max_framerate_denominator;
};
using VideoEncodeAcceleratorSupportedProfiles =
std::vector<VideoEncodeAcceleratorSupportedProfile>;
using VideoEncodeAcceleratorSupportedProfiles = std::vector<VideoEncodeAcceleratorSupportedProfile>;
enum class ImageDecodeAcceleratorType {
enum class ImageDecodeAcceleratorType
{
kJpeg = 0,
kUnknown = 1,
kMaxValue = kUnknown,
};
enum class ImageDecodeAcceleratorSubsampling {
enum class ImageDecodeAcceleratorSubsampling
{
k420 = 0,
k422 = 1,
kMaxValue = k422,
};
// Specification of an image decoding profile supported by a hardware decoder.
struct GPU_EXPORT ImageDecodeAcceleratorSupportedProfile {
struct GPU_EXPORT ImageDecodeAcceleratorSupportedProfile
{
ImageDecodeAcceleratorSupportedProfile();
ImageDecodeAcceleratorSupportedProfile(
const ImageDecodeAcceleratorSupportedProfile& other);
ImageDecodeAcceleratorSupportedProfile(
ImageDecodeAcceleratorSupportedProfile&& other);
ImageDecodeAcceleratorSupportedProfile(const ImageDecodeAcceleratorSupportedProfile &other);
ImageDecodeAcceleratorSupportedProfile(ImageDecodeAcceleratorSupportedProfile &&other);
~ImageDecodeAcceleratorSupportedProfile();
ImageDecodeAcceleratorSupportedProfile& operator=(
const ImageDecodeAcceleratorSupportedProfile& other);
ImageDecodeAcceleratorSupportedProfile& operator=(
ImageDecodeAcceleratorSupportedProfile&& other);
ImageDecodeAcceleratorSupportedProfile &operator=(
const ImageDecodeAcceleratorSupportedProfile &other);
ImageDecodeAcceleratorSupportedProfile &operator=(
ImageDecodeAcceleratorSupportedProfile &&other);
// Fields common to all image types.
// Type of image to which this profile applies, e.g., JPEG.
......@@ -144,25 +148,32 @@ struct GPU_EXPORT ImageDecodeAcceleratorSupportedProfile {
// The supported chroma subsampling formats, e.g. 4:2:0.
std::vector<ImageDecodeAcceleratorSubsampling> subsamplings;
};
using ImageDecodeAcceleratorSupportedProfiles =
std::vector<ImageDecodeAcceleratorSupportedProfile>;
using ImageDecodeAcceleratorSupportedProfiles = std::vector<ImageDecodeAcceleratorSupportedProfile>;
#if defined(OS_WIN)
// Common overlay formats that we're interested in. Must match the OverlayFormat
// enum in //tools/metrics/histograms/enums.xml. Mapped to corresponding DXGI
// formats in DirectCompositionSurfaceWin.
enum class OverlayFormat { kBGRA = 0, kYUY2 = 1, kNV12 = 2, kMaxValue = kNV12 };
enum class OverlayFormat
{
kBGRA = 0,
kYUY2 = 1,
kNV12 = 2,
kMaxValue = kNV12
};
GPU_EXPORT const char* OverlayFormatToString(OverlayFormat format);
GPU_EXPORT const char *OverlayFormatToString(OverlayFormat format);
struct GPU_EXPORT OverlayCapability {
struct GPU_EXPORT OverlayCapability
{
OverlayFormat format;
bool is_scaling_supported;
bool operator==(const OverlayCapability& other) const;
bool operator==(const OverlayCapability &other) const;
};
using OverlayCapabilities = std::vector<OverlayCapability>;
struct GPU_EXPORT Dx12VulkanVersionInfo {
struct GPU_EXPORT Dx12VulkanVersionInfo
{
bool IsEmpty() const { return !d3d12_feature_level && !vulkan_version; }
// True if the GPU driver supports DX12.
......@@ -179,14 +190,16 @@ struct GPU_EXPORT Dx12VulkanVersionInfo {
};
#endif
struct GPU_EXPORT GPUInfo {
struct GPU_EXPORT GPUDevice {
struct GPU_EXPORT GPUInfo
{
struct GPU_EXPORT GPUDevice
{
GPUDevice();
GPUDevice(const GPUDevice& other);
GPUDevice(GPUDevice&& other) noexcept;
GPUDevice(const GPUDevice &other);
GPUDevice(GPUDevice &&other) noexcept;
~GPUDevice() noexcept;
GPUDevice& operator=(const GPUDevice& other);
GPUDevice& operator=(GPUDevice&& other) noexcept;
GPUDevice &operator=(const GPUDevice &other);
GPUDevice &operator=(GPUDevice &&other) noexcept;
// The DWORD (uint32_t) representing the graphics card vendor id.
uint32_t vendor_id;
......@@ -216,12 +229,12 @@ struct GPU_EXPORT GPUInfo {
};
GPUInfo();
GPUInfo(const GPUInfo& other);
GPUInfo(const GPUInfo &other);
~GPUInfo();
// The currently active gpu.
GPUDevice& active_gpu();
const GPUDevice& active_gpu() const;
GPUDevice &active_gpu();
const GPUDevice &active_gpu() const;
bool IsInitialized() const;
......@@ -324,12 +337,10 @@ struct GPU_EXPORT GPUInfo {
#endif
VideoDecodeAcceleratorCapabilities video_decode_accelerator_capabilities;
VideoEncodeAcceleratorSupportedProfiles
video_encode_accelerator_supported_profiles;
VideoEncodeAcceleratorSupportedProfiles video_encode_accelerator_supported_profiles;
bool jpeg_decode_accelerator_supported;
ImageDecodeAcceleratorSupportedProfiles
image_decode_accelerator_supported_profiles;
ImageDecodeAcceleratorSupportedProfiles image_decode_accelerator_supported_profiles;
#if defined(USE_X11)
VisualID system_visual;
......@@ -345,18 +356,18 @@ struct GPU_EXPORT GPUInfo {
// enumerate the values in this structure without having to embed
// references to its specific member variables. This simplifies the
// addition of new fields to this type.
class Enumerator {
class Enumerator
{
public:
// The following methods apply to the "current" object. Initially this
// is the root object, but calls to BeginGPUDevice/EndGPUDevice and
// BeginAuxAttributes/EndAuxAttributes change the object to which these
// calls should apply.
virtual void AddInt64(const char* name, int64_t value) = 0;
virtual void AddInt(const char* name, int value) = 0;
virtual void AddString(const char* name, const std::string& value) = 0;
virtual void AddBool(const char* name, bool value) = 0;
virtual void AddTimeDeltaInSecondsF(const char* name,
const base::TimeDelta& value) = 0;
virtual void AddInt64(const char *name, int64_t value) = 0;
virtual void AddInt(const char *name, int value) = 0;
virtual void AddString(const char *name, const std::string &value) = 0;
virtual void AddBool(const char *name, bool value) = 0;
virtual void AddTimeDeltaInSecondsF(const char *name, const base::TimeDelta &value) = 0;
// Markers indicating that a GPUDevice is being described.
virtual void BeginGPUDevice() = 0;
......@@ -393,7 +404,7 @@ struct GPU_EXPORT GPUInfo {
};
// Outputs the fields in this structure to the provided enumerator.
void EnumerateFields(Enumerator* enumerator) const;
void EnumerateFields(Enumerator *enumerator) const;
};
} // namespace gpu
......
//
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// angle_config.h:
// Helpers for importing the gpu test expectations package from Chrome.
//
#ifndef ANGLE_GPU_TEST_EXPECTATIONS_ANGLE_CONFIG_H_
#define ANGLE_GPU_TEST_EXPECTATIONS_ANGLE_CONFIG_H_
#ifndef ANGLE_GPU_CONFIG_GPU_TEST_CONFIG_H_
#define ANGLE_GPU_CONFIG_GPU_TEST_CONFIG_H_
#include <stdint.h>
#include <iostream>
#include <string>
#include <vector>
#include "common/debug.h"
#include "common/string_utils.h"
......@@ -73,4 +69,145 @@ struct DxDiagNode
#endif
// clang-format on
#endif
namespace gpu
{
struct GPUInfo;
class GPU_EXPORT GPUTestConfig
{
public:
enum OS
{
kOsUnknown = 0,
kOsWinXP = 1 << 0,
kOsWinVista = 1 << 1,
kOsWin7 = 1 << 2,
kOsWin8 = 1 << 3,
kOsMacLeopard = 1 << 4,
kOsMacSnowLeopard = 1 << 5,
kOsMacLion = 1 << 6,
kOsMacMountainLion = 1 << 7,
kOsMacMavericks = 1 << 8,
kOsMacYosemite = 1 << 9,
kOsMacElCapitan = 1 << 10,
kOsMacSierra = 1 << 11,
kOsMacHighSierra = 1 << 12,
kOsMacMojave = 1 << 13,
kOsMac = kOsMacLeopard | kOsMacSnowLeopard | kOsMacLion | kOsMacMountainLion |
kOsMacMavericks | kOsMacYosemite | kOsMacElCapitan | kOsMacSierra |
kOsMacHighSierra | kOsMacMojave,
kOsLinux = 1 << 14,
kOsChromeOS = 1 << 15,
kOsAndroid = 1 << 16,
kOsWin10 = 1 << 17,
kOsWin = kOsWinXP | kOsWinVista | kOsWin7 | kOsWin8 | kOsWin10,
kOsFuchsia = 1 << 18,
};
enum BuildType
{
kBuildTypeUnknown = 0,
kBuildTypeRelease = 1 << 0,
kBuildTypeDebug = 1 << 1,
};
enum API
{
kAPIUnknown = 0,
kAPID3D9 = 1 << 0,
kAPID3D11 = 1 << 1,
kAPIGLDesktop = 1 << 2,
kAPIGLES = 1 << 3,
kAPIVulkan = 1 << 4,
};
GPUTestConfig();
GPUTestConfig(const GPUTestConfig &other);
virtual ~GPUTestConfig();
void set_os(int32_t os);
void set_gpu_device_id(uint32_t id);
void set_build_type(int32_t build_type);
void set_api(int32_t api);
virtual void AddGPUVendor(uint32_t gpu_vendor);
int32_t os() const { return os_; }
const std::vector<uint32_t> &gpu_vendor() const { return gpu_vendor_; }
uint32_t gpu_device_id() const { return gpu_device_id_; }
int32_t build_type() const { return build_type_; }
int32_t api() const { return api_; }
// Check if the config is valid. For example, if gpu_device_id_ is set, but
// gpu_vendor_ is unknown, then it's invalid.
virtual bool IsValid() const;
// Check if two configs overlap, i.e., if there exists a config that matches
// both configs.
bool OverlapsWith(const GPUTestConfig &config) const;
// Disable validation of GPU vendor and device ids.
void DisableGPUInfoValidation();
protected:
void ClearGPUVendor();
// Indicates that the OS has the notion of a numeric GPU vendor and device id
// and this data should be validated.
bool validate_gpu_info_;
private:
// operating system.
int32_t os_;
// GPU vendor.
std::vector<uint32_t> gpu_vendor_;
// GPU device id (unique to each vendor).
uint32_t gpu_device_id_;
// Release or Debug.
int32_t build_type_;
// Back-end rendering APIs.
int32_t api_;
};
class GPU_EXPORT GPUTestBotConfig : public GPUTestConfig
{
public:
GPUTestBotConfig() = default;
~GPUTestBotConfig() override;
// This should only be called when no gpu_vendor is added.
void AddGPUVendor(uint32_t gpu_vendor) override;
// Return false if gpu_info does not have valid vendor_id and device_id.
bool SetGPUInfo(const GPUInfo &gpu_info);
// Check if the bot config is valid, i.e., if it is one valid test-bot
// environment. For example, if a field is unknown, or if OS is not one
// fully defined OS, then it's valid.
bool IsValid() const override;
// Check if a bot config matches a test config, i.e., the test config is a
// superset of the bot config.
bool Matches(const GPUTestConfig &config) const;
bool Matches(const std::string &config_data) const;
// Setup the config with the current gpu testing environment.
// If gpu_info is nullptr, collect GPUInfo first.
bool LoadCurrentConfig(const GPUInfo *gpu_info);
// Check if this bot's config matches |config_data| or any of the |configs|.
static bool CurrentConfigMatches(const std::string &config_data);
static bool CurrentConfigMatches(const std::vector<std::string> &configs);
// Check if the bot has blacklisted all GPU features.
static bool GpuBlacklistedOnBot();
};
} // namespace gpu
#endif // ANGLE_GPU_CONFIG_GPU_TEST_CONFIG_H_
......@@ -11,14 +11,16 @@
#include <string>
#include <vector>
#include "angle_config.h"
#include "gpu_test_config.h"
namespace gpu {
namespace gpu
{
class GPU_EXPORT GPUTestExpectationsParser {
class GPU_EXPORT GPUTestExpectationsParser
{
public:
enum GPUTestExpectation {
enum GPUTestExpectation
{
kGpuTestPass = 1 << 0,
kGpuTestFail = 1 << 1,
kGpuTestFlaky = 1 << 2,
......@@ -32,22 +34,23 @@ class GPU_EXPORT GPUTestExpectationsParser {
// Parse the text expectations, and if no error is encountered,
// save all the entries. Otherwise, generate error messages.
// Return true if parsing succeeds.
bool LoadTestExpectations(const std::string& data);
bool LoadTestExpectationsFromFile(const std::string& path);
bool LoadTestExpectations(const std::string &data);
bool LoadTestExpectationsFromFile(const std::string &path);
// Query error messages from the last LoadTestExpectations() call.
const std::vector<std::string>& GetErrorMessages() const;
const std::vector<std::string> &GetErrorMessages() const;
// Get the test expectation of a given test on a given bot.
int32_t GetTestExpectation(const std::string& test_name,
const GPUTestBotConfig& bot_config) const;
int32_t GetTestExpectation(const std::string &test_name,
const GPUTestBotConfig &bot_config) const;
// Parse a list of config modifiers. If we have a valid entry with no
// conflicts, | config | stores it, and the function returns true.
bool ParseConfig(const std::string& config_data, GPUTestConfig* config);
bool ParseConfig(const std::string &config_data, GPUTestConfig *config);
private:
struct GPUTestExpectationEntry {
struct GPUTestExpectationEntry
{
GPUTestExpectationEntry();
std::string test_name;
......@@ -58,16 +61,14 @@ class GPU_EXPORT GPUTestExpectationsParser {
// Parse a line of text. If we have a valid entry, save it; otherwise,
// generate error messages.
bool ParseLine(const std::string& line_data, size_t line_number);
bool ParseLine(const std::string &line_data, size_t line_number);
// Update OS/GPUVendor/BuildType modifiers. May generate an error message.
bool UpdateTestConfig(GPUTestConfig* config,
int32_t token,
size_t line_number);
bool UpdateTestConfig(GPUTestConfig *config, int32_t token, size_t line_number);
// Update GPUDeviceID modifier. May generate an error message.
bool UpdateTestConfig(GPUTestConfig* config,
const std::string & gpu_device_id,
bool UpdateTestConfig(GPUTestConfig *config,
const std::string &gpu_device_id,
size_t line_number);
// Check if two entries' config overlap with each other. May generate an
......@@ -75,8 +76,8 @@ class GPU_EXPORT GPUTestExpectationsParser {
bool DetectConflictsBetweenEntries();
// Save an error message, which can be queried later.
void PushErrorMessage(const std::string& message, size_t line_number);
void PushErrorMessage(const std::string& message,
void PushErrorMessage(const std::string &message, size_t line_number);
void PushErrorMessage(const std::string &message,
size_t entry1_line_number,
size_t entry2_line_number);
......@@ -87,4 +88,3 @@ class GPU_EXPORT GPUTestExpectationsParser {
} // namespace gpu
#endif // ANGLE_GPU_CONFIG_GPU_TEST_EXPECTATIONS_PARSER_H_
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ANGLE_GPU_CONFIG_GPU_TEST_CONFIG_H_
#define ANGLE_GPU_CONFIG_GPU_TEST_CONFIG_H_
#include <stdint.h>
#include <string>
#include <vector>
#include "angle_config.h"
namespace gpu {
struct GPUInfo;
class GPU_EXPORT GPUTestConfig {
public:
enum OS {
kOsUnknown = 0,
kOsWinXP = 1 << 0,
kOsWinVista = 1 << 1,
kOsWin7 = 1 << 2,
kOsWin8 = 1 << 3,
kOsMacLeopard = 1 << 4,
kOsMacSnowLeopard = 1 << 5,
kOsMacLion = 1 << 6,
kOsMacMountainLion = 1 << 7,
kOsMacMavericks = 1 << 8,
kOsMacYosemite = 1 << 9,
kOsMacElCapitan = 1 << 10,
kOsMacSierra = 1 << 11,
kOsMacHighSierra = 1 << 12,
kOsMacMojave = 1 << 13,
kOsMac = kOsMacLeopard | kOsMacSnowLeopard | kOsMacLion |
kOsMacMountainLion | kOsMacMavericks | kOsMacYosemite |
kOsMacElCapitan | kOsMacSierra | kOsMacHighSierra | kOsMacMojave,
kOsLinux = 1 << 14,
kOsChromeOS = 1 << 15,
kOsAndroid = 1 << 16,
kOsWin10 = 1 << 17,
kOsWin = kOsWinXP | kOsWinVista | kOsWin7 | kOsWin8 | kOsWin10,
kOsFuchsia = 1 << 18,
};
enum BuildType {
kBuildTypeUnknown = 0,
kBuildTypeRelease = 1 << 0,
kBuildTypeDebug = 1 << 1,
};
enum API {
kAPIUnknown = 0,
kAPID3D9 = 1 << 0,
kAPID3D11 = 1 << 1,
kAPIGLDesktop = 1 << 2,
kAPIGLES = 1 << 3,
kAPIVulkan = 1 << 4,
};
GPUTestConfig();
GPUTestConfig(const GPUTestConfig& other);
virtual ~GPUTestConfig();
void set_os(int32_t os);
void set_gpu_device_id(uint32_t id);
void set_build_type(int32_t build_type);
void set_api(int32_t api);
virtual void AddGPUVendor(uint32_t gpu_vendor);
int32_t os() const { return os_; }
const std::vector<uint32_t>& gpu_vendor() const { return gpu_vendor_; }
uint32_t gpu_device_id() const { return gpu_device_id_; }
int32_t build_type() const { return build_type_; }
int32_t api() const { return api_; }
// Check if the config is valid. For example, if gpu_device_id_ is set, but
// gpu_vendor_ is unknown, then it's invalid.
virtual bool IsValid() const;
// Check if two configs overlap, i.e., if there exists a config that matches
// both configs.
bool OverlapsWith(const GPUTestConfig& config) const;
// Disable validation of GPU vendor and device ids.
void DisableGPUInfoValidation();
protected:
void ClearGPUVendor();
// Indicates that the OS has the notion of a numeric GPU vendor and device id
// and this data should be validated.
bool validate_gpu_info_;
private:
// operating system.
int32_t os_;
// GPU vendor.
std::vector<uint32_t> gpu_vendor_;
// GPU device id (unique to each vendor).
uint32_t gpu_device_id_;
// Release or Debug.
int32_t build_type_;
// Back-end rendering APIs.
int32_t api_;
};
class GPU_EXPORT GPUTestBotConfig : public GPUTestConfig {
public:
GPUTestBotConfig() = default;
~GPUTestBotConfig() override;
// This should only be called when no gpu_vendor is added.
void AddGPUVendor(uint32_t gpu_vendor) override;
// Return false if gpu_info does not have valid vendor_id and device_id.
bool SetGPUInfo(const GPUInfo& gpu_info);
// Check if the bot config is valid, i.e., if it is one valid test-bot
// environment. For example, if a field is unknown, or if OS is not one
// fully defined OS, then it's valid.
bool IsValid() const override;
// Check if a bot config matches a test config, i.e., the test config is a
// superset of the bot config.
bool Matches(const GPUTestConfig& config) const;
bool Matches(const std::string& config_data) const;
// Setup the config with the current gpu testing environment.
// If gpu_info is nullptr, collect GPUInfo first.
bool LoadCurrentConfig(const GPUInfo* gpu_info);
// Check if this bot's config matches |config_data| or any of the |configs|.
static bool CurrentConfigMatches(const std::string& config_data);
static bool CurrentConfigMatches(const std::vector<std::string>& configs);
// Check if the bot has blacklisted all GPU features.
static bool GpuBlacklistedOnBot();
};
} // namespace gpu
#endif // ANGLE_GPU_CONFIG_GPU_TEST_CONFIG_H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment