Add in flag for using spvc instead of direct spriv-cross access

Currently does nothing interesting, future CLs will flesh out the
functionality.

BUG=dawn:281

Change-Id: I89750a45ff5a42a13e1494cafd433bb7ef719b10
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/13841
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
This commit is contained in:
Ryan Harrison 2019-11-20 18:10:11 +00:00 committed by Commit Bot service account
parent d3123137b1
commit 8f3dc5836b
3 changed files with 13 additions and 3 deletions

View File

@ -127,6 +127,11 @@ source_set("libdawn_native_sources") {
"${dawn_spirv_tools_dir}:spvtools_val",
"third_party:spirv_cross",
]
defines = []
if (dawn_use_spvc) {
deps += [ "${dawn_shaderc_dir}:libshaderc_spvc" ]
defines += [ "DAWN_USE_SPVC" ]
}
configs += [ ":libdawn_native_internal" ]
libs = []
@ -500,7 +505,7 @@ source_set("libdawn_native_sources") {
]
}
if (dawn_enable_vulkan_validation_layers) {
defines = [
defines += [
"DAWN_ENABLE_VULKAN_VALIDATION_LAYERS",
"DAWN_VK_DATA_DIR=\"$vulkan_data_subdir\"",
]

View File

@ -44,6 +44,10 @@ declare_args() {
# GLSL/HLSL/MSL compiler. This implicitly pulls in the GLSL
# compiler, since it is a sub-class of if.
dawn_enable_cross_reflection = false
# Enables using spvc for accessing SPIR-V toolchain, instead of
# directly accessing it in Dawn.
dawn_use_spvc = false
}
# GN does not allow reading a variable defined in the same declare_args().

View File

@ -66,8 +66,9 @@ static_library("spirv_cross") {
"${spirv_cross_dir}/spirv_parser.hpp",
]
need_glsl_cross = dawn_enable_opengl || dawn_enable_cross_reflection
need_reflection_cross = dawn_enable_cross_reflection
need_glsl_cross =
dawn_enable_opengl || dawn_enable_cross_reflection || dawn_use_spvc
need_reflection_cross = dawn_enable_cross_reflection || dawn_use_spvc
if (dawn_enable_d3d12) {
sources += [