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 <dsinclair@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
Ryan Harrison 2020-08-13 17:33:59 +00:00 committed by Commit Bot service account
parent 5e7ef27ca7
commit a532ac55d9
2 changed files with 4 additions and 6 deletions

View File

@ -389,10 +389,8 @@ int main(int argc, const char** argv) {
if (!ReadFile<char>(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

View File

@ -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.