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);