diff --git a/Source/Engine/ShadersCompilation/WebGPU/ShaderCompilerWebGPU.Build.cs b/Source/Engine/ShadersCompilation/WebGPU/ShaderCompilerWebGPU.Build.cs index 2fabaf679..a15b1af26 100644 --- a/Source/Engine/ShadersCompilation/WebGPU/ShaderCompilerWebGPU.Build.cs +++ b/Source/Engine/ShadersCompilation/WebGPU/ShaderCompilerWebGPU.Build.cs @@ -37,27 +37,5 @@ public class ShaderCompilerWebGPU : ShaderCompiler options.PrivateDependencies.Add("glslang"); options.PrivateDependencies.Add("spirv-tools"); options.PrivateDependencies.Add("lz4"); - - // Deploy tint executable as a dependency for the shader compilation from SPIR-V into WGSL - // Tint compiler from: https://github.com/google/dawn/releases - // License: Source/ThirdParty/tint-license.txt (BSD 3-Clause) - if (options.Target.IsPreBuilt) - return; - var depsRoot = options.DepsFolder; - switch (options.Platform.Target) - { - case TargetPlatform.Windows: - if (options.Architecture == TargetArchitecture.x64) - options.DependencyFiles.Add(Path.Combine(depsRoot, "tint.exe")); - break; - case TargetPlatform.Linux: - if (options.Architecture == TargetArchitecture.x64) - options.DependencyFiles.Add(Path.Combine(depsRoot, "tint")); - break; - case TargetPlatform.Mac: - if (options.Architecture == TargetArchitecture.ARM64) - options.DependencyFiles.Add(Path.Combine(depsRoot, "tint")); - break; - } } } diff --git a/Source/Engine/ShadersCompilation/WebGPU/ShaderCompilerWebGPU.cpp b/Source/Engine/ShadersCompilation/WebGPU/ShaderCompilerWebGPU.cpp index 64dfb63ae..636a5cc70 100644 --- a/Source/Engine/ShadersCompilation/WebGPU/ShaderCompilerWebGPU.cpp +++ b/Source/Engine/ShadersCompilation/WebGPU/ShaderCompilerWebGPU.cpp @@ -62,10 +62,9 @@ bool ShaderCompilerWebGPU::Write(ShaderCompilationContext* context, ShaderFuncti if (!context->Options->NoOptimize) procSettings.Arguments += TEXT(" --minify"); procSettings.Arguments += TEXT(" --allow-non-uniform-derivatives"); // Fix sampling texture within non-uniform control flow + procSettings.FileName = Globals::StartupFolder / String::Format(TEXT("Source/Platforms/Web/Binaries/Tools/Windows/x64/tint"), ToString(PLATFORM_TYPE), ToString(PLATFORM_ARCH)); #if PLATFORM_WINDOWS - procSettings.FileName = Globals::BinariesFolder / TEXT("tint.exe"); -#else - procSettings.FileName = Globals::BinariesFolder / TEXT("tint"); + procSettings.FileName += TEXT(".exe"); #endif int32 result = Platform::CreateProcess(procSettings); StringAnsi wgsl; diff --git a/Source/Platforms/Linux/Binaries/ThirdParty/x64/tint b/Source/Platforms/Web/Binaries/Tools/Linux/x64/tint similarity index 100% rename from Source/Platforms/Linux/Binaries/ThirdParty/x64/tint rename to Source/Platforms/Web/Binaries/Tools/Linux/x64/tint diff --git a/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/tint b/Source/Platforms/Web/Binaries/Tools/Mac/ARM64/tint similarity index 100% rename from Source/Platforms/Mac/Binaries/ThirdParty/ARM64/tint rename to Source/Platforms/Web/Binaries/Tools/Mac/ARM64/tint diff --git a/Source/Platforms/Windows/Binaries/ThirdParty/x64/tint.exe b/Source/Platforms/Web/Binaries/Tools/Windows/x64/tint.exe similarity index 100% rename from Source/Platforms/Windows/Binaries/ThirdParty/x64/tint.exe rename to Source/Platforms/Web/Binaries/Tools/Windows/x64/tint.exe diff --git a/Source/Tools/Flax.Build/Deps/Dependencies/tint.cs b/Source/Tools/Flax.Build/Deps/Dependencies/tint.cs index c2298d976..12d34ac88 100644 --- a/Source/Tools/Flax.Build/Deps/Dependencies/tint.cs +++ b/Source/Tools/Flax.Build/Deps/Dependencies/tint.cs @@ -119,18 +119,18 @@ namespace Flax.Deps.Dependencies BuildCmake(buildDir, config, options: Utilities.RunOptions.ConsoleLogOutput); // Deploy executable - var depsFolder = GetThirdPartyFolder(options, platform, architecture); + var dstFolder = Path.Combine(GetBinariesFolder(options, TargetPlatform.Web), "Tools", platform.ToString(), architecture.ToString()); switch (platform) { case TargetPlatform.Windows: - Utilities.FileCopy(Path.Combine(buildDir, config, "tint.exe"), Path.Combine(depsFolder, "tint.exe")); + Utilities.FileCopy(Path.Combine(buildDir, config, "tint.exe"), Path.Combine(dstFolder, "tint.exe")); break; default: - Utilities.FileCopy(Path.Combine(buildDir, "tint"), Path.Combine(depsFolder, "tint")); + Utilities.FileCopy(Path.Combine(buildDir, "tint"), Path.Combine(dstFolder, "tint")); if (BuildPlatform != TargetPlatform.Windows) { - Utilities.Run("chmod", "+x tint", null, depsFolder, Utilities.RunOptions.ConsoleLogOutput); - Utilities.Run("strip", "tint", null, depsFolder, Utilities.RunOptions.ConsoleLogOutput); + Utilities.Run("chmod", "+x tint", null, dstFolder, Utilities.RunOptions.ConsoleLogOutput); + Utilities.Run("strip", "tint", null, dstFolder, Utilities.RunOptions.ConsoleLogOutput); } break; }