From a532ac55d92f686910ac798e35b816c4853185d0 Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Thu, 13 Aug 2020 17:33:59 +0000 Subject: [PATCH] Fix handling of .spvasm inputs BUG=tint:207 Change-Id: Ic429a909d092423908409678b7256bd88de10a99 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26760 Commit-Queue: dan sinclair Reviewed-by: dan sinclair --- samples/main.cc | 6 ++---- src/reader/spirv/parser_impl.cc | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/samples/main.cc b/samples/main.cc index eecb85809e..b115a3d783 100644 --- a/samples/main.cc +++ b/samples/main.cc @@ -389,10 +389,8 @@ int main(int argc, const char** argv) { if (!ReadFile(options.input_filename, &text)) { return 1; } - // By default, use SPIR-V 1.3, the original proposal for SPIR-V binary - // input for WebGPU. This lines up with the SPIRV-Tools validation - // for the SPV_ENV_WEBGPU0 environment. - spvtools::SpirvTools tools(SPV_ENV_UNIVERSAL_1_3); + // Use Vulkan 1.1, since this is what Tint, internally, is expecting. + spvtools::SpirvTools tools(SPV_ENV_VULKAN_1_1); tools.SetMessageConsumer([](spv_message_level_t, const char*, const spv_position_t& pos, const char* msg) { std::cerr << (pos.line + 1) << ":" << (pos.column + 1) << ": " << msg diff --git a/src/reader/spirv/parser_impl.cc b/src/reader/spirv/parser_impl.cc index 96ec16062b..4f6df45088 100644 --- a/src/reader/spirv/parser_impl.cc +++ b/src/reader/spirv/parser_impl.cc @@ -77,11 +77,11 @@ namespace spirv { namespace { -// Input SPIR-V needs only to conform to Vulkan 1.0 requirements. +// Input SPIR-V needs only to conform to Vulkan 1.1 requirements. // The combination of the SPIR-V reader and the semantics of WGSL // tighten up the code so that the output of the SPIR-V *writer* // will satisfy SPV_ENV_WEBGPU_0 validation. -const spv_target_env kInputEnv = SPV_ENV_VULKAN_1_0; +const spv_target_env kInputEnv = SPV_ENV_VULKAN_1_1; // A FunctionTraverser is used to compute an ordering of functions in the // module such that callees precede callers.