Vulkan: Enable validation layers on request.

Also adds the build files for the Vulkan layers.

The layers are enabled by default for the tests.

BUG=angleproject:1319

Change-Id: I0b442b36312a1299a932922e1c4e39f00801de49
Reviewed-on: https://chromium-review.googlesource.com/367751
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
This commit is contained in:
Jamie Madill 2016-12-23 13:41:47 -05:00 коммит произвёл Commit Bot
Родитель b5693ff6cb
Коммит 0448ec847d
20 изменённых файлов: 1450 добавлений и 49 удалений

63
.gitignore поставляемый
Просмотреть файл

@ -1,27 +1,26 @@
Debug/
Debug_Win32/
Debug_x64/
Debug_ARM/
Release/
Release_Win32/
Release_x64/
Release_ARM/
*.sdf
*.Makefile
*.ncb
*.suo
*.nvuser
*.opensdf
*.orig
*.psess
*.pyc
*.rej
*.sdf
*.sln
*.suo
*.target.mk
*.TMP
*.VC.db
*.VC.opendb
*.vcxproj
*.vcxproj.filters
*.vcxproj.user
*.VC.opendb
patches-*
*.target.mk
ipch
debug.txt
*.opensdf
*.orig
*.rej
*.vsp
*~
.gclient
.gclient_entries
/src/tests/third_party/gles_conformance_tests
/testing/gmock
/testing/gtest
/third_party/cherry
@ -33,19 +32,21 @@ debug.txt
/third_party/spirv-tools-angle/src
/third_party/vulkan-validation-layers/src
/third_party/zlib
/src/tests/third_party/gles_conformance_tests
out
angle_internal
buildtools/
debug.txt
Debug/
Debug_ARM/
Debug_Win32/
Debug_x64/
diag.txt
ipch
lib/*
Makefile
*.Makefile
*~
.gclient
angle_internal
out
patches-*
Release/
Release_ARM/
Release_Win32/
Release_x64/
TestResults.qpa
*.psess
*.vsp
*.nvuser
buildtools/
*.pyc
*.TMP
*.VC.db

Просмотреть файл

@ -63,7 +63,7 @@ Additions to the EGL Specification
New Behavior
To request a display that is backed by a Vulken driver, the value of
To request a display that is backed by a Vulkan driver, the value of
EGL_PLATFORM_ANGLE_TYPE_ANGLE should be
EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE.

Просмотреть файл

@ -0,0 +1,28 @@
#!/usr/bin/python
#
# Copyright 2016 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.
#
# generate_vulkan_header.py:
# Workaround problems with Windows and GYP and the Vulkan loader paths.
import os, sys
if len(sys.argv) < 4:
print("Usage: " + sys.argv[0] + " <layers_source_path> <output_file> <default_vk_layers_path>")
sys.exit(1)
layers_source_path = sys.argv[1]
output_file = sys.argv[2]
default_vk_layers_path = sys.argv[3].rstrip("\"")
def fixpath(inpath):
return os.path.relpath(inpath).replace('\\', '/')
def all_paths(inpath):
return fixpath(inpath) + ";" + fixpath(os.path.join("..", fixpath(inpath)))
with open(output_file, "w") as outfile:
outfile.write("#define LAYERS_SOURCE_PATH \"" + all_paths(layers_source_path) + "\"\n")
outfile.write("#define DEFAULT_VK_LAYERS_PATH \"" + all_paths(default_vk_layers_path) + "\"\n")

Просмотреть файл

@ -0,0 +1,37 @@
#!/usr/bin/python
#
# Copyright 2016 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.
#
# generate_vulkan_layers_json.py:
# Generate copies of the Vulkan layers JSON files, with no paths, forcing
# Vulkan to use the default search path to look for layers.
import os, sys, json, glob
if len(sys.argv) < 3:
print("Usage: " + sys.argv[0] + " <source_dir> <target_dir>")
sys.exit(1)
source_dir = sys.argv[1]
target_dir = sys.argv[2]
if not os.path.isdir(source_dir):
print(source_dir + " is not a directory.")
sys.exit(1)
if not os.path.exists(target_dir):
os.makedirs(target_dir)
for json_fname in glob.glob(os.path.join(source_dir, "*.json")):
with open(json_fname) as infile:
data = json.load(infile)
# update the path
prev_name = os.path.basename(data['layer']['library_path'])
data['layer']['library_path'] = prev_name
target_fname = os.path.join(target_dir, os.path.basename(json_fname))
with open(target_fname, "w") as outfile:
json.dump(data, outfile)

Просмотреть файл

@ -61,10 +61,8 @@
#include "libANGLE/renderer/vulkan/DisplayVk.h"
#endif // defined(ANGLE_ENABLE_VULKAN)
namespace egl
{
namespace
// The log messages prepend the class name, so make this part of the angle namespace.
namespace angle
{
class DefaultPlatform : public angle::Platform
@ -72,20 +70,49 @@ class DefaultPlatform : public angle::Platform
public:
DefaultPlatform() {}
~DefaultPlatform() override {}
void logError(const char *errorMessage) override;
void logWarning(const char *warningMessage) override;
void logInfo(const char *infoMessage) override;
};
DefaultPlatform *defaultPlatform = nullptr;
std::unique_ptr<DefaultPlatform> g_defaultPlatform = nullptr;
void DefaultPlatform::logError(const char *errorMessage)
{
ERR("%s", errorMessage);
}
void DefaultPlatform::logWarning(const char *warningMessage)
{
// TODO(jmadill): Fix this
ERR("%s", warningMessage);
}
void DefaultPlatform::logInfo(const char *infoMessage)
{
// Uncomment this if you want Vulkan spam.
// ERR("%s", infoMessage);
}
} // namespace angle
namespace egl
{
namespace
{
void InitDefaultPlatformImpl()
{
if (ANGLEPlatformCurrent() == nullptr)
{
if (defaultPlatform == nullptr)
if (!angle::g_defaultPlatform)
{
defaultPlatform = new DefaultPlatform();
angle::g_defaultPlatform.reset(new angle::DefaultPlatform());
}
ANGLEPlatformInitialize(defaultPlatform);
ANGLEPlatformInitialize(angle::g_defaultPlatform.get());
}
}

Просмотреть файл

@ -45,19 +45,72 @@ VkResult VerifyExtensionsPresent(const std::vector<VkExtensionProperties> &exten
return VK_SUCCESS;
}
VkBool32 VKAPI_CALL DebugReportCallback(VkDebugReportFlagsEXT flags,
VkDebugReportObjectTypeEXT objectType,
uint64_t object,
size_t location,
int32_t messageCode,
const char *layerPrefix,
const char *message,
void *userData)
{
if ((flags & VK_DEBUG_REPORT_ERROR_BIT_EXT) != 0)
{
ANGLEPlatformCurrent()->logError(message);
#if !defined(NDEBUG)
// Abort the call in Debug builds.
return VK_TRUE;
#endif
}
else if ((flags & VK_DEBUG_REPORT_WARNING_BIT_EXT) != 0)
{
ANGLEPlatformCurrent()->logWarning(message);
}
else
{
ANGLEPlatformCurrent()->logInfo(message);
}
return VK_FALSE;
}
} // anonymous namespace
RendererVk::RendererVk() : mCapsInitialized(false), mInstance(VK_NULL_HANDLE)
RendererVk::RendererVk()
: mCapsInitialized(false),
mInstance(VK_NULL_HANDLE),
mEnableValidationLayers(false),
mDebugReportCallback(VK_NULL_HANDLE)
{
}
RendererVk::~RendererVk()
{
if (mDebugReportCallback)
{
ASSERT(mInstance);
auto destroyDebugReportCallback = reinterpret_cast<PFN_vkDestroyDebugReportCallbackEXT>(
vkGetInstanceProcAddr(mInstance, "vkDestroyDebugReportCallbackEXT"));
ASSERT(destroyDebugReportCallback);
destroyDebugReportCallback(mInstance, mDebugReportCallback, nullptr);
}
vkDestroyInstance(mInstance, nullptr);
}
vk::Error RendererVk::initialize(const egl::AttributeMap &attribs)
{
// Gather global layer properties.
uint32_t instanceLayerCount = 0;
ANGLE_VK_TRY(vkEnumerateInstanceLayerProperties(&instanceLayerCount, nullptr));
std::vector<VkLayerProperties> instanceLayerProps(instanceLayerCount);
if (instanceLayerCount > 0)
{
ANGLE_VK_TRY(
vkEnumerateInstanceLayerProperties(&instanceLayerCount, instanceLayerProps.data()));
}
uint32_t instanceExtensionCount = 0;
ANGLE_VK_TRY(vkEnumerateInstanceExtensionProperties(nullptr, &instanceExtensionCount, nullptr));
@ -68,6 +121,37 @@ vk::Error RendererVk::initialize(const egl::AttributeMap &attribs)
instanceExtensionProps.data()));
}
#if !defined(NDEBUG)
// Validation layers enabled by default in Debug.
mEnableValidationLayers = true;
#endif
// If specified in the attributes, override the default.
if (attribs.contains(EGL_PLATFORM_ANGLE_ENABLE_VALIDATION_LAYER_ANGLE))
{
mEnableValidationLayers =
(attribs.get(EGL_PLATFORM_ANGLE_ENABLE_VALIDATION_LAYER_ANGLE, EGL_FALSE) == EGL_TRUE);
}
if (mEnableValidationLayers)
{
// Verify the standard validation layers are available.
if (!HasStandardValidationLayer(instanceLayerProps))
{
// Generate an error if the attribute was requested, warning otherwise.
if (attribs.contains(EGL_PLATFORM_ANGLE_ENABLE_VALIDATION_LAYER_ANGLE))
{
ANGLEPlatformCurrent()->logError("Vulkan standard validation layers are missing.");
}
else
{
ANGLEPlatformCurrent()->logWarning(
"Vulkan standard validation layers are missing.");
}
mEnableValidationLayers = false;
}
}
std::vector<const char *> enabledInstanceExtensions;
enabledInstanceExtensions.push_back(VK_KHR_SURFACE_EXTENSION_NAME);
#if defined(ANGLE_PLATFORM_WINDOWS)
@ -76,6 +160,12 @@ vk::Error RendererVk::initialize(const egl::AttributeMap &attribs)
#error Unsupported Vulkan platform.
#endif // defined(ANGLE_PLATFORM_WINDOWS)
// TODO(jmadill): Should be able to continue initialization if debug report ext missing.
if (mEnableValidationLayers)
{
enabledInstanceExtensions.push_back(VK_EXT_DEBUG_REPORT_EXTENSION_NAME);
}
// Verify the required extensions are in the extension names set. Fail if not.
ANGLE_VK_TRY(VerifyExtensionsPresent(instanceExtensionProps, enabledInstanceExtensions));
@ -98,11 +188,31 @@ vk::Error RendererVk::initialize(const egl::AttributeMap &attribs)
instanceInfo.enabledExtensionCount = static_cast<uint32_t>(enabledInstanceExtensions.size());
instanceInfo.ppEnabledExtensionNames =
enabledInstanceExtensions.empty() ? nullptr : enabledInstanceExtensions.data();
instanceInfo.enabledLayerCount = 0u;
instanceInfo.ppEnabledLayerNames = nullptr;
instanceInfo.enabledLayerCount = mEnableValidationLayers ? 1u : 0u;
instanceInfo.ppEnabledLayerNames =
mEnableValidationLayers ? &g_VkStdValidationLayerName : nullptr;
ANGLE_VK_TRY(vkCreateInstance(&instanceInfo, nullptr, &mInstance));
if (mEnableValidationLayers)
{
VkDebugReportCallbackCreateInfoEXT debugReportInfo;
debugReportInfo.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT;
debugReportInfo.pNext = nullptr;
debugReportInfo.flags = VK_DEBUG_REPORT_ERROR_BIT_EXT | VK_DEBUG_REPORT_WARNING_BIT_EXT |
VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT |
VK_DEBUG_REPORT_INFORMATION_BIT_EXT | VK_DEBUG_REPORT_DEBUG_BIT_EXT;
debugReportInfo.pfnCallback = &DebugReportCallback;
debugReportInfo.pUserData = this;
auto createDebugReportCallback = reinterpret_cast<PFN_vkCreateDebugReportCallbackEXT>(
vkGetInstanceProcAddr(mInstance, "vkCreateDebugReportCallbackEXT"));
ASSERT(createDebugReportCallback);
ANGLE_VK_TRY(
createDebugReportCallback(mInstance, &debugReportInfo, nullptr, &mDebugReportCallback));
}
return vk::NoError();
}

Просмотреть файл

@ -55,6 +55,8 @@ class RendererVk : angle::NonCopyable
mutable gl::Limitations mNativeLimitations;
VkInstance mInstance;
bool mEnableValidationLayers;
VkDebugReportCallbackEXT mDebugReportCallback;
};
} // namespace rx

Просмотреть файл

@ -48,6 +48,10 @@ EGLint DefaultEGLErrorCode(VkResult result)
}
} // anonymous namespace
// Mirrors std_validation_str in loader.h
// TODO(jmadill): Possibly wrap the loader into a safe source file. Can't be included trivially.
const char *g_VkStdValidationLayerName = "VK_LAYER_LUNARG_standard_validation";
const char *VulkanResultString(VkResult result)
{
switch (result)
@ -173,4 +177,17 @@ bool Error::isError() const
} // namespace vk
bool HasStandardValidationLayer(const std::vector<VkLayerProperties> &layerProps)
{
for (const auto &layerProp : layerProps)
{
if (std::string(layerProp.layerName) == g_VkStdValidationLayerName)
{
return true;
}
}
return false;
}
} // namespace rx

Просмотреть файл

@ -18,6 +18,9 @@ namespace rx
{
const char *VulkanResultString(VkResult result);
bool HasStandardValidationLayer(const std::vector<VkLayerProperties> &layerProps);
extern const char *g_VkStdValidationLayerName;
namespace vk
{

Просмотреть файл

@ -86,6 +86,7 @@
'<(angle_path)/src/tests/egl_tests/EGLRobustnessTest.cpp',
'<(angle_path)/src/tests/egl_tests/EGLSanityCheckTest.cpp',
'<(angle_path)/src/tests/egl_tests/EGLSurfaceTest.cpp',
'<(angle_path)/src/tests/egl_tests/EGLVulkanEXTTest.cpp',
'<(angle_path)/src/tests/test_utils/ANGLETest.cpp',
'<(angle_path)/src/tests/test_utils/ANGLETest.h',
'<(angle_path)/src/tests/test_utils/angle_test_configs.cpp',

Просмотреть файл

@ -0,0 +1,35 @@
//
// Copyright 2016 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.
//
// VulkanEXTTest:
// Tests specific to the ANGLE Vulkan extension.
//
#include "test_utils/ANGLETest.h"
using namespace angle;
namespace
{
class VulkanEXTTest : public ANGLETest
{
public:
VulkanEXTTest() {}
// Intentionally do not call base class so we can run EGL in the tests.
void SetUp() override {}
};
// ANGLE requires that the vulkan validation layers are available.
TEST_P(VulkanEXTTest, ValidationLayersAvaialable)
{
setVulkanLayersEnabled(true);
ASSERT_TRUE(getEGLWindow()->initializeGL(GetOSWindow()));
}
ANGLE_INSTANTIATE_TEST(VulkanEXTTest, ES2_VULKAN(), ES3_VULKAN());
} // anonymous namespace

Просмотреть файл

@ -205,6 +205,12 @@ ANGLETest::ANGLETest()
{
mEGLWindow =
new EGLWindow(GetParam().majorVersion, GetParam().minorVersion, GetParam().eglParameters);
// Default vulkan layers to enabled.
if (GetParam().getRenderer() == EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE)
{
mEGLWindow->setVulkanLayersEnabled(true);
}
}
ANGLETest::~ANGLETest()
@ -644,6 +650,11 @@ void ANGLETest::setBindGeneratesResource(bool bindGeneratesResource)
mEGLWindow->setBindGeneratesResource(bindGeneratesResource);
}
void ANGLETest::setVulkanLayersEnabled(bool enabled)
{
mEGLWindow->setVulkanLayersEnabled(enabled);
}
int ANGLETest::getClientMajorVersion() const
{
return mEGLWindow->getClientMajorVersion();

Просмотреть файл

@ -196,6 +196,7 @@ class ANGLETest : public ::testing::TestWithParam<angle::PlatformParameters>
void setNoErrorEnabled(bool enabled);
void setWebGLCompatibilityEnabled(bool webglCompatibility);
void setBindGeneratesResource(bool bindGeneratesResource);
void setVulkanLayersEnabled(bool enabled);
int getClientMajorVersion() const;
int getClientMinorVersion() const;
@ -209,6 +210,8 @@ class ANGLETest : public ::testing::TestWithParam<angle::PlatformParameters>
void ignoreD3D11SDKLayersWarnings();
static OSWindow *GetOSWindow() { return mOSWindow; }
private:
bool createEGLContext();
bool destroyEGLContext();

Просмотреть файл

@ -2,16 +2,30 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
vulkan_layers_dir = "../../../../vulkan-validation-layers/src/"
# TODO(jmadill): Redo the file entirely when we have standalone GN ANGLE.
third_party_dir = "../../../../third_party"
glslang_dir = "$third_party_dir/glslang-angle/src"
spirv_headers_dir = "$third_party_dir/spirv-headers/src"
spirv_tools_dir = "$third_party_dir/spirv-tools-angle/src"
vulkan_layers_dir = "$third_party_dir/vulkan-validation-layers/src"
raw_vulkan_layers_dir = rebase_path(vulkan_layers_dir)
vulkan_gypi =
exec_script("//build/gypi_to_gn.py",
[
rebase_path("vulkan.gypi"),
"--replace=<(vulkan_layers_path)=$vulkan_layers_dir",
"--replace=<(angle_gen_path)=$target_gen_dir/angle",
"--replace=<(spirv_headers_path)=../$spirv_headers_dir",
"--replace=<(spirv_tools_path)=../$spirv_tools_dir",
"--replace=<(vulkan_layers_path)=../$vulkan_layers_dir",
],
"scope",
[ "vulkan.gypi" ])
# Vulkan loader
# -------------
config("vulkan_loader_config") {
include_dirs = rebase_path(vulkan_gypi.vulkan_loader_include_dirs, ".", "src")
defines = [
@ -30,6 +44,14 @@ config("vulkan_loader_internal_config") {
}
}
vulkan_undefine_configs = []
if (is_win) {
vulkan_undefine_configs += [
"//build/config/win:nominmax",
"//build/config/win:unicode",
]
}
static_library("vulkan_loader") {
sources = rebase_path(vulkan_gypi.vulkan_loader_sources, ".", "src")
if (is_win) {
@ -37,13 +59,317 @@ static_library("vulkan_loader") {
if (!is_clang) {
cflags = vulkan_gypi.vulkan_loader_cflags_win
}
configs -= [
"//build/config/win:nominmax",
"//build/config/win:unicode",
]
}
configs += [ ":vulkan_loader_internal_config" ]
public_configs = [ ":vulkan_loader_config" ]
configs -= vulkan_undefine_configs
}
# Vulkan layer helpers
# --------------------
vulkan_gen_dir = "$target_gen_dir/angle/vulkan"
raw_vulkan_gen_dir = rebase_path(vulkan_gen_dir)
source_set("vulkan_layer_utils") {
sources = rebase_path(vulkan_gypi.vulkan_layer_utils_sources, ".", "src")
public_configs = [
":vulkan_loader_config",
":vulkan_loader_internal_config",
]
configs -= vulkan_undefine_configs
}
action("vulkan_gen_dispatch_table_helper") {
script = "$vulkan_layers_dir/scripts/lvl_genvk.py"
inputs = [
"$vulkan_layers_dir/scripts/dispatch_table_generator.py",
"$vulkan_layers_dir/scripts/generator.py",
"$vulkan_layers_dir/scripts/reg.py",
"$vulkan_layers_dir/scripts/vk.xml",
"$vulkan_layers_dir/scripts/vulkan.py",
]
outputs = [
"$vulkan_gen_dir/vk_dispatch_table_helper.h",
]
args = [
"-o",
raw_vulkan_gen_dir,
"-registry",
"$raw_vulkan_layers_dir/scripts/vk.xml",
"vk_dispatch_table_helper.h",
"-quiet",
]
}
action("vulkan_gen_struct_wrappers") {
script = "$vulkan_layers_dir/scripts/vk_helper.py"
inputs = [
"$vulkan_layers_dir/include/vulkan/vulkan.h",
]
outputs = vulkan_gypi.vulkan_struct_wrappers_outputs
args = [
"--gen_struct_wrappers",
rebase_path(vulkan_layers_dir) + "/include/vulkan/vulkan.h",
"--abs_out_dir",
raw_vulkan_gen_dir,
"--quiet",
]
}
action("vulkan_gen_enum_string_helper") {
script = "$vulkan_layers_dir/scripts/vk_helper.py"
inputs = [
"$vulkan_layers_dir/include/vulkan/vulkan.h",
]
outputs = [
"$vulkan_gen_dir/vk_enum_string_helper.h",
]
args = [
"--gen_enum_string_helper",
rebase_path(vulkan_layers_dir) + "/include/vulkan/vulkan.h",
"--abs_out_dir",
raw_vulkan_gen_dir,
"--quiet",
]
}
config("vulkan_layer_config") {
include_dirs = [
vulkan_gen_dir,
"$vulkan_layers_dir/layers",
]
}
source_set("vulkan_layer_table") {
configs -= vulkan_undefine_configs
public_deps = [
":vulkan_gen_dispatch_table_helper",
":vulkan_gen_enum_string_helper",
":vulkan_gen_struct_wrappers",
":vulkan_layer_utils",
]
public_configs = [ ":vulkan_layer_config" ]
sources = [
"$target_gen_dir/angle/vulkan/vk_dispatch_table_helper.h",
"$target_gen_dir/angle/vulkan/vk_enum_string_helper.h",
"$vulkan_layers_dir/layers/vk_layer_table.cpp",
"$vulkan_layers_dir/layers/vk_layer_table.h",
]
}
layer_names = [
"core_validation",
"image",
"object_tracker",
"swapchain",
"threading",
"unique_objects",
"parameter_validation",
]
action("vulkan_gen_json_files") {
script = "$third_party_dir/angle/scripts/generate_vulkan_layers_json.py"
sources =
rebase_path(vulkan_gypi.vulkan_gen_json_files_sources_win, ".", "src")
# The layer JSON files are part of the necessary data deps.
data = rebase_path(vulkan_gypi.vulkan_gen_json_files_sources_win, ".", "src")
outputs = vulkan_gypi.vulkan_gen_json_files_outputs
args = [
"$raw_vulkan_layers_dir/layers/windows",
"$raw_vulkan_gen_dir/json",
rebase_path(root_build_dir),
]
}
# SPIRV-tools
# -----------
spirv_source_dir = "$spirv_tools_dir/source"
spirv_include_dir = "$spirv_headers_dir/include/spirv"
raw_spirv_source_dir = rebase_path(spirv_source_dir)
raw_spirv_include_dir = rebase_path(spirv_include_dir)
raw_spirv_headers_dir = rebase_path(spirv_headers_dir)
action("spirv_tools_gen_tables_1_0") {
script = "$spirv_tools_dir/utils/generate_grammar_tables.py"
sources = [
"$spirv_include_dir/1.0/extinst.glsl.std.450.grammar.json",
"$spirv_include_dir/1.0/spirv.core.grammar.json",
"$spirv_source_dir/extinst-1.0.opencl.std.grammar.json",
]
outputs = [
"$vulkan_gen_dir/core.insts-1.0.inc",
"$vulkan_gen_dir/glsl.std.450.insts-1.0.inc",
"$vulkan_gen_dir/opencl.std.insts-1.0.inc",
"$vulkan_gen_dir/operand.kinds-1.0.inc",
]
args = [
"--spirv-core-grammar=$raw_spirv_include_dir/1.0/spirv.core.grammar.json",
"--extinst-glsl-grammar=$raw_spirv_include_dir/1.0/extinst.glsl.std.450.grammar.json",
"--extinst-opencl-grammar=$raw_spirv_source_dir/extinst-1.0.opencl.std.grammar.json",
"--core-insts-output=$raw_vulkan_gen_dir/core.insts-1.0.inc",
"--glsl-insts-output=$raw_vulkan_gen_dir/glsl.std.450.insts-1.0.inc",
"--opencl-insts-output=$raw_vulkan_gen_dir/opencl.std.insts-1.0.inc",
"--operand-kinds-output=$raw_vulkan_gen_dir/operand.kinds-1.0.inc",
]
}
action("spirv_tools_gen_tables_1_1") {
script = "$spirv_tools_dir/utils/generate_grammar_tables.py"
sources = [
"$spirv_include_dir/1.1/spirv.core.grammar.json",
]
outputs = [
"$vulkan_gen_dir/core.insts-1.1.inc",
"$vulkan_gen_dir/operand.kinds-1.1.inc",
]
args = [
"--spirv-core-grammar=$raw_spirv_include_dir/1.1/spirv.core.grammar.json",
"--core-insts-output=$raw_vulkan_gen_dir/core.insts-1.1.inc",
"--operand-kinds-output=$raw_vulkan_gen_dir/operand.kinds-1.1.inc",
]
}
action("spirv_tools_gen_generators_inc") {
script = "$spirv_tools_dir/utils/generate_registry_tables.py"
sources = [
"$spirv_headers_dir/include/spirv/spir-v.xml",
]
outputs = [
"$vulkan_gen_dir/generators.inc",
]
args = [
"--xml=$raw_spirv_headers_dir/include/spirv/spir-v.xml",
"--generator-output=$raw_vulkan_gen_dir/generators.inc",
]
}
config("spirv_tools_config") {
include_dirs = [ "$spirv_tools_dir/include" ]
if (is_win) {
cflags = [ "/wd4706" ]
}
}
static_library("spirv_tools") {
deps = [
":spirv_tools_gen_generators_inc",
":spirv_tools_gen_tables_1_0",
":spirv_tools_gen_tables_1_1",
]
include_dirs = [
vulkan_gen_dir,
"$spirv_headers_dir/include",
"$spirv_tools_dir/source",
]
sources = rebase_path(vulkan_gypi.spirv_tools_sources, ".", "src")
public_configs = [ ":spirv_tools_config" ]
}
# The validation layers
# ---------------------
config("vulkan_core_validation_config") {
include_dirs = [ glslang_dir ]
}
source_set("vulkan_core_validation_glslang") {
public_deps = [
":spirv_tools",
]
public_configs = [ ":vulkan_core_validation_config" ]
}
vk_gen_layers = [
[
"threading",
"thread_check.h",
"threading_generator.py",
],
[
"parameter_validation",
"parameter_validation.h",
"parameter_validation_generator.py",
],
[
"unique_objects",
"unique_objects_wrappers.h",
"unique_objects_generator.py",
],
]
foreach(info, vk_gen_layers) {
layer = info[0]
header = info[1]
dep = info[2]
action("vulkan_gen_$layer") {
script = "$vulkan_layers_dir/scripts/lvl_genvk.py"
inputs = [
"$vulkan_layers_dir/scripts/generator.py",
"$vulkan_layers_dir/scripts/lvl_genvk.py",
"$vulkan_layers_dir/scripts/reg.py",
"$vulkan_layers_dir/scripts/vk.xml",
"$vulkan_layers_dir/scripts/$dep",
]
outputs = [
"$vulkan_gen_dir/$header",
]
args = [
"-o",
raw_vulkan_gen_dir,
"-registry",
"$raw_vulkan_layers_dir/scripts/vk.xml",
"$header",
"-quiet",
]
}
}
layer_indexes = [
0,
1,
2,
3,
4,
5,
6,
]
layer_sources = [
vulkan_gypi.VkLayer_core_validation_sources,
vulkan_gypi.VkLayer_image_sources,
vulkan_gypi.VkLayer_swapchain_sources,
vulkan_gypi.VkLayer_object_tracker_sources,
vulkan_gypi.VkLayer_unique_objects_sources,
vulkan_gypi.VkLayer_threading_sources,
vulkan_gypi.VkLayer_parameter_validation_sources,
]
layer_additional_deps = [
[ ":vulkan_core_validation_glslang" ],
[],
[],
[],
[ ":vulkan_gen_unique_objects" ],
[ ":vulkan_gen_threading" ],
[ ":vulkan_gen_parameter_validation" ],
]
foreach(index, layer_indexes) {
layer = layer_names[index]
shared_library("VkLayer_$layer") {
configs -= vulkan_undefine_configs
deps = [
":vulkan_layer_table",
]
deps += layer_additional_deps[index]
sources = rebase_path(layer_sources[index], ".", "src")
if (is_win) {
sources += [ "$vulkan_layers_dir/layers/VKLayer_$layer.def" ]
}
}
}
# Use this target to include everything ANGLE needs for Vulkan.
@ -51,5 +377,11 @@ group("angle_vulkan") {
deps = [
":vulkan_loader",
]
data_deps = [
":vulkan_gen_json_files",
]
foreach(layer, layer_names) {
data_deps += [ ":VkLayer_$layer" ]
}
public_configs = [ ":vulkan_loader_config" ]
}

Просмотреть файл

@ -5,6 +5,9 @@
{
'variables':
{
'glslang_path': '../../third_party/glslang-angle/src',
'spirv_headers_path': '../../third_party/spirv-headers/src',
'spirv_tools_path': '../../third_party/spirv-tools-angle/src',
'vulkan_layers_path': '../../third_party/vulkan-validation-layers/src',
'vulkan_loader_sources':
[
@ -48,6 +51,158 @@
'/wd4706', # Assignment within conditional expression
'/wd4996', # Unsafe stdlib function
],
'spirv_tools_sources':
[
'<(angle_gen_path)/vulkan/core.insts-1.0.inc',
'<(angle_gen_path)/vulkan/core.insts-1.1.inc',
'<(angle_gen_path)/vulkan/generators.inc',
'<(angle_gen_path)/vulkan/glsl.std.450.insts-1.0.inc',
'<(angle_gen_path)/vulkan/opencl.std.insts-1.0.inc',
'<(angle_gen_path)/vulkan/operand.kinds-1.0.inc',
'<(angle_gen_path)/vulkan/operand.kinds-1.1.inc',
'<(spirv_tools_path)/source/assembly_grammar.cpp',
'<(spirv_tools_path)/source/assembly_grammar.h',
'<(spirv_tools_path)/source/binary.cpp',
'<(spirv_tools_path)/source/binary.h',
'<(spirv_tools_path)/source/diagnostic.cpp',
'<(spirv_tools_path)/source/diagnostic.h',
'<(spirv_tools_path)/source/disassemble.cpp',
'<(spirv_tools_path)/source/enum_set.h',
'<(spirv_tools_path)/source/ext_inst.cpp',
'<(spirv_tools_path)/source/ext_inst.h',
'<(spirv_tools_path)/source/instruction.h',
'<(spirv_tools_path)/source/libspirv.cpp',
'<(spirv_tools_path)/source/macro.h',
'<(spirv_tools_path)/source/message.cpp',
'<(spirv_tools_path)/source/name_mapper.cpp',
'<(spirv_tools_path)/source/name_mapper.h',
'<(spirv_tools_path)/source/opcode.cpp',
'<(spirv_tools_path)/source/opcode.h',
'<(spirv_tools_path)/source/operand.cpp',
'<(spirv_tools_path)/source/operand.h',
'<(spirv_tools_path)/source/parsed_operand.cpp',
'<(spirv_tools_path)/source/parsed_operand.h',
'<(spirv_tools_path)/source/print.cpp',
'<(spirv_tools_path)/source/print.h',
# TODO(jmadill): Determine if this is ever needed.
#'<(spirv_tools_path)/source/software_version.cpp',
'<(spirv_tools_path)/source/spirv_constant.h',
'<(spirv_tools_path)/source/spirv_definition.h',
'<(spirv_tools_path)/source/spirv_endian.cpp',
'<(spirv_tools_path)/source/spirv_endian.h',
'<(spirv_tools_path)/source/spirv_target_env.cpp',
'<(spirv_tools_path)/source/spirv_target_env.h',
'<(spirv_tools_path)/source/table.cpp',
'<(spirv_tools_path)/source/table.h',
'<(spirv_tools_path)/source/text.cpp',
'<(spirv_tools_path)/source/text.h',
'<(spirv_tools_path)/source/text_handler.cpp',
'<(spirv_tools_path)/source/text_handler.h',
'<(spirv_tools_path)/source/util/bitutils.h',
'<(spirv_tools_path)/source/util/hex_float.h',
'<(spirv_tools_path)/source/util/parse_number.cpp',
'<(spirv_tools_path)/source/util/parse_number.h',
'<(spirv_tools_path)/source/val/basic_block.cpp',
'<(spirv_tools_path)/source/val/construct.cpp',
'<(spirv_tools_path)/source/val/function.cpp',
'<(spirv_tools_path)/source/val/instruction.cpp',
'<(spirv_tools_path)/source/val/validation_state.cpp',
'<(spirv_tools_path)/source/validate.cpp',
'<(spirv_tools_path)/source/validate.h',
'<(spirv_tools_path)/source/validate_cfg.cpp',
'<(spirv_tools_path)/source/validate_datarules.cpp',
'<(spirv_tools_path)/source/validate_id.cpp',
'<(spirv_tools_path)/source/validate_instruction.cpp',
'<(spirv_tools_path)/source/validate_layout.cpp',
],
'vulkan_layer_utils_sources':
[
'<(vulkan_layers_path)/layers/vk_layer_config.cpp',
'<(vulkan_layers_path)/layers/vk_layer_config.h',
'<(vulkan_layers_path)/layers/vk_layer_extension_utils.cpp',
'<(vulkan_layers_path)/layers/vk_layer_extension_utils.h',
'<(vulkan_layers_path)/layers/vk_layer_utils.cpp',
'<(vulkan_layers_path)/layers/vk_layer_utils.h',
],
'vulkan_struct_wrappers_outputs':
[
'<(angle_gen_path)/vulkan/vk_safe_struct.cpp',
'<(angle_gen_path)/vulkan/vk_safe_struct.h',
'<(angle_gen_path)/vulkan/vk_struct_size_helper.c',
'<(angle_gen_path)/vulkan/vk_struct_size_helper.h',
'<(angle_gen_path)/vulkan/vk_struct_string_helper.h',
'<(angle_gen_path)/vulkan/vk_struct_string_helper_cpp.h',
'<(angle_gen_path)/vulkan/vk_struct_string_helper_no_addr.h',
'<(angle_gen_path)/vulkan/vk_struct_string_helper_no_addr_cpp.h',
'<(angle_gen_path)/vulkan/vk_struct_validate_helper.h',
'<(angle_gen_path)/vulkan/vk_struct_wrappers.cpp',
'<(angle_gen_path)/vulkan/vk_struct_wrappers.h',
],
'VkLayer_core_validation_sources':
[
# This file is manually included in the layer
# '<(angle_gen_path)/vulkan/vk_safe_struct.cpp',
'<(angle_gen_path)/vulkan/vk_safe_struct.h',
'<(vulkan_layers_path)/layers/core_validation.cpp',
'<(vulkan_layers_path)/layers/core_validation.h',
'<(vulkan_layers_path)/layers/descriptor_sets.cpp',
'<(vulkan_layers_path)/layers/descriptor_sets.h',
],
'VkLayer_image_sources':
[
'<(vulkan_layers_path)/layers/image.cpp',
'<(vulkan_layers_path)/layers/image.h',
],
'VkLayer_swapchain_sources':
[
'<(vulkan_layers_path)/layers/swapchain.cpp',
'<(vulkan_layers_path)/layers/swapchain.h',
],
'VkLayer_object_tracker_sources':
[
'<(vulkan_layers_path)/layers/object_tracker.cpp',
'<(vulkan_layers_path)/layers/object_tracker.h',
],
'VkLayer_unique_objects_sources':
[
'<(angle_gen_path)/vulkan/unique_objects_wrappers.h',
# This file is manually included in the layer
# '<(angle_gen_path)/vulkan/vk_safe_struct.cpp',
'<(angle_gen_path)/vulkan/vk_safe_struct.h',
'<(vulkan_layers_path)/layers/unique_objects.cpp',
'<(vulkan_layers_path)/layers/unique_objects.h',
],
'VkLayer_threading_sources':
[
'<(angle_gen_path)/vulkan/thread_check.h',
'<(vulkan_layers_path)/layers/threading.cpp',
'<(vulkan_layers_path)/layers/threading.h',
],
'VkLayer_parameter_validation_sources':
[
'<(angle_gen_path)/vulkan/parameter_validation.h',
'<(vulkan_layers_path)/layers/parameter_validation.cpp',
],
'vulkan_gen_json_files_sources_win':
[
'<(vulkan_layers_path)/layers/windows/VkLayer_core_validation.json',
'<(vulkan_layers_path)/layers/windows/VkLayer_image.json',
'<(vulkan_layers_path)/layers/windows/VkLayer_object_tracker.json',
'<(vulkan_layers_path)/layers/windows/VkLayer_parameter_validation.json',
'<(vulkan_layers_path)/layers/windows/VkLayer_swapchain.json',
'<(vulkan_layers_path)/layers/windows/VkLayer_threading.json',
'<(vulkan_layers_path)/layers/windows/VkLayer_unique_objects.json',
],
'vulkan_gen_json_files_outputs':
[
'<(angle_gen_path)/vulkan/json/VkLayer_core_validation.json',
'<(angle_gen_path)/vulkan/json/VkLayer_image.json',
'<(angle_gen_path)/vulkan/json/VkLayer_object_tracker.json',
'<(angle_gen_path)/vulkan/json/VkLayer_parameter_validation.json',
'<(angle_gen_path)/vulkan/json/VkLayer_swapchain.json',
'<(angle_gen_path)/vulkan/json/VkLayer_threading.json',
'<(angle_gen_path)/vulkan/json/VkLayer_unique_objects.json',
],
},
'conditions':
[
@ -65,6 +220,7 @@
'include_dirs':
[
'<@(vulkan_loader_include_dirs)',
'<(angle_gen_path)',
],
'defines':
[
@ -76,7 +232,9 @@
{
'AdditionalOptions':
[
# TODO(jmadill): Force include header on other platforms.
'<@(vulkan_loader_cflags_win)',
'/FIvulkan/angle_loader.h'
],
},
'VCLinkerTool':
@ -120,6 +278,7 @@
{
'sources':
[
'<(angle_gen_path)/vulkan/angle_loader.h',
'<@(vulkan_loader_win_sources)',
],
'defines':
@ -128,6 +287,595 @@
],
}],
],
'actions':
[
{
# The loader header is force included into the loader and layers. Because
# of issues with GYP, we can't use a normal header file, we hav to force
# inclue this using compiler-specific flags.
'action_name': 'vulkan_loader_gen_angle_header',
'message': 'generating Vulkan loader ANGLE header',
'msvs_cygwin_shell': 0,
'inputs':
[
'<(angle_path)/scripts/generate_vulkan_header.py',
],
'outputs':
[
'<(angle_gen_path)/vulkan/angle_loader.h',
],
'action':
[
# TODO(jmadill): Use correct platform path
'python', '<(angle_path)/scripts/generate_vulkan_header.py', '<(angle_gen_path)/vulkan/json',
'<(angle_gen_path)/vulkan/angle_loader.h', '<(PRODUCT_DIR)',
],
},
],
},
{
'target_name': 'spirv_tools',
'type': 'static_library',
'sources':
[
'<@(spirv_tools_sources)',
],
'include_dirs':
[
'<(angle_gen_path)/vulkan',
'<(spirv_headers_path)/include',
'<(spirv_tools_path)/include',
'<(spirv_tools_path)/source',
],
'msvs_settings':
{
'VCCLCompilerTool':
{
'PreprocessorDefinitions':
[
'_HAS_EXCEPTIONS=0',
],
'AdditionalOptions':
[
'/wd4127', # Conditional expression is constant, happens in a template in hex_float.h.
'/wd4706', # Assignment within conditional expression
'/wd4996', # Unsafe stdlib function
],
},
},
'actions':
[
{
'action_name': 'spirv_tools_gen_build_tables_1_0',
'message': 'generating info tables for SPIR-V 1.0 instructions and operands',
'msvs_cygwin_shell': 0,
'inputs':
[
'<(spirv_headers_path)/include/spirv/1.0/extinst.glsl.std.450.grammar.json',
'<(spirv_headers_path)/include/spirv/1.0/spirv.core.grammar.json',
'<(spirv_tools_path)/source/extinst-1.0.opencl.std.grammar.json',
'<(spirv_tools_path)/utils/generate_grammar_tables.py',
],
'outputs':
[
'<(angle_gen_path)/vulkan/core.insts-1.0.inc',
'<(angle_gen_path)/vulkan/glsl.std.450.insts-1.0.inc',
'<(angle_gen_path)/vulkan/opencl.std.insts-1.0.inc',
'<(angle_gen_path)/vulkan/operand.kinds-1.0.inc',
],
'action':
[
'python', '<(spirv_tools_path)/utils/generate_grammar_tables.py',
'--spirv-core-grammar=<(spirv_headers_path)/include/spirv/1.0/spirv.core.grammar.json',
'--extinst-glsl-grammar=<(spirv_headers_path)/include/spirv/1.0/extinst.glsl.std.450.grammar.json',
'--extinst-opencl-grammar=<(spirv_tools_path)/source/extinst-1.0.opencl.std.grammar.json',
'--core-insts-output=<(angle_gen_path)/vulkan/core.insts-1.0.inc',
'--glsl-insts-output=<(angle_gen_path)/vulkan/glsl.std.450.insts-1.0.inc',
'--opencl-insts-output=<(angle_gen_path)/vulkan/opencl.std.insts-1.0.inc',
'--operand-kinds-output=<(angle_gen_path)/vulkan/operand.kinds-1.0.inc',
],
},
{
'action_name': 'spirv_tools_gen_build_tables_1_1',
'message': 'generating info tables for SPIR-V 1.1 instructions and operands',
'msvs_cygwin_shell': 0,
'inputs':
[
'<(spirv_tools_path)/utils/generate_grammar_tables.py',
'<(spirv_headers_path)/include/spirv/1.1/spirv.core.grammar.json',
],
'outputs':
[
'<(angle_gen_path)/vulkan/core.insts-1.1.inc',
'<(angle_gen_path)/vulkan/operand.kinds-1.1.inc',
],
'action':
[
'python', '<(spirv_tools_path)/utils/generate_grammar_tables.py',
'--spirv-core-grammar=<(spirv_headers_path)/include/spirv/1.1/spirv.core.grammar.json',
'--core-insts-output=<(angle_gen_path)/vulkan/core.insts-1.1.inc',
'--operand-kinds-output=<(angle_gen_path)/vulkan/operand.kinds-1.1.inc',
],
},
{
'action_name': 'spirv_tools_gen_generators_inc',
'message': 'generating generators.inc for SPIRV-Tools',
'msvs_cygwin_shell': 0,
'inputs':
[
'<(spirv_tools_path)/utils/generate_registry_tables.py',
'<(spirv_headers_path)/include/spirv/spir-v.xml',
],
'outputs':
[
'<(angle_gen_path)/vulkan/generators.inc',
],
'action':
[
'python', '<(spirv_tools_path)/utils/generate_registry_tables.py',
'--xml=<(spirv_headers_path)/include/spirv/spir-v.xml',
'--generator-output=<(angle_gen_path)/vulkan/generators.inc',
],
},
],
'direct_dependent_settings':
{
'include_dirs':
[
'<(spirv_headers_path)/include',
'<(spirv_tools_path)/include',
],
},
},
{
'target_name': 'vulkan_layer_utils_static',
'type': 'static_library',
'sources':
[
'<@(vulkan_layer_utils_sources)',
],
'include_dirs':
[
'<@(vulkan_loader_include_dirs)',
],
'msvs_settings':
{
'VCCLCompilerTool':
{
'PreprocessorDefinitions':
[
'_HAS_EXCEPTIONS=0',
],
'AdditionalOptions':
[
'/wd4100', # Unreferenced formal parameter
'/wd4309', # Truncation of constant value
'/wd4505', # Unreferenced local function has been removed
'/wd4996', # Unsafe stdlib function
],
},
},
'conditions':
[
['OS=="win"',
{
'defines':
[
'WIN32',
'WIN32_LEAN_AND_MEAN',
'VK_USE_PLATFORM_WIN32_KHR',
],
}],
],
'direct_dependent_settings':
{
'msvs_cygwin_shell': 0,
'sources':
[
'<(vulkan_layers_path)/layers/vk_layer_table.cpp',
'<(vulkan_layers_path)/layers/vk_layer_table.h',
],
'include_dirs':
[
'<(angle_gen_path)/vulkan',
'<(glslang_path)',
'<(vulkan_layers_path)/layers',
'<@(vulkan_loader_include_dirs)',
],
'msvs_settings':
{
'VCCLCompilerTool':
{
'PreprocessorDefinitions':
[
'_HAS_EXCEPTIONS=0',
],
'AdditionalOptions':
[
'/wd4100', # Unreferenced local parameter
'/wd4456', # declaration hides previous local declaration
'/wd4505', # Unreferenced local function has been removed
'/wd4996', # Unsafe stdlib function
],
}
},
'conditions':
[
['OS=="win"',
{
'defines':
[
'WIN32_LEAN_AND_MEAN',
'VK_USE_PLATFORM_WIN32_KHR',
],
'configurations':
{
'Debug_Base':
{
'msvs_settings':
{
'VCCLCompilerTool':
{
'AdditionalOptions':
[
'/bigobj',
],
},
},
},
},
}],
],
},
},
{
'target_name': 'vulkan_generate_layer_helpers',
'type': 'none',
'msvs_cygwin_shell': 0,
'actions':
[
{
'action_name': 'vulkan_generate_dispatch_table_helper',
'message': 'generating Vulkan dispatch table helpers',
'inputs':
[
'<(vulkan_layers_path)/scripts/dispatch_table_generator.py',
'<(vulkan_layers_path)/scripts/generator.py',
'<(vulkan_layers_path)/scripts/lvl_genvk.py',
'<(vulkan_layers_path)/scripts/reg.py',
'<(vulkan_layers_path)/scripts/vk.xml',
],
'outputs':
[
'<(angle_gen_path)/vulkan/vk_dispatch_table_helper.h',
],
'action':
[
'python', '<(vulkan_layers_path)/scripts/lvl_genvk.py', '-o', '<(angle_gen_path)/vulkan',
'-registry', '<(vulkan_layers_path)/scripts/vk.xml', 'vk_dispatch_table_helper.h', '-quiet',
],
},
{
'action_name': 'vulkan_generate_enum_string_helper',
'message': 'generating Vulkan enum string helper',
'inputs':
[
'<(vulkan_layers_path)/scripts/vk_helper.py',
'<(vulkan_layers_path)/include/vulkan/vulkan.h'
],
'outputs':
[
'<(angle_gen_path)/vulkan/vk_enum_string_helper.h',
],
'action':
[
'python',
'<(vulkan_layers_path)/scripts/vk_helper.py',
'--gen_enum_string_helper',
'<(vulkan_layers_path)/include/vulkan/vulkan.h',
'--abs_out_dir',
'<(angle_gen_path)/vulkan',
'--quiet',
],
},
{
'action_name': 'vulkan_generate_struct_wrappers',
'message': 'generating Vulkan struct wrappers',
'inputs':
[
'<(vulkan_layers_path)/scripts/vk_helper.py',
'<(vulkan_layers_path)/include/vulkan/vulkan.h'
],
'outputs':
[
'<@(vulkan_struct_wrappers_outputs)',
],
'action':
[
'python',
'<(vulkan_layers_path)/scripts/vk_helper.py',
'--gen_struct_wrappers',
'<(vulkan_layers_path)/include/vulkan/vulkan.h',
'--abs_out_dir',
'<(angle_gen_path)/vulkan',
'--quiet',
],
},
{
'action_name': 'vulkan_generate_json_files',
'message': 'generating Vulkan json files',
'inputs':
[
'<(angle_path)/scripts/generate_vulkan_layers_json.py',
],
'outputs':
[
'<@(vulkan_gen_json_files_outputs)',
],
'conditions':
[
['OS=="win"',
{
'inputs':
[
'<@(vulkan_gen_json_files_sources_win)',
],
'action':
[
'python', '<(angle_path)/scripts/generate_vulkan_layers_json.py',
'<(vulkan_layers_path)/layers/windows', '<(angle_gen_path)/vulkan/json', '<(PRODUCT_DIR)',
],
}],
],
},
],
},
{
'target_name': 'VkLayer_core_validation',
'type': 'shared_library',
'dependencies':
[
'spirv_tools',
'vulkan_generate_layer_helpers',
'vulkan_layer_utils_static',
],
'sources':
[
'<@(VkLayer_core_validation_sources)',
],
'conditions':
[
['OS=="win"',
{
'sources':
[
'<(vulkan_layers_path)/layers/VkLayer_core_validation.def',
]
}],
],
},
{
'target_name': 'VkLayer_image',
'type': 'shared_library',
'dependencies':
[
'vulkan_generate_layer_helpers',
'vulkan_layer_utils_static',
],
'sources':
[
'<@(VkLayer_image_sources)',
],
'conditions':
[
['OS=="win"',
{
'sources':
[
'<(vulkan_layers_path)/layers/VkLayer_image.def',
]
}],
],
},
{
'target_name': 'VkLayer_swapchain',
'type': 'shared_library',
'dependencies':
[
'vulkan_generate_layer_helpers',
'vulkan_layer_utils_static',
],
'sources':
[
'<@(VkLayer_swapchain_sources)',
],
'conditions':
[
['OS=="win"',
{
'sources':
[
'<(vulkan_layers_path)/layers/VkLayer_swapchain.def',
]
}],
],
},
{
'target_name': 'VkLayer_object_tracker',
'type': 'shared_library',
'dependencies':
[
'vulkan_generate_layer_helpers',
'vulkan_layer_utils_static',
],
'sources':
[
'<@(VkLayer_object_tracker_sources)',
],
'conditions':
[
['OS=="win"',
{
'sources':
[
'<(vulkan_layers_path)/layers/VkLayer_object_tracker.def',
]
}],
],
},
{
'target_name': 'VkLayer_unique_objects',
'type': 'shared_library',
'dependencies':
[
'vulkan_generate_layer_helpers',
'vulkan_layer_utils_static',
],
'sources':
[
'<@(VkLayer_unique_objects_sources)',
],
'conditions':
[
['OS=="win"',
{
'sources':
[
'<(vulkan_layers_path)/layers/VkLayer_unique_objects.def',
]
}],
],
'actions':
[
{
'action_name': 'vulkan_layer_unique_objects_generate',
'message': 'generating Vulkan unique_objects helpers',
'inputs':
[
'<(vulkan_layers_path)/scripts/generator.py',
'<(vulkan_layers_path)/scripts/lvl_genvk.py',
'<(vulkan_layers_path)/scripts/reg.py',
'<(vulkan_layers_path)/scripts/unique_objects_generator.py',
'<(vulkan_layers_path)/scripts/vk.xml',
],
'outputs':
[
'<(angle_gen_path)/vulkan/unique_objects_wrappers.h',
],
'action':
[
'python', '<(vulkan_layers_path)/scripts/lvl_genvk.py', '-o', '<(angle_gen_path)/vulkan',
'-registry', '<(vulkan_layers_path)/scripts/vk.xml', 'unique_objects_wrappers.h', '-quiet',
],
},
],
},
{
'target_name': 'VkLayer_threading',
'type': 'shared_library',
'dependencies':
[
'vulkan_generate_layer_helpers',
'vulkan_layer_utils_static',
],
'sources':
[
'<@(VkLayer_threading_sources)',
],
'conditions':
[
['OS=="win"',
{
'sources':
[
'<(vulkan_layers_path)/layers/VkLayer_threading.def',
]
}],
],
'actions':
[
{
'action_name': 'vulkan_layer_threading_generate',
'message': 'generating Vulkan threading header',
'inputs':
[
'<(vulkan_layers_path)/scripts/generator.py',
'<(vulkan_layers_path)/scripts/lvl_genvk.py',
'<(vulkan_layers_path)/scripts/reg.py',
'<(vulkan_layers_path)/scripts/vk.xml',
],
'outputs':
[
'<(angle_gen_path)/vulkan/thread_check.h',
],
'action':
[
'python', '<(vulkan_layers_path)/scripts/lvl_genvk.py', '-o',
'<(angle_gen_path)/vulkan', '-registry', '<(vulkan_layers_path)/scripts/vk.xml',
'thread_check.h', '-quiet',
],
},
],
},
{
'target_name': 'VkLayer_parameter_validation',
'type': 'shared_library',
'dependencies':
[
'vulkan_generate_layer_helpers',
'vulkan_layer_utils_static',
],
'sources':
[
'<@(VkLayer_parameter_validation_sources)',
],
'conditions':
[
['OS=="win"',
{
'sources':
[
'<(vulkan_layers_path)/layers/VkLayer_parameter_validation.def',
]
}],
],
'actions':
[
{
'action_name': 'vulkan_layer_parameter_validation_generate',
'message': 'generating Vulkan parameter_validation header',
'inputs':
[
'<(vulkan_layers_path)/scripts/generator.py',
'<(vulkan_layers_path)/scripts/lvl_genvk.py',
'<(vulkan_layers_path)/scripts/reg.py',
'<(vulkan_layers_path)/scripts/vk.xml',
],
'outputs':
[
'<(angle_gen_path)/vulkan/parameter_validation.h',
],
'action':
[
'python', '<(vulkan_layers_path)/scripts/lvl_genvk.py', '-o', '<(angle_gen_path)/vulkan',
'-registry', '<(vulkan_layers_path)/scripts/vk.xml', 'parameter_validation.h', '-quiet',
],
},
],
},
],
}],

10
third_party/glslang-angle/README.angle поставляемый Normal file
Просмотреть файл

@ -0,0 +1,10 @@
Name: Khronos reference front-end for GLSL and ESSL
Short Name: glslang
URL: https://github.com/google/glslang
Version: N/A
Security Critical: yes
License: MIT
License File: LICENSE
Description:
An OpenGL and OpenGL ES shader front end and validator.

14
third_party/spirv-headers/README.angle поставляемый Normal file
Просмотреть файл

@ -0,0 +1,14 @@
Name: SPIR-V Headers
Short Name: spirv-headers
URL: https://github.com/KhronosGroup/SPIRV-Headers.git
Version: Unknown
Security Critical: yes
License: MIT
License File: LICENSE
Description:
This repository contains machine-readable files from the SPIR-V Registry. This includes:
* Header files for various languages.
* JSON files describing the grammar for the SPIR-V core instruction set, and for the GLSL.std.450 extended instruction set.
* The XML registry file.

11
third_party/spirv-tools-angle/README.angle поставляемый Normal file
Просмотреть файл

@ -0,0 +1,11 @@
Name: SPIR-V Tools
Short Name: SPIRV-Tools
URL: https://github.com/KhronosGroup/SPIRV-Tools.git
Version: Unknown
Security Critical: yes
License: MIT
License File: LICENSE
Description:
The SPIR-V Tools project provides an API and commands for processing
SPIR-V modules.

Просмотреть файл

@ -181,6 +181,14 @@ bool EGLWindow::initializeGL(OSWindow *osWindow)
displayAttributes.push_back(EGL_EXPERIMENTAL_PRESENT_PATH_ANGLE);
displayAttributes.push_back(mPlatform.presentPath);
}
// Set vulkan validation layer settings if requested.
if (mVulkanLayersEnabled.valid())
{
displayAttributes.push_back(EGL_PLATFORM_ANGLE_ENABLE_VALIDATION_LAYER_ANGLE);
displayAttributes.push_back(mVulkanLayersEnabled.value() ? EGL_TRUE : EGL_FALSE);
}
displayAttributes.push_back(EGL_NONE);
mDisplay = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE,

Просмотреть файл

@ -20,6 +20,7 @@
#include <EGL/eglext.h>
#include "common/angleutils.h"
#include "common/Optional.h"
class OSWindow;
@ -76,6 +77,7 @@ class ANGLE_EXPORT EGLWindow : angle::NonCopyable
{
mBindGeneratesResource = bindGeneratesResource;
}
void setVulkanLayersEnabled(bool enabled) { mVulkanLayersEnabled = enabled; }
void setSwapInterval(EGLint swapInterval) { mSwapInterval = swapInterval; }
static EGLBoolean FindEGLConfig(EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *config);
@ -124,6 +126,7 @@ class ANGLE_EXPORT EGLWindow : angle::NonCopyable
bool mWebGLCompatibility;
bool mBindGeneratesResource;
EGLint mSwapInterval;
Optional<bool> mVulkanLayersEnabled;
};
#endif // UTIL_EGLWINDOW_H_