From 21692def053bfa3f8e18a31f42d4d530428f7813 Mon Sep 17 00:00:00 2001 From: James Price Date: Mon, 8 Feb 2021 20:45:11 +0000 Subject: [PATCH] Skip SPIR-V validation when not generating SPIR-V Otherwise the sample app crashes when using --dawn-validation with a non-SPIR-V output format. Change-Id: Ic6e03e758747602d15f3a1d5b9d9cefee1aad527 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/41120 Commit-Queue: dan sinclair Auto-Submit: James Price Reviewed-by: dan sinclair --- samples/main.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/main.cc b/samples/main.cc index fe7ee56c4c..3c6c5b5a0e 100644 --- a/samples/main.cc +++ b/samples/main.cc @@ -593,7 +593,8 @@ int main(int argc, const char** argv) { bool dawn_validation_failed = false; std::ostringstream stream; - if (options.dawn_validation) { + if (options.dawn_validation && + (options.format == Format::kSpvAsm || options.format == Format::kSpirv)) { // Use Vulkan 1.1, since this is what Tint, internally, uses. spvtools::SpirvTools tools(SPV_ENV_VULKAN_1_1); tools.SetMessageConsumer([&stream](spv_message_level_t, const char*,