• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright 2017 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6 // DrawCallPerfParams.h:
7 //   Parametrization for performance tests for ANGLE draw call overhead.
8 //
9 
10 #ifndef TESTS_PERF_TESTS_DRAW_CALL_PERF_PARAMS_H_
11 #define TESTS_PERF_TESTS_DRAW_CALL_PERF_PARAMS_H_
12 
13 #include <ostream>
14 
15 #include "ANGLEPerfTest.h"
16 #include "test_utils/angle_test_configs.h"
17 
18 struct DrawCallPerfParams : public RenderTestParams
19 {
20     // Common default options
21     DrawCallPerfParams();
22     ~DrawCallPerfParams() override;
23 
24     std::string story() const override;
25 
26     double runTimeSeconds;
27     int numTris;
28 };
29 
30 namespace params
31 {
32 template <typename ParamsT>
D3D11(const ParamsT & in)33 ParamsT D3D11(const ParamsT &in)
34 {
35     ParamsT out       = in;
36     out.eglParameters = angle::egl_platform::D3D11();
37     return out;
38 }
39 
40 template <typename ParamsT>
Metal(const ParamsT & in)41 ParamsT Metal(const ParamsT &in)
42 {
43     ParamsT out       = in;
44     out.eglParameters = angle::egl_platform::METAL();
45     return out;
46 }
47 
48 template <typename ParamsT>
GL(const ParamsT & in)49 ParamsT GL(const ParamsT &in)
50 {
51     ParamsT out       = in;
52     out.eglParameters = angle::egl_platform::OPENGL_OR_GLES();
53     return out;
54 }
55 
56 template <typename ParamsT>
GL3(const ParamsT & in)57 ParamsT GL3(const ParamsT &in)
58 {
59     ParamsT out       = in;
60     out.eglParameters = angle::egl_platform::OPENGL_OR_GLES(3, 0);
61     return out;
62 }
63 
64 template <typename ParamsT>
Vulkan(const ParamsT & in)65 ParamsT Vulkan(const ParamsT &in)
66 {
67     ParamsT out       = in;
68     out.eglParameters = angle::egl_platform::VULKAN();
69     return out;
70 }
71 
72 template <typename ParamsT>
VulkanMockICD(const ParamsT & in)73 ParamsT VulkanMockICD(const ParamsT &in)
74 {
75     ParamsT out       = in;
76     out.eglParameters = angle::egl_platform::VULKAN_NULL();
77     return out;
78 }
79 
80 template <typename ParamsT>
VulkanSwiftShader(const ParamsT & in)81 ParamsT VulkanSwiftShader(const ParamsT &in)
82 {
83     ParamsT out       = in;
84     out.eglParameters = angle::egl_platform::VULKAN_SWIFTSHADER();
85     return out;
86 }
87 
88 template <typename ParamsT>
WGL(const ParamsT & in)89 ParamsT WGL(const ParamsT &in)
90 {
91     ParamsT out = in;
92     out.driver  = angle::GLESDriverType::SystemWGL;
93     return out;
94 }
95 
96 template <typename ParamsT>
EGL(const ParamsT & in)97 ParamsT EGL(const ParamsT &in)
98 {
99     ParamsT out = in;
100     out.driver  = angle::GLESDriverType::SystemEGL;
101     return out;
102 }
103 
104 template <typename ParamsT>
Zink(const ParamsT & in)105 ParamsT Zink(const ParamsT &in)
106 {
107     ParamsT out = in;
108     out.driver  = angle::GLESDriverType::ZinkEGL;
109     return out;
110 }
111 
112 template <typename ParamsT>
Native(const ParamsT & in)113 ParamsT Native(const ParamsT &in)
114 {
115 #if defined(ANGLE_PLATFORM_WINDOWS)
116     return WGL(in);
117 #else
118     return EGL(in);
119 #endif
120 }
121 }  // namespace params
122 
123 #endif  // TESTS_PERF_TESTS_DRAW_CALL_PERF_PARAMS_H_
124