From 32abaffa73370beacc2932677dfa5ce7ac6d6587 Mon Sep 17 00:00:00 2001 From: Corentin Wallez Date: Wed, 28 Nov 2018 16:54:31 +0000 Subject: [PATCH] Roll SPIRV-Tools and temporarily use Vulkan SPIRV validation New additions to the validation for the WebGPU execution environment broke all the tests that use shaders because tests don't produce valid SPIR-V for WebGPU and also backends don't know how to lower WebGPU-flavored SPIR-V to target languages. Also rolls SPIRV-Headers to a version compatible with SPIRV-Tools TBR=kainino@chromium.org BUG=dawn:57 Change-Id: Icd9a199efc39cf143e38d64841eb4b122c9f54a9 Reviewed-on: https://dawn-review.googlesource.com/c/2706 Reviewed-by: Corentin Wallez Reviewed-by: Stephen White Commit-Queue: Corentin Wallez --- DEPS | 4 ++-- src/dawn_native/ShaderModule.cpp | 2 +- .../unittests/validation/ShaderModuleValidationTests.cpp | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/DEPS b/DEPS index c3ee4e1b60..69deb4a26f 100644 --- a/DEPS +++ b/DEPS @@ -56,11 +56,11 @@ deps = { # SPIRV compiler dependencies: SPIRV-Tools, SPIRV-headers, glslang and shaderc 'third_party/SPIRV-Tools': { - 'url': '{chromium_git}/external/github.com/KhronosGroup/SPIRV-Tools@1225324ae2450623e62621b91b380644f84c16d1', + 'url': '{chromium_git}/external/github.com/KhronosGroup/SPIRV-Tools@dab634da93d39763bc5b526de9d25104a3bd3b65', 'condition': 'dawn_standalone', }, 'third_party/spirv-headers': { - 'url': '{chromium_git}/external/github.com/KhronosGroup/SPIRV-Headers@d5b2e1255f706ce1f88812217e9a554f299848af', + 'url': '{chromium_git}/external/github.com/KhronosGroup/SPIRV-Headers@7cb43009d543e90698dd300eb26dfd6d9a9bb100', 'condition': 'dawn_standalone', }, 'third_party/glslang': { diff --git a/src/dawn_native/ShaderModule.cpp b/src/dawn_native/ShaderModule.cpp index d125409923..d7867a3ec3 100644 --- a/src/dawn_native/ShaderModule.cpp +++ b/src/dawn_native/ShaderModule.cpp @@ -30,7 +30,7 @@ namespace dawn_native { return DAWN_VALIDATION_ERROR("nextInChain must be nullptr"); } - spvtools::SpirvTools spirvTools(SPV_ENV_WEBGPU_0); + spvtools::SpirvTools spirvTools(SPV_ENV_VULKAN_1_1); std::ostringstream errorStream; errorStream << "SPIRV Validation failure:" << std::endl; diff --git a/src/tests/unittests/validation/ShaderModuleValidationTests.cpp b/src/tests/unittests/validation/ShaderModuleValidationTests.cpp index 5bf4a2163b..b1bda010d9 100644 --- a/src/tests/unittests/validation/ShaderModuleValidationTests.cpp +++ b/src/tests/unittests/validation/ShaderModuleValidationTests.cpp @@ -52,7 +52,9 @@ TEST_F(ShaderModuleValidationTest, CreationSuccess) { } // Test case with a shader with OpUndef to test WebGPU-specific validation -TEST_F(ShaderModuleValidationTest, OpUndef) { +// TODO(cwallez@chromium.org): Disabled because of +// https://bugs.chromium.org/p/dawn/issues/detail?id=57 +TEST_F(ShaderModuleValidationTest, DISABLED_OpUndef) { const char* shader = R"( OpCapability Shader %1 = OpExtInstImport "GLSL.std.450"