From c3284fa40ec6b12731ed66c2f2a9256ae3fa692e Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Thu, 7 Nov 2019 17:02:57 +0000 Subject: [PATCH] Migrate away from using recently deprecated APIs Due to a renaming/refactoring of the spvc API Dawn is currently using a deprecated class name. Fixing this, so the deprecated APIs can be removed. Also including the roll to pick up the API changes. Roll third_party/shaderc/ 0a260d789..76ee91e12 (7 commits) https://chromium.googlesource.com/external/github.com/google/shaderc/+log/0a260d789fe9..76ee91e12642 $ git log 0a260d789..76ee91e12 --date=short --no-merges --format='%ad %ae %s' 2019-11-06 9856269+sarahM0 Fix spvc test machanism and adds unit tests for OpSource (#868) 2019-11-06 rharrison Move spirv_cross state out of result and rename opaque state handle (#865) 2019-11-05 9856269+sarahM0 Add unit test for spvcir parser (#866) 2019-11-04 rharrison Rolling 5 dependencies (#862) 2019-11-04 9856269+sarahM0 Add --emit-line-drective option (#861) 2019-11-01 9856269+sarahM0 Add spvcir unit test - OpCapability (#857) 2019-11-01 rharrison Add flag for updating invalid expecations and rewrite end logic (#856) Created with: roll-dep third_party/shaderc Change-Id: I81649618da6753657ef5a7533785559c2a13c416 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/13180 Commit-Queue: Ryan Harrison Commit-Queue: Corentin Wallez Reviewed-by: Austin Eng Reviewed-by: Corentin Wallez --- DEPS | 2 +- src/fuzzers/DawnSPIRVCrossGLSLFastFuzzer.cpp | 8 ++++---- src/fuzzers/DawnSPIRVCrossHLSLFastFuzzer.cpp | 8 ++++---- src/fuzzers/DawnSPIRVCrossMSLFastFuzzer.cpp | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/DEPS b/DEPS index 0229c75c83..82bc6e2bd5 100644 --- a/DEPS +++ b/DEPS @@ -68,7 +68,7 @@ deps = { 'condition': 'dawn_standalone', }, 'third_party/shaderc': { - 'url': '{chromium_git}/external/github.com/google/shaderc@f16e793858c4b438382f8483cb95f65b6b9aa3bf', + 'url': '{chromium_git}/external/github.com/google/shaderc@76ee91e12642e2be731aac3f0f21401b0e7d9d16', 'condition': 'dawn_standalone', }, diff --git a/src/fuzzers/DawnSPIRVCrossGLSLFastFuzzer.cpp b/src/fuzzers/DawnSPIRVCrossGLSLFastFuzzer.cpp index 1fdb4a69c1..1470882081 100644 --- a/src/fuzzers/DawnSPIRVCrossGLSLFastFuzzer.cpp +++ b/src/fuzzers/DawnSPIRVCrossGLSLFastFuzzer.cpp @@ -20,12 +20,12 @@ namespace { int GLSLFastFuzzTask(const std::vector& input) { - shaderc_spvc::Compiler compiler; - if (!compiler.IsValid()) { + shaderc_spvc::Context context; + if (!context.IsValid()) { return 0; } - DawnSPIRVCrossFuzzer::ExecuteWithSignalTrap([&compiler, &input]() { + DawnSPIRVCrossFuzzer::ExecuteWithSignalTrap([&context, &input]() { shaderc_spvc::CompileOptions options; options.SetSourceEnvironment(shaderc_target_env_webgpu, shaderc_env_version_webgpu); options.SetTargetEnvironment(shaderc_target_env_vulkan, shaderc_env_version_vulkan_1_1); @@ -33,7 +33,7 @@ namespace { // Using the options that are used by Dawn, they appear in ShaderModuleGL.cpp options.SetGLSLLanguageVersion(440); options.SetFixupClipspace(true); - compiler.CompileSpvToGlsl(input.data(), input.size(), options); + context.CompileSpvToGlsl(input.data(), input.size(), options); }); return 0; diff --git a/src/fuzzers/DawnSPIRVCrossHLSLFastFuzzer.cpp b/src/fuzzers/DawnSPIRVCrossHLSLFastFuzzer.cpp index 6ebe67d1d9..bf10c54eb7 100644 --- a/src/fuzzers/DawnSPIRVCrossHLSLFastFuzzer.cpp +++ b/src/fuzzers/DawnSPIRVCrossHLSLFastFuzzer.cpp @@ -21,12 +21,12 @@ namespace { int FuzzTask(const std::vector& input) { - shaderc_spvc::Compiler compiler; - if (!compiler.IsValid()) { + shaderc_spvc::Context context; + if (!context.IsValid()) { return 0; } - DawnSPIRVCrossFuzzer::ExecuteWithSignalTrap([&compiler, &input]() { + DawnSPIRVCrossFuzzer::ExecuteWithSignalTrap([&context, &input]() { shaderc_spvc::CompileOptions options; options.SetSourceEnvironment(shaderc_target_env_webgpu, shaderc_env_version_webgpu); options.SetTargetEnvironment(shaderc_target_env_vulkan, shaderc_env_version_vulkan_1_1); @@ -39,7 +39,7 @@ namespace { // See https://github.com/gpuweb/gpuweb/issues/332 options.SetHLSLPointCoordCompat(true); options.SetHLSLPointSizeCompat(true); - compiler.CompileSpvToHlsl(input.data(), input.size(), options); + context.CompileSpvToHlsl(input.data(), input.size(), options); }); return 0; diff --git a/src/fuzzers/DawnSPIRVCrossMSLFastFuzzer.cpp b/src/fuzzers/DawnSPIRVCrossMSLFastFuzzer.cpp index 36bb0c423a..df68a8c670 100644 --- a/src/fuzzers/DawnSPIRVCrossMSLFastFuzzer.cpp +++ b/src/fuzzers/DawnSPIRVCrossMSLFastFuzzer.cpp @@ -21,18 +21,18 @@ namespace { int FuzzTask(const std::vector& input) { - shaderc_spvc::Compiler compiler; - if (!compiler.IsValid()) { + shaderc_spvc::Context context; + if (!context.IsValid()) { return 0; } - DawnSPIRVCrossFuzzer::ExecuteWithSignalTrap([&compiler, &input]() { + DawnSPIRVCrossFuzzer::ExecuteWithSignalTrap([&context, &input]() { shaderc_spvc::CompileOptions options; options.SetSourceEnvironment(shaderc_target_env_webgpu, shaderc_env_version_webgpu); options.SetTargetEnvironment(shaderc_target_env_vulkan, shaderc_env_version_vulkan_1_1); // Using the options that are used by Dawn, they appear in ShaderModuleMTL.mm - compiler.CompileSpvToMsl(input.data(), input.size(), options); + context.CompileSpvToMsl(input.data(), input.size(), options); }); return 0;