Commit edbc2449 by Jamie Madill

Add dEQP GN integration.

This is Windows-only for now, but will be expanded to Linux. Also do a bit of refactoring in our deqp.gypi file. BUG=angleproject:1272 Change-Id: I526a99fe3b91a2d9e8901c7e033a4916a06780be Reviewed-on: https://chromium-review.googlesource.com/320800Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 82b5ab60
......@@ -15,24 +15,20 @@ angle_git_is_present = exec_script("src/commit_id.py",
angle_use_commit_id = angle_git_is_present == 1
gles_gypi = exec_script(
"//build/gypi_to_gn.py",
[ rebase_path("src/libGLESv2.gypi") ],
"scope",
[ "src/libGLESv2.gypi" ])
compiler_gypi = exec_script(
"//build/gypi_to_gn.py",
[ rebase_path("src/compiler.gypi") ],
"scope",
[ "src/compiler.gypi" ])
gles_gypi = exec_script("//build/gypi_to_gn.py",
[ rebase_path("src/libGLESv2.gypi") ],
"scope",
[ "src/libGLESv2.gypi" ])
compiler_gypi = exec_script("//build/gypi_to_gn.py",
[ rebase_path("src/compiler.gypi") ],
"scope",
[ "src/compiler.gypi" ])
# This config is exported to dependent targets (and also applied to internal
# ones).
config("external_config") {
include_dirs = [
"include",
]
include_dirs = [ "include" ]
}
# This config is applied to internal Angle targets (not pushed to dependents).
......@@ -45,8 +41,12 @@ config("internal_config") {
if (is_win) {
copy("copy_compiler_dll") {
sources = [ "$windows_sdk_path/Redist/D3D/$target_cpu/d3dcompiler_47.dll" ]
outputs = [ "$root_out_dir/d3dcompiler_47.dll" ]
sources = [
"$windows_sdk_path/Redist/D3D/$target_cpu/d3dcompiler_47.dll",
]
outputs = [
"$root_out_dir/d3dcompiler_47.dll",
]
}
}
......@@ -59,17 +59,20 @@ component("translator") {
defines = [ "ANGLE_TRANSLATOR_IMPLEMENTATION" ]
if (angle_enable_essl) {
sources += rebase_path(compiler_gypi.angle_translator_lib_essl_sources, ".", "src")
sources +=
rebase_path(compiler_gypi.angle_translator_lib_essl_sources, ".", "src")
defines += [ "ANGLE_ENABLE_ESSL" ]
}
if (angle_enable_glsl) {
sources += rebase_path(compiler_gypi.angle_translator_lib_glsl_sources, ".", "src")
sources +=
rebase_path(compiler_gypi.angle_translator_lib_glsl_sources, ".", "src")
defines += [ "ANGLE_ENABLE_GLSL" ]
}
if (angle_enable_hlsl) {
sources += rebase_path(compiler_gypi.angle_translator_lib_hlsl_sources, ".", "src")
sources +=
rebase_path(compiler_gypi.angle_translator_lib_hlsl_sources, ".", "src")
defines += [ "ANGLE_ENABLE_HLSL" ]
}
......@@ -94,9 +97,9 @@ source_set("includes") {
"include/GLES2/gl2ext.h",
"include/GLES2/gl2platform.h",
"include/GLES3/gl3.h",
"include/GLES3/gl3platform.h",
"include/GLES3/gl31.h",
"include/GLES3/gl32.h",
"include/GLES3/gl3platform.h",
"include/GLSLANG/ShaderLang.h",
"include/KHR/khrplatform.h",
]
......@@ -116,12 +119,9 @@ config("translator_static_config") {
defines = [ "ANGLE_TRANSLATOR_STATIC" ]
}
config("debug_annotations_config") {
if (is_debug) {
defines = [
"ANGLE_ENABLE_DEBUG_ANNOTATIONS",
]
defines = [ "ANGLE_ENABLE_DEBUG_ANNOTATIONS" ]
}
}
......@@ -141,17 +141,20 @@ static_library("translator_lib") {
defines = []
if (angle_enable_essl) {
sources += rebase_path(compiler_gypi.angle_translator_lib_essl_sources, ".", "src")
sources +=
rebase_path(compiler_gypi.angle_translator_lib_essl_sources, ".", "src")
defines += [ "ANGLE_ENABLE_ESSL" ]
}
if (angle_enable_glsl) {
sources += rebase_path(compiler_gypi.angle_translator_lib_glsl_sources, ".", "src")
sources +=
rebase_path(compiler_gypi.angle_translator_lib_glsl_sources, ".", "src")
defines += [ "ANGLE_ENABLE_GLSL" ]
}
if (angle_enable_hlsl) {
sources += rebase_path(compiler_gypi.angle_translator_lib_hlsl_sources, ".", "src")
sources +=
rebase_path(compiler_gypi.angle_translator_lib_hlsl_sources, ".", "src")
defines += [ "ANGLE_ENABLE_HLSL" ]
}
configs -= [ "//build/config/compiler:chromium_code" ]
......@@ -267,18 +270,13 @@ static_library("libANGLE") {
include_dirs = []
libs = []
defines = [
"LIBANGLE_IMPLEMENTATION",
]
defines = [ "LIBANGLE_IMPLEMENTATION" ]
# Shared D3D sources.
if (angle_enable_d3d9 || angle_enable_d3d11) {
sources += rebase_path(gles_gypi.libangle_d3d_shared_sources, ".", "src")
defines += [
"ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ " +
"\"d3dcompiler_47.dll\", \"d3dcompiler_46.dll\", \"d3dcompiler_43.dll\" }",
]
defines += [ "ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ " + "\"d3dcompiler_47.dll\", \"d3dcompiler_46.dll\", \"d3dcompiler_43.dll\" }" ]
}
if (angle_enable_d3d9) {
......@@ -306,9 +304,7 @@ static_library("libANGLE") {
}
if (is_debug) {
defines += [
"ANGLE_GENERATE_SHADER_DEBUG_INFO",
]
defines += [ "ANGLE_GENERATE_SHADER_DEBUG_INFO" ]
}
configs -= [ "//build/config/compiler:chromium_code" ]
......@@ -321,10 +317,10 @@ static_library("libANGLE") {
]
deps = [
":angle_common",
":commit_id",
":includes",
":translator_static",
":angle_common",
]
if (is_win) {
......@@ -336,8 +332,8 @@ shared_library("libGLESv2") {
sources = rebase_path(gles_gypi.libglesv2_sources, ".", "src")
if (is_win) {
ldflags = [ "/DEF:" +
rebase_path("src/libGLESv2/libGLESv2.def", root_build_dir) ]
ldflags =
[ "/DEF:" + rebase_path("src/libGLESv2/libGLESv2.def", root_build_dir) ]
}
configs -= [ "//build/config/compiler:chromium_code" ]
......@@ -349,9 +345,7 @@ shared_library("libGLESv2") {
"//build/config/compiler:no_chromium_code",
]
defines = [
"LIBGLESV2_IMPLEMENTATION",
]
defines = [ "LIBGLESV2_IMPLEMENTATION" ]
deps = [
":includes",
......@@ -363,8 +357,7 @@ shared_library("libEGL") {
sources = rebase_path(gles_gypi.libegl_sources, ".", "src")
if (is_win) {
ldflags = [ "/DEF:" +
rebase_path("src/libEGL/libEGL.def", root_build_dir) ]
ldflags = [ "/DEF:" + rebase_path("src/libEGL/libEGL.def", root_build_dir) ]
}
configs -= [ "//build/config/compiler:chromium_code" ]
......@@ -376,9 +369,7 @@ shared_library("libEGL") {
"//build/config/compiler:no_chromium_code",
]
defines = [
"LIBEGL_IMPLEMENTATION",
]
defines = [ "LIBEGL_IMPLEMENTATION" ]
deps = [
":includes",
......@@ -386,11 +377,14 @@ shared_library("libEGL") {
]
}
util_gypi = exec_script(
"//build/gypi_to_gn.py",
[ rebase_path("util/util.gyp") ],
"scope",
[ "util/util.gyp" ])
util_gypi = exec_script("//build/gypi_to_gn.py",
[ rebase_path("util/util.gyp") ],
"scope",
[ "util/util.gyp" ])
config("angle_util_config") {
include_dirs = [ "util" ]
}
static_library("angle_util") {
sources = rebase_path(util_gypi.util_sources, ".", "util")
......@@ -417,13 +411,11 @@ static_library("angle_util") {
"EGL_EGLEXT_PROTOTYPES",
]
configs += [
":internal_config",
":debug_annotations_config",
]
configs += [ ":debug_annotations_config" ]
include_dirs = [
"util",
public_configs = [
":angle_util_config",
":internal_config",
]
deps = [
......
......@@ -2,7 +2,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//testing/test.gni")
import("//third_party/angle/build/angle_common.gni")
......@@ -56,11 +55,13 @@ if (is_win || is_linux || is_mac) {
"../../util",
]
sources = rebase_path(end2end_gypi.angle_end2end_tests_sources, ".", "../..")
sources =
rebase_path(end2end_gypi.angle_end2end_tests_sources, ".", "../..")
if (is_win) {
sources +=
rebase_path(end2end_gypi.angle_end2end_tests_win_sources, ".", "../..")
sources += rebase_path(end2end_gypi.angle_end2end_tests_win_sources,
".",
"../..")
}
sources += [ "//gpu/angle_end2end_tests_main.cc" ]
......@@ -109,7 +110,7 @@ if (is_win) {
sources = rebase_path(perftests_gypi.angle_perf_tests_sources, ".", "../..")
sources +=
rebase_path(perftests_gypi.angle_perf_tests_win_sources, ".", "../..")
rebase_path(perftests_gypi.angle_perf_tests_win_sources, ".", "../..")
sources += [ "//gpu/angle_perftests_main.cc" ]
......@@ -130,3 +131,143 @@ if (is_win) {
]
}
}
###-----------------------------------------------------
### dEQP tests
###-----------------------------------------------------
# TODO(jmadill): Linux build
if (is_win) {
deqp_gypi = exec_script("//build/gypi_to_gn.py",
[
rebase_path("deqp.gypi"),
"--replace=<(angle_path)=.",
"--replace=<(deqp_path)=../deqp/src",
],
"scope",
[ "deqp.gypi" ])
config("angle_deqp_support") {
include_dirs = rebase_path(deqp_gypi.deqp_include_dirs, ".", "../..")
if (is_win) {
include_dirs += [ "../deqp/src/framework/platform/win32" ]
cflags = deqp_gypi.deqp_win_cflags
}
defines = deqp_gypi.deqp_defines
defines += [ "_MBCS" ]
}
deqp_undefine_configs = [
"//build/config/compiler:chromium_code",
"//build/config/win:lean_and_mean",
"//build/config/win:nominmax",
"//build/config/win:unicode",
"//build/config/compiler:no_rtti",
]
static_library("angle_deqp_decpp") {
configs -= deqp_undefine_configs
public_configs = [
":angle_deqp_support",
"//build/config/compiler:no_chromium_code",
"//third_party/angle:internal_config",
]
sources = rebase_path(deqp_gypi.deqp_libtester_decpp_sources, ".", "../..")
}
config("angle_deqp_libtester_config") {
defines = [ "ANGLE_DEQP_LIBTESTER_IMPLEMENTATION" ]
}
static_library("angle_deqp_libtester") {
public_deps = [
":angle_deqp_decpp",
"//third_party/angle:angle_util",
"//third_party/angle:libEGL",
"//third_party/libpng:libpng",
]
configs -= deqp_undefine_configs
public_configs = [ ":angle_deqp_libtester_config" ]
sources = rebase_path(deqp_gypi.deqp_libtester_sources, ".", "../..")
if (is_win) {
sources += rebase_path(deqp_gypi.deqp_libtester_sources_win, ".", "../..")
}
}
config("angle_deqp_gtest_support_config") {
include_dirs = [ "third_party/gpu_test_expectations" ]
}
source_set("angle_deqp_gtest_support") {
testonly = true
public_deps = [
"//base",
"//base/test:test_support",
"//testing/gtest",
"//third_party/angle:angle_common",
"//third_party/angle:angle_util",
]
public_configs = [ ":angle_deqp_gtest_support_config" ]
sources = deqp_gypi.deqp_gpu_test_expectations_sources
sources += [ "//gpu/angle_deqp_tests_main.cc" ]
}
target_names = [
"gles2",
"gles3",
"egl",
]
target_defines = [
"ANGLE_DEQP_GLES2_TESTS",
"ANGLE_DEQP_GLES3_TESTS",
"ANGLE_DEQP_EGL_TESTS",
]
target_sources = [
deqp_gypi.deqp_gles2_sources,
deqp_gypi.deqp_gles3_sources,
deqp_gypi.deqp_egl_sources,
]
foreach(index,
[
0,
1,
2,
]) {
target_name = target_names[index]
config_name = "angle_deqp_lib${target_name}_config"
config(config_name) {
defines = [ target_defines[index] ]
}
shared_library_name = "angle_deqp_lib${target_name}"
shared_library(shared_library_name) {
deps = [
":angle_deqp_libtester",
]
configs -= deqp_undefine_configs
public_configs = [ ":${config_name}" ]
sources = rebase_path(target_sources[index], ".", "../..")
sources += [
"deqp_support/angle_deqp_libtester_main.cpp",
"deqp_support/tcuANGLEPlatform.cpp",
"deqp_support/tcuANGLEPlatform.h",
]
}
test_name = "angle_deqp_${target_name}_tests"
test(test_name) {
deps = [
":${shared_library_name}",
":angle_deqp_gtest_support",
]
# Must be included outside of the source set for the define
sources = [
"deqp_support/angle_deqp_gtest.cpp",
]
}
}
}
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