Hash :
c78ebccd
Author :
Date :
2021-09-09T16:47:26
Perf: Add _many_tex_draw test Add a new perf test _many_tex_draw, which draws with 8 textures bound. The intent of this test is to stress calls like retain() with various implementations of vk::Resource. Additionally, this CL updates the textures to use format GL_RGBA, rather than GL_RGB, to avoid the emulation step that's required due to the lack of support for the 3 channel format. Bug: angleproject:5971 Test: DrawCallPerfBenchmark.Run/*_many_tex_draw Change-Id: Iffb39b76fab68cc2a76dfd2da38db7e77cb4dac0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3152171 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Tim Van Patten <timvp@google.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
//
// Copyright 2017 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.
//
// draw_call_perf_utils.h:
// Common utilities for performance tests that need to do a large amount of draw calls.
//
#ifndef TESTS_TEST_UTILS_DRAW_CALL_PERF_UTILS_H_
#define TESTS_TEST_UTILS_DRAW_CALL_PERF_UTILS_H_
#include <stddef.h>
#include "util/gles_loader_autogen.h"
// Returns program ID. The program is left in use, no uniforms.
GLuint SetupSimpleDrawProgram();
// Returns program ID. Uses a 2D texture.
GLuint SetupSimpleTextureProgram();
// Returns program ID. Uses two 2D textures.
GLuint SetupDoubleTextureProgram();
// Returns program ID. Uses eight 2D textures.
GLuint SetupEightTextureProgram();
// Returns program ID. The program is left in use and the uniforms are set to default values:
// uScale = 0.5, uOffset = -0.5
GLuint SetupSimpleScaleAndOffsetProgram();
// Returns buffer ID filled with 2-component triangle coordinates. The buffer is left as bound.
// Generates triangles like this with 2-component coordinates:
// A
// / \.
// / \.
// B-----C
GLuint Create2DTriangleBuffer(size_t numTris, GLenum usage);
// Creates an FBO with a texture color attachment. The texture is GL_RGBA and has dimensions
// width/height. The FBO and texture ids are written to the out parameters.
void CreateColorFBO(GLsizei width, GLsizei height, GLuint *fbo, GLuint *texture);
#endif // TESTS_TEST_UTILS_DRAW_CALL_PERF_UTILS_H_