1 // 2 // Copyright (c) 2014 The ANGLE Project Authors. All rights reserved. 3 // Use of this source code is governed by a BSD-style license that can be 4 // found in the LICENSE file. 5 // 6 7 #include "SimpleBenchmark.h" 8 9 struct BufferSubDataParams : public BenchmarkParams 10 { 11 EGLint requestedRenderer; 12 GLenum vertexType; 13 GLint vertexComponentCount; 14 GLboolean vertexNormalized; 15 GLsizeiptr updateSize; 16 GLsizeiptr bufferSize; 17 unsigned int iterations; 18 unsigned int updatesEveryNFrames; 19 20 virtual std::string name() const; 21 }; 22 23 class BufferSubDataBenchmark : public SimpleBenchmark 24 { 25 public: 26 BufferSubDataBenchmark(const BufferSubDataParams ¶ms); 27 28 virtual bool initializeBenchmark(); 29 virtual void destroyBenchmark(); 30 virtual void beginDrawBenchmark(); 31 virtual void drawBenchmark(); 32 33 private: 34 DISALLOW_COPY_AND_ASSIGN(BufferSubDataBenchmark); 35 36 GLuint mProgram; 37 GLuint mBuffer; 38 uint8_t *mUpdateData; 39 int mNumTris; 40 41 const BufferSubDataParams mParams; 42 }; 43 44