Hash :
05ba83a0
Author :
Date :
2019-06-13T13:26:58
Refactor DrawCallPerfParams. Makes it a bit easier to work with. In prep for adding offscreen configs. Bug: angleproject:3117 Change-Id: Ie2497574b2687592b7b3df2f7b933a19e83b6d16 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1650784 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
//
// Copyright (c) 2017 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.
//
// DrawCallPerfParams.cpp:
// Parametrization for performance tests for ANGLE draw call overhead.
//
#include "DrawCallPerfParams.h"
#include <sstream>
DrawCallPerfParams::DrawCallPerfParams()
{
majorVersion = 2;
minorVersion = 0;
windowWidth = 64;
windowHeight = 64;
// Lower the iteration count in debug.
#if !defined(NDEBUG)
iterationsPerStep = 100;
#else
iterationsPerStep = 20000;
#endif
runTimeSeconds = 10.0;
numTris = 1;
offscreen = false;
}
DrawCallPerfParams::~DrawCallPerfParams() = default;
std::string DrawCallPerfParams::suffix() const
{
std::stringstream strstr;
strstr << RenderTestParams::suffix();
if (numTris == 0)
{
strstr << "_validation_only";
}
if (offscreen)
{
strstr << "_offscreen";
}
if (eglParameters.deviceType == EGL_PLATFORM_ANGLE_DEVICE_TYPE_NULL_ANGLE)
{
strstr << "_null";
}
return strstr.str();
}
using namespace angle::egl_platform;
namespace params
{
DrawCallPerfParams DrawCallD3D11()
{
DrawCallPerfParams params;
params.eglParameters = D3D11();
return params;
}
DrawCallPerfParams DrawCallD3D9()
{
DrawCallPerfParams params;
params.eglParameters = D3D9();
return params;
}
DrawCallPerfParams DrawCallOpenGL()
{
DrawCallPerfParams params;
params.eglParameters = OPENGL_OR_GLES();
return params;
}
DrawCallPerfParams DrawCallValidation()
{
DrawCallPerfParams params;
params.eglParameters = DEFAULT();
params.numTris = 0;
params.runTimeSeconds = 5.0;
return params;
}
DrawCallPerfParams DrawCallVulkan()
{
DrawCallPerfParams params;
params.eglParameters = VULKAN();
return params;
}
DrawCallPerfParams DrawCallWGL()
{
DrawCallPerfParams params;
params.driver = angle::GLESDriverType::SystemWGL;
return params;
}
DrawCallPerfParams Offscreen(const DrawCallPerfParams &input)
{
DrawCallPerfParams output = input;
output.offscreen = true;
return output;
}
DrawCallPerfParams NullDevice(const DrawCallPerfParams &input)
{
DrawCallPerfParams output = input;
output.eglParameters.deviceType = EGL_PLATFORM_ANGLE_DEVICE_TYPE_NULL_ANGLE;
return output;
}
} // namespace params