#include "ANGLEPerfTest.h"
#include <array>
#include <iostream>
#include <random>
#include <sstream>
#include "common/debug.h"
#include "util/Matrix.h"
#include "util/shader_utils.h"
usingnamespaceangle;
namespace
{
constexpr unsigned int kIterationsPerStep = …;
enum DataMode
{ … };
enum DataType
{ … };
enum ProgramMode
{ … };
enum MatrixLayout
{ … };
struct UniformsParams final : public RenderTestParams
{ … };
std::ostream &operator<<(std::ostream &os, const UniformsParams ¶ms)
{ … }
std::string UniformsParams::story() const
{ … }
class UniformsBenchmark : public ANGLERenderTest,
public ::testing::WithParamInterface<UniformsParams>
{ … };
std::vector<Matrix4> GenMatrixData(size_t count, int parity)
{ … }
UniformsBenchmark::UniformsBenchmark() : … { … }
void UniformsBenchmark::initializeBenchmark()
{ … }
std::string GetUniformLocationName(size_t idx, bool vertexShader)
{ … }
void UniformsBenchmark::initShaders()
{ … }
void UniformsBenchmark::destroyBenchmark()
{ … }
template <bool MultiProgram, typename SetUniformFunc>
void UniformsBenchmark::drawLoop(const SetUniformFunc &setUniformsFunc)
{ … }
void UniformsBenchmark::drawBenchmark()
{ … }
usingnamespaceegl_platform;
UniformsParams VectorUniforms(const EGLPlatformParameters &egl,
DataMode dataMode,
ProgramMode programMode = ProgramMode::SINGLE)
{ … }
UniformsParams MatrixUniforms(const EGLPlatformParameters &egl,
DataMode dataMode,
DataType dataType,
MatrixLayout matrixLayout)
{ … }
}
TEST_P(UniformsBenchmark, Run)
{ … }
ANGLE_INSTANTIATE_TEST(…);