chromium/third_party/angle/src/tests/perf_tests/UniformsPerf.cpp

//
// Copyright 2016 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.
//
// UniformsBenchmark:
//   Performance test for setting uniform data.
//

#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 =;

// Controls when we call glUniform, if the data is the same as last frame.
enum DataMode
{};

// TODO(jmadill): Use an ANGLE enum for this?
enum DataType
{};

// Determines if we state change the program between draws.
// This covers a performance problem in ANGLE where calling UseProgram reuploads uniform data.
enum ProgramMode
{};

enum MatrixLayout
{};

struct UniformsParams final : public RenderTestParams
{};

std::ostream &operator<<(std::ostream &os, const UniformsParams &params)
{}

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()
{}

// Hopefully the compiler is smart enough to inline the lambda setUniformsFunc.
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)
{}

}  // anonymous namespace

TEST_P(UniformsBenchmark, Run)
{}

ANGLE_INSTANTIATE_TEST();