Commit 828c5946 by Jamie Madill Committed by Commit Bot

Split angle_perftests into white and black box.

The black box version tests traditional GL API features. The white box version is designed to test internal classes and uses a static link against libANGLE and libGLESv2. The black box version will also be extendable to test native drivers directly instead of going through ANGLE. Bug: angleproject:2995 Change-Id: I0b672db37ed38f82157c7a1db70080ff539337ce Reviewed-on: https://chromium-review.googlesource.com/c/1359515 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 4a9f9b08
...@@ -66,6 +66,7 @@ if (build_with_chromium) { ...@@ -66,6 +66,7 @@ if (build_with_chromium) {
"//src/tests:angle_end2end_tests", "//src/tests:angle_end2end_tests",
"//src/tests:angle_perftests", "//src/tests:angle_perftests",
"//src/tests:angle_unittests", "//src/tests:angle_unittests",
"//src/tests:angle_white_box_perftests",
"//src/tests:angle_white_box_tests", "//src/tests:angle_white_box_tests",
] ]
if (build_angle_deqp_tests) { if (build_angle_deqp_tests) {
...@@ -188,7 +189,7 @@ if (is_win || is_linux || is_mac || is_android) { ...@@ -188,7 +189,7 @@ if (is_win || is_linux || is_mac || is_android) {
import("angle_white_box_tests.gni") import("angle_white_box_tests.gni")
test("angle_white_box_tests") { test("angle_white_box_tests") {
include_dirs = [ "../../src/tests" ] include_dirs = [ "." ]
if (is_android) { if (is_android) {
use_native_activity = true use_native_activity = true
...@@ -237,13 +238,11 @@ if (is_win || is_linux || is_mac || is_android) { ...@@ -237,13 +238,11 @@ if (is_win || is_linux || is_mac || is_android) {
if (is_win || is_linux || is_android || is_mac) { if (is_win || is_linux || is_android || is_mac) {
import("angle_perftests.gni") import("angle_perftests.gni")
test("angle_perftests") { # This test suite is for perf tests that use ANGLE's internals in some direct way.
include_dirs = [ test("angle_white_box_perftests") {
".", include_dirs = [ "." ]
"../..",
]
sources = angle_perf_tests_sources sources = angle_white_box_perf_tests_sources
deps = googletest_deps + [ deps = googletest_deps + [
angle_root + ":angle_util_static", angle_root + ":angle_util_static",
...@@ -259,11 +258,11 @@ if (is_win || is_linux || is_android || is_mac) { ...@@ -259,11 +258,11 @@ if (is_win || is_linux || is_android || is_mac) {
} }
if (is_win) { if (is_win) {
sources += angle_perf_tests_win_sources sources += angle_white_box_perf_tests_win_sources
} }
if (angle_enable_vulkan) { if (angle_enable_vulkan) {
sources += angle_perf_tests_vulkan_sources sources += angle_white_box_perf_tests_vulkan_sources
deps += [ "$angle_root/third_party/glslang:glslang" ] deps += [ "$angle_root/third_party/glslang:glslang" ]
public_configs = [ "$angle_root/third_party/glslang:glslang_config" ] public_configs = [ "$angle_root/third_party/glslang:glslang_config" ]
} }
...@@ -284,6 +283,44 @@ if (is_win || is_linux || is_android || is_mac) { ...@@ -284,6 +283,44 @@ if (is_win || is_linux || is_android || is_mac) {
configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ] configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
} }
} }
# This test suite is designed to run against a generic GL implementation.
test("angle_perftests") {
include_dirs = [
".",
"../..",
]
sources = angle_perf_tests_sources
deps = googletest_deps + [
angle_root + ":angle_util_static",
angle_root + ":libEGL",
angle_root + ":libGLESv2",
angle_root + "/third_party/jsoncpp:jsoncpp",
]
if (is_android) {
use_native_activity = true
configs -= [ "//build/config/android:hide_all_but_jni" ]
}
if (build_with_chromium) {
sources += [ "//gpu/angle_perftests_main.cc" ]
} else {
sources += [ "angle_perftests_main.cpp" ]
}
configs += [
angle_root + ":internal_config",
angle_root + ":libANGLE_config",
]
if (is_linux && !is_component_build) {
# Set rpath to find *.so files even in a non-component build.
configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
}
}
} }
###----------------------------------------------------- ###-----------------------------------------------------
......
...@@ -7,18 +7,14 @@ angle_perf_tests_sources = [ ...@@ -7,18 +7,14 @@ angle_perf_tests_sources = [
"perf_tests/ANGLEPerfTest.h", "perf_tests/ANGLEPerfTest.h",
"perf_tests/BlitFramebufferPerf.cpp", "perf_tests/BlitFramebufferPerf.cpp",
"perf_tests/BindingPerf.cpp", "perf_tests/BindingPerf.cpp",
"perf_tests/BitSetIteratorPerf.cpp",
"perf_tests/BufferSubData.cpp", "perf_tests/BufferSubData.cpp",
"perf_tests/CompilerPerf.cpp",
"perf_tests/DispatchComputePerf.cpp", "perf_tests/DispatchComputePerf.cpp",
"perf_tests/DrawCallPerf.cpp", "perf_tests/DrawCallPerf.cpp",
"perf_tests/DrawCallPerfParams.cpp", "perf_tests/DrawCallPerfParams.cpp",
"perf_tests/DrawCallPerfParams.h", "perf_tests/DrawCallPerfParams.h",
"perf_tests/DrawElementsPerf.cpp", "perf_tests/DrawElementsPerf.cpp",
"perf_tests/DynamicPromotionPerfTest.cpp", "perf_tests/DynamicPromotionPerfTest.cpp",
"perf_tests/EGLInitializePerf.cpp",
"perf_tests/EGLMakeCurrentPerf.cpp", "perf_tests/EGLMakeCurrentPerf.cpp",
"perf_tests/ResultPerf.cpp",
"perf_tests/IndexConversionPerf.cpp", "perf_tests/IndexConversionPerf.cpp",
"perf_tests/InstancingPerf.cpp", "perf_tests/InstancingPerf.cpp",
"perf_tests/InterleavedAttributeData.cpp", "perf_tests/InterleavedAttributeData.cpp",
...@@ -39,9 +35,25 @@ angle_perf_tests_sources = [ ...@@ -39,9 +35,25 @@ angle_perf_tests_sources = [
"test_utils/draw_call_perf_utils.h", "test_utils/draw_call_perf_utils.h",
] ]
angle_perf_tests_win_sources = [ "perf_tests/IndexDataManagerTest.cpp" ] angle_white_box_perf_tests_sources = [
"perf_tests/ANGLEPerfTest.cpp",
"perf_tests/ANGLEPerfTest.h",
"perf_tests/BitSetIteratorPerf.cpp",
"perf_tests/CompilerPerf.cpp",
"perf_tests/EGLInitializePerf.cpp", # Uses ANGLEGetDisplayPlatform, a non-standard EP.
"perf_tests/ResultPerf.cpp",
"perf_tests/third_party/perf/perf_test.cc",
"perf_tests/third_party/perf/perf_test.h",
"test_utils/angle_test_configs.cpp",
"test_utils/angle_test_configs.h",
"test_utils/angle_test_instantiate.cpp",
"test_utils/angle_test_instantiate.h",
]
angle_white_box_perf_tests_win_sources =
[ "perf_tests/IndexDataManagerTest.cpp" ]
angle_perf_tests_vulkan_sources = [ angle_white_box_perf_tests_vulkan_sources = [
"perf_tests/VulkanCommandBufferPerf.cpp", "perf_tests/VulkanCommandBufferPerf.cpp",
"perf_tests/VulkanPipelineCachePerf.cpp", "perf_tests/VulkanPipelineCachePerf.cpp",
"test_utils/third_party/vulkan_command_buffer_utils.cpp", "test_utils/third_party/vulkan_command_buffer_utils.cpp",
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include "ANGLEPerfTest.h" #include "ANGLEPerfTest.h"
#include "DrawCallPerfParams.h" #include "DrawCallPerfParams.h"
#include "common/utilities.h"
#include "test_utils/draw_call_perf_utils.h" #include "test_utils/draw_call_perf_utils.h"
namespace namespace
...@@ -96,6 +95,21 @@ DrawElementsPerfBenchmark::DrawElementsPerfBenchmark() ...@@ -96,6 +95,21 @@ DrawElementsPerfBenchmark::DrawElementsPerfBenchmark()
} }
} }
GLsizei ElementTypeSize(GLenum elementType)
{
switch (elementType)
{
case GL_UNSIGNED_BYTE:
return sizeof(GLubyte);
case GL_UNSIGNED_SHORT:
return sizeof(GLushort);
case GL_UNSIGNED_INT:
return sizeof(GLuint);
default:
return 0;
}
}
void DrawElementsPerfBenchmark::initializeBenchmark() void DrawElementsPerfBenchmark::initializeBenchmark()
{ {
const auto &params = GetParam(); const auto &params = GetParam();
...@@ -117,7 +131,7 @@ void DrawElementsPerfBenchmark::initializeBenchmark() ...@@ -117,7 +131,7 @@ void DrawElementsPerfBenchmark::initializeBenchmark()
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, mIndexBuffer); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, mIndexBuffer);
mBufferSize = gl::ElementTypeSize(params.type) * mCount; mBufferSize = ElementTypeSize(params.type) * mCount;
if (params.type == GL_UNSIGNED_INT) if (params.type == GL_UNSIGNED_INT)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment