#include "ANGLEPerfTest.h"
#include "DrawCallPerfParams.h"
#include "common/PackedEnums.h"
#include "test_utils/draw_call_perf_utils.h"
#include "util/shader_utils.h"
usingnamespaceangle;
namespace
{
enum class StateChange
{ … };
constexpr size_t kCycleVBOPoolSize = …;
constexpr size_t kManyTexturesCount = …;
struct DrawArraysPerfParams : public DrawCallPerfParams
{ … };
std::string DrawArraysPerfParams::story() const
{ … }
std::ostream &operator<<(std::ostream &os, const DrawArraysPerfParams ¶ms)
{ … }
GLuint CreateSimpleTexture2D()
{ … }
class DrawCallPerfBenchmark : public ANGLERenderTest,
public ::testing::WithParamInterface<DrawArraysPerfParams>
{ … };
DrawCallPerfBenchmark::DrawCallPerfBenchmark() : … { … }
void DrawCallPerfBenchmark::initializeBenchmark()
{ … }
void DrawCallPerfBenchmark::destroyBenchmark()
{ … }
void ClearThenDraw(unsigned int iterations, GLsizei numElements)
{ … }
void JustDraw(unsigned int iterations, GLsizei numElements)
{ … }
template <int kArrayBufferCount>
void ChangeVertexAttribThenDraw(unsigned int iterations, GLsizei numElements, GLuint buffer)
{ … }
template <int kArrayBufferCount>
void ChangeArrayBuffersThenDraw(unsigned int iterations,
GLsizei numElements,
GLuint buffer1,
GLuint buffer2)
{ … }
void ChangeTextureThenDraw(unsigned int iterations,
GLsizei numElements,
GLuint texture1,
GLuint texture2)
{ … }
void ChangeProgramThenDraw(unsigned int iterations,
GLsizei numElements,
GLuint program1,
GLuint program2)
{ … }
void CycleVertexBufferThenDraw(unsigned int iterations,
GLsizei numElements,
const std::vector<GLuint> &vbos,
size_t *currentVBO)
{ … }
void ChangeScissorThenDraw(unsigned int iterations,
GLsizei numElements,
unsigned int windowWidth,
unsigned int windowHeight)
{ … }
void DrawWithEightTextures(unsigned int iterations,
GLsizei numElements,
std::vector<GLuint> textures)
{ … }
void UpdateUniformThenDraw(unsigned int iterations, GLsizei numElements)
{ … }
void DrawCallPerfBenchmark::drawBenchmark()
{ … }
TEST_P(DrawCallPerfBenchmark, Run)
{ … }
usingnamespaceparams;
DrawArraysPerfParams CombineStateChange(const DrawArraysPerfParams &in, StateChange stateChange)
{ … }
P;
std::vector<P> gTestsWithStateChange = …;
std::vector<P> gTestsWithRenderer = …;
std::vector<P> gTestsWithDevice = …;
ANGLE_INSTANTIATE_TEST_ARRAY(…);
}