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