Commit 3a181e3e by Tobin Ehlis Committed by Commit Bot

Roll VK deps forward as of 8/31/2018

Roll Vulkan ANGLE dependencies forward as of 8/31/2018. This grabs some new validation checks including point-related checks that may be interesting for bug 2727. One of these checks, related to PointSize, is firing so I've added some code in the VK debug callback to suppress those error messages for now and filed a separate bug (2796) to fix that issue in the renderer. Had to overhaul the json gen script as validation changed how these are generated. They now use a base template with some strings replaced to account for platform and Vulkan header version. Offloaded all of that work to our existing json generate script which was previously more of an intelligent copy but now had some further intelligence for transforming from input template into final json files. Had to also roll glslang forward to meet shader validation dependency. Bug: angleproject:2727 Change-Id: I929619cd258cddd6bc9c6743600e072c46736f5c Reviewed-on: https://chromium-review.googlesource.com/1194617Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Tobin Ehlis <tobine@google.com>
parent 89e82979
......@@ -12,7 +12,7 @@ vars = {
'deqp_revision': '4c0f2a4fba813e1046115c43c887eccb749b7bb3',
# Current revision of glslang, the Khronos SPIRV compiler.
'glslang_revision': '1ea8f595f9a9ebd938fe9e5f15ae469c7d6ebabc',
'glslang_revision': '312dcfb070a7274066d3e85e10970f57b1e3af6e',
# Current revision of jsoncpp, an open-source json parser.
'jsoncpp_revision': '93ba642c636309a3195d6da6c11ba82f69ef45ed',
......@@ -24,16 +24,16 @@ vars = {
'spirv_tools_revision': '48326d443e434f55eb50a7cfc9acdc968daad5e3',
# Current revision of Khronos Vulkan-Headers.
'vulkan_headers_revision': 'ec4eff88f79b74c4865f41bef0d6af9a46d53896',
'vulkan_headers_revision': 'db09f95ac00e44149f3894bf82c918e58277cfdb',
# Current revision of Khronos Vulkan-Loader.
'vulkan_loader_revision': 'a8358804f3c5b4e284d5e9a88b232309bb3c333d',
'vulkan_loader_revision': '808c5cb8f5b420adb3cf5e28aee6b6112076e27c',
# Current revision of Khronos Vulkan-Tools.
'vulkan_tools_revision': 'b7c389c9d3efe5cea722eb7395fb70529dd27566',
'vulkan_tools_revision': '31030a11a6425701566d8f5194b528f4d911eab5',
# Current revision of Khronos Vulkan-ValidationLayers.
'vulkan_validation_revision': '9e92c5c0e5b0b2264d72d8bafe15f049cba1c67d',
'vulkan_validation_revision': '1ffea21fdebb90f314274b8b7dadaae0ca1ffe65',
}
deps = {
......
......@@ -8,7 +8,7 @@
# 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
import os, sys, json, glob, platform
if len(sys.argv) != 3:
print("Usage: " + sys.argv[0] + " <source_dir> <target_dir>")
......@@ -16,6 +16,7 @@ if len(sys.argv) != 3:
source_dir = sys.argv[1]
target_dir = sys.argv[2]
angle_root_dir = os.path.dirname(sys.path[0])
data_key = 'layer'
if 'icd' in source_dir:
......@@ -28,6 +29,7 @@ if not os.path.isdir(source_dir):
if not os.path.exists(target_dir):
os.makedirs(target_dir)
# Copy the *.json files from source dir to target dir
for json_fname in glob.glob(os.path.join(source_dir, "*.json")):
with open(json_fname) as infile:
data = json.load(infile)
......@@ -44,3 +46,32 @@ for json_fname in glob.glob(os.path.join(source_dir, "*.json")):
target_fname = os.path.join(target_dir, os.path.basename(json_fname))
with open(target_fname, "w") as outfile:
json.dump(data, outfile)
# Get the Vulkan version from the vulkan_core.h file
vk_header_filename = os.path.join(angle_root_dir, "third_party", "vulkan-headers", "src", "include", "vulkan", "vulkan_core.h")
vk_version = '83'
with open(vk_header_filename) as vk_header_file:
for line in vk_header_file:
if line.startswith("#define VK_HEADER_VERSION"):
vk_version = line.split()[-1]
break
# Set json file prefix and suffix for generating files below, default to Linux
relative_path_prefix = "../lib"
file_type_suffix = ".so"
if 'Windows' == platform.system():
relative_path_prefix = "..\\\\"
file_type_suffix = ".dll"
# For each *.json.in template files in source dir generate actual json file in target dir
for json_in_name in glob.glob(os.path.join(source_dir, "*.json.in")):
json_in_fname = os.path.basename(json_in_name)
layer_name = json_in_fname[:-8] # Kill ".json.in" from end of filename
layer_lib_name = '%s%s' % (layer_name, file_type_suffix)
json_out_fname = os.path.join(target_dir, json_in_fname[:-3])
with open(json_out_fname,'w') as json_out_file:
with open(json_in_name) as infile:
for line in infile:
line = line.replace('@RELATIVE_LAYER_BINARY@', ('%s%s' % (relative_path_prefix, layer_lib_name)))
line = line.replace('@VK_VERSION@', ('1.1.%s' % (vk_version)))
json_out_file.write(line)
......@@ -78,6 +78,27 @@ VkResult VerifyExtensionsPresent(const std::vector<VkExtensionProperties> &exten
return VK_SUCCESS;
}
// Array of Validation error/warning messages that will be ignored, should include bugID
constexpr std::array<const char *, 1> kSkippedMessages = {
// http://anglebug.com/2796
" [ UNASSIGNED-CoreValidation-Shader-PointSizeMissing ] Object: VK_NULL_HANDLE (Type = 19) "
"| Pipeline topology is set to POINT_LIST, but PointSize is not written to in the shader "
"corresponding to VK_SHADER_STAGE_VERTEX_BIT."};
// Suppress validation errors that are known
// return "true" if given code/prefix/message is known, else return "false"
bool IsIgnoredDebugMessage(const char *message)
{
for (const auto &msg : kSkippedMessages)
{
if (strcmp(msg, message) == 0)
{
return true;
}
}
return false;
}
VKAPI_ATTR VkBool32 VKAPI_CALL DebugReportCallback(VkDebugReportFlagsEXT flags,
VkDebugReportObjectTypeEXT objectType,
uint64_t object,
......@@ -87,6 +108,10 @@ VKAPI_ATTR VkBool32 VKAPI_CALL DebugReportCallback(VkDebugReportFlagsEXT flags,
const char *message,
void *userData)
{
if (IsIgnoredDebugMessage(message))
{
return VK_FALSE;
}
if ((flags & VK_DEBUG_REPORT_ERROR_BIT_EXT) != 0)
{
ERR() << message;
......
......@@ -119,6 +119,7 @@ static_library("glslang") {
if (is_win) {
cflags = [
"/wd4065", # switch statement w/ default but no case
"/wd4100", # Unreferenced formal parameter
"/wd4456", # Declaration hides previous local declaration
"/wd4457", # Declaration hides function parameter
......@@ -139,7 +140,10 @@ executable("glslang_validator") {
"src/StandAlone/DirStackFileIncluder.h",
"src/StandAlone/StandAlone.cpp",
]
defines = [ "ENABLE_OPT" ]
if (!is_win) {
cflags = [ "-Woverflow" ]
}
defines = [ "ENABLE_OPT=0" ]
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
public_deps = [
......
......@@ -326,28 +326,15 @@ if (!is_android) {
action("vulkan_gen_json_files") {
script = "$angle_root/scripts/generate_vulkan_layers_json.py"
if (is_win) {
sources = [
"src/layers/windows/VkLayer_core_validation.json",
"src/layers/windows/VkLayer_object_tracker.json",
"src/layers/windows/VkLayer_parameter_validation.json",
"src/layers/windows/VkLayer_standard_validation.json",
"src/layers/windows/VkLayer_threading.json",
"src/layers/windows/VkLayer_unique_objects.json",
]
args = [ "$raw_vulkan_layers_dir/layers/windows" ]
}
if (is_linux) {
sources = [
"src/layers/linux/VkLayer_core_validation.json",
"src/layers/linux/VkLayer_object_tracker.json",
"src/layers/linux/VkLayer_parameter_validation.json",
"src/layers/linux/VkLayer_standard_validation.json",
"src/layers/linux/VkLayer_threading.json",
"src/layers/linux/VkLayer_unique_objects.json",
]
args = [ "$raw_vulkan_layers_dir/layers/linux" ]
}
sources = [
"src/layers/json/VkLayer_core_validation.json.in",
"src/layers/json/VkLayer_object_tracker.json.in",
"src/layers/json/VkLayer_parameter_validation.json.in",
"src/layers/json/VkLayer_standard_validation.json.in",
"src/layers/json/VkLayer_threading.json.in",
"src/layers/json/VkLayer_unique_objects.json.in",
]
args = [ "$raw_vulkan_layers_dir/layers/json" ]
# The layer JSON files are part of the necessary data deps.
outputs = vulkan_gen_json_files_outputs
......
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