summaryrefslogtreecommitdiffstats
path: root/gpu/config/gpu_util.h
blob: c10cca6c77384f4fa1df7963e460ccb9ca647e79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// 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 GPU_CONFIG_GPU_UTIL_H_
#define GPU_CONFIG_GPU_UTIL_H_

#include <set>
#include <string>

#include "base/command_line.h"
#include "build/build_config.h"
#include "gpu/gpu_export.h"

class CommandLine;

namespace gpu {

struct GPUInfo;

// Merge features in src into dst.
GPU_EXPORT void MergeFeatureSets(
    std::set<int>* dst, const std::set<int>& src);

// Collect basic GPUInfo, compute the driver bug workarounds for the current
// system, and append the |command_line|.
GPU_EXPORT void ApplyGpuDriverBugWorkarounds(CommandLine* command_line);

// With provided GPUInfo, compute the driver bug workarounds for the current
// system, and append the |command_line|.
GPU_EXPORT void ApplyGpuDriverBugWorkarounds(
    const GPUInfo& gpu_inco, CommandLine* command_line);

// |str| is in the format of "feature1,feature2,...,featureN".
GPU_EXPORT void StringToFeatureSet(
    const std::string& str, std::set<int>* feature_set);

// Get the set of workarounds from switches provided in |command_line|
GPU_EXPORT std::set<int> WorkaroundsFromCommandLine(
    CommandLine* command_line);

}  // namespace gpu

#endif  // GPU_CONFIG_GPU_UTIL_H_