#include "ANGLEPerfTest.h"
#include <iostream>
#include <random>
#include <sstream>
#include "test_utils/gl_raii.h"
#include "util/shader_utils.h"
usingnamespaceangle;
namespace
{
constexpr unsigned int kIterationsPerStep = …;
struct GenerateMipmapParams final : public RenderTestParams
{ … };
std::ostream &operator<<(std::ostream &os, const GenerateMipmapParams ¶ms)
{ … }
std::string GenerateMipmapParams::story() const
{ … }
template <typename T>
void FillWithRandomData(T *storage)
{ … }
class GenerateMipmapBenchmarkBase : public ANGLERenderTest,
public ::testing::WithParamInterface<GenerateMipmapParams>
{ … };
class GenerateMipmapBenchmark : public GenerateMipmapBenchmarkBase
{ … };
class GenerateMipmapWithRedefineBenchmark : public GenerateMipmapBenchmarkBase
{ … };
GenerateMipmapBenchmarkBase::GenerateMipmapBenchmarkBase(const char *benchmarkName)
: … { … }
void GenerateMipmapBenchmarkBase::initializeBenchmark()
{ … }
void GenerateMipmapBenchmarkBase::initShaders()
{ … }
void GenerateMipmapBenchmarkBase::destroyBenchmark()
{ … }
void GenerateMipmapBenchmark::initializeBenchmark()
{ … }
void GenerateMipmapBenchmark::drawBenchmark()
{ … }
void GenerateMipmapWithRedefineBenchmark::drawBenchmark()
{ … }
GenerateMipmapParams D3D11Params(bool webglCompat, bool singleIteration)
{ … }
GenerateMipmapParams MetalParams(bool webglCompat, bool singleIteration)
{ … }
GenerateMipmapParams OpenGLOrGLESParams(bool webglCompat, bool singleIteration)
{ … }
GenerateMipmapParams VulkanParams(bool webglCompat, bool singleIteration, bool emulatedFormat)
{ … }
}
TEST_P(GenerateMipmapBenchmark, Run)
{ … }
TEST_P(GenerateMipmapWithRedefineBenchmark, Run)
{ … }
usingnamespaceparams;
ANGLE_INSTANTIATE_TEST(…);
ANGLE_INSTANTIATE_TEST(…);