From 903fc2b049cbef83ebe87cd007cf826ce33bfe55 Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Tue, 11 Jun 2019 14:38:51 +0000 Subject: [PATCH] Explictly set the environment for the Fast fuzzers BUG=chromium:970300 Change-Id: Ib57a2dcd92a378412588901df9cadc271cad18d4 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8001 Reviewed-by: Kai Ninomiya Reviewed-by: Corentin Wallez Commit-Queue: Ryan Harrison --- src/fuzzers/DawnSPIRVCrossGLSLFastFuzzer.cpp | 5 ++++- src/fuzzers/DawnSPIRVCrossHLSLFastFuzzer.cpp | 2 ++ src/fuzzers/DawnSPIRVCrossMSLFastFuzzer.cpp | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/fuzzers/DawnSPIRVCrossGLSLFastFuzzer.cpp b/src/fuzzers/DawnSPIRVCrossGLSLFastFuzzer.cpp index 8322598f27..1fdb4a69c1 100644 --- a/src/fuzzers/DawnSPIRVCrossGLSLFastFuzzer.cpp +++ b/src/fuzzers/DawnSPIRVCrossGLSLFastFuzzer.cpp @@ -26,8 +26,11 @@ namespace { } DawnSPIRVCrossFuzzer::ExecuteWithSignalTrap([&compiler, &input]() { - // Using the options that are used by Dawn, they appear in ShaderModuleGL.cpp 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 ShaderModuleGL.cpp options.SetGLSLLanguageVersion(440); options.SetFixupClipspace(true); compiler.CompileSpvToGlsl(input.data(), input.size(), options); diff --git a/src/fuzzers/DawnSPIRVCrossHLSLFastFuzzer.cpp b/src/fuzzers/DawnSPIRVCrossHLSLFastFuzzer.cpp index 3a3953727b..193a758133 100644 --- a/src/fuzzers/DawnSPIRVCrossHLSLFastFuzzer.cpp +++ b/src/fuzzers/DawnSPIRVCrossHLSLFastFuzzer.cpp @@ -28,6 +28,8 @@ namespace { DawnSPIRVCrossFuzzer::ExecuteWithSignalTrap([&compiler, &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 ShaderModuleD3D12.cpp options.SetFlipVertY(true); diff --git a/src/fuzzers/DawnSPIRVCrossMSLFastFuzzer.cpp b/src/fuzzers/DawnSPIRVCrossMSLFastFuzzer.cpp index fc30193475..13c8391352 100644 --- a/src/fuzzers/DawnSPIRVCrossMSLFastFuzzer.cpp +++ b/src/fuzzers/DawnSPIRVCrossMSLFastFuzzer.cpp @@ -28,6 +28,8 @@ namespace { DawnSPIRVCrossFuzzer::ExecuteWithSignalTrap([&compiler, &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 options.SetFlipVertY(true);