Add runtime toggle for using SPVC

This will be used in the future to choose between Dawn directly
accessing spirv-cross, and using spvc to mediate that interation.

This also adds in the spvc library as a dependency. This is what cause
the rollback last time, but that issue should be resolved.

BUG=dawn:281

Change-Id: Ic0b02d136ca05e2fa71844ebc85586b8866d5712
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14122
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Ryan Harrison 2019-11-28 18:12:35 +00:00 committed by Commit Bot service account
parent 22e73a5b28
commit 0625ae2167
3 changed files with 7 additions and 1 deletions

View File

@ -134,6 +134,7 @@ source_set("libdawn_native_sources") {
":libdawn_native_headers",
":libdawn_native_utils_gen",
"${dawn_root}/src/common",
"${dawn_shaderc_dir}:libshaderc_spvc",
"${dawn_shaderc_dir}:spirv_cross",
"${dawn_spirv_tools_dir}:spvtools_val",
]

View File

@ -82,7 +82,11 @@ namespace dawn_native {
"versions of Windows prior to build 1809, or when this toggle is turned off, Dawn "
"will emulate a render pass."}},
{Toggle::SkipValidation,
{"skip_validation", "Skip expensive validation of Dawn commands."}}}};
{"skip_validation", "Skip expensive validation of Dawn commands."}},
{Toggle::UseSpvc,
{"use_spvc",
"Enable use of spvc for shader compilation, instead of accessing spirv_cross "
"directly."}}}};
} // anonymous namespace
void TogglesSet::SetToggle(Toggle toggle, bool enabled) {

View File

@ -33,6 +33,7 @@ namespace dawn_native {
UseD3D12ResourceHeapTier2,
UseD3D12RenderPass,
SkipValidation,
UseSpvc,
EnumCount,
InvalidEnum = EnumCount,