• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright 2017 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 // draw_call_perf_utils.h:
7 //   Common utilities for performance tests that need to do a large amount of draw calls.
8 //
9 
10 #ifndef TESTS_TEST_UTILS_DRAW_CALL_PERF_UTILS_H_
11 #define TESTS_TEST_UTILS_DRAW_CALL_PERF_UTILS_H_
12 
13 #include <stddef.h>
14 
15 #include "util/gles_loader_autogen.h"
16 
17 // Returns program ID. The program is left in use, no uniforms.
18 GLuint SetupSimpleDrawProgram();
19 
20 // Returns program ID. Uses a 2D texture.
21 GLuint SetupSimpleTextureProgram();
22 
23 // Returns program ID. Uses two 2D textures.
24 GLuint SetupDoubleTextureProgram();
25 
26 // Returns program ID. Uses eight 2D textures.
27 GLuint SetupEightTextureProgram();
28 
29 // Returns program ID. The program is left in use and the uniforms are set to default values:
30 // uScale = 0.5, uOffset = -0.5
31 GLuint SetupSimpleScaleAndOffsetProgram();
32 
33 // Returns buffer ID filled with 2-component triangle coordinates. The buffer is left as bound.
34 // Generates triangles like this with 2-component coordinates:
35 //    A
36 //   / \.
37 //  /   \.
38 // B-----C
39 GLuint Create2DTriangleBuffer(size_t numTris, GLenum usage);
40 
41 // Creates an FBO with a texture color attachment. The texture is GL_RGBA and has dimensions
42 // width/height. The FBO and texture ids are written to the out parameters.
43 void CreateColorFBO(GLsizei width, GLsizei height, GLuint *fbo, GLuint *texture);
44 
45 #endif  // TESTS_TEST_UTILS_DRAW_CALL_PERF_UTILS_H_
46