Browse Source

Quoted shader file paths and fixed Vulkan task name (#8969)

Fixes #8968

### Description of Change
- Escaping the file path passed to mgfxc
- Fixed a small typo with Vulkan
roz 6 months ago
parent
commit
d3c5a23227

+ 1 - 1
build/BuildShaders/BuildShadersDX11Task.cs

@@ -15,7 +15,7 @@ public sealed class BuildShadersDX11Task : FrostingTask<BuildContext>
         foreach (var filePath in context.GetFiles($"{shadersDir}/*.fx"))
         {
             context.Information($"Building {filePath.GetFilename()}");
-            context.DotNetRun(mgfxc, $"{filePath} {filePath.GetFilenameWithoutExtension()}.dx11.mgfxo /Profile:DirectX_11", shadersDir);
+            context.DotNetRun(mgfxc, $"\"{filePath}\" {filePath.GetFilenameWithoutExtension()}.dx11.mgfxo /Profile:DirectX_11", shadersDir);
             context.Information("");
         }
     }

+ 1 - 1
build/BuildShaders/BuildShadersDX12Task.cs

@@ -17,7 +17,7 @@ public sealed class BuildShadersDX12Task : FrostingTask<BuildContext>
         foreach (var filePath in context.GetFiles($"{shadersDir}/*.fx"))
         {
             context.Information($"Building {filePath.GetFilename()}");
-            context.DotNetRun(mgfxc, $"{filePath} {filePath.GetFilenameWithoutExtension()}.dx12.mgfxo /Profile:DirectX_12", workingDir);
+            context.DotNetRun(mgfxc, $"\"{filePath}\" {filePath.GetFilenameWithoutExtension()}.dx12.mgfxo /Profile:DirectX_12", workingDir);
             context.Information("");
         }
 

+ 1 - 1
build/BuildShaders/BuildShadersOGLTask.cs

@@ -13,7 +13,7 @@ public sealed class BuildShadersOGLTask : FrostingTask<BuildContext>
         foreach (var filePath in context.GetFiles($"{shadersDir}/*.fx"))
         {
             context.Information($"Building {filePath.GetFilename()}");
-            context.DotNetRun(mgfxc, $"{filePath} {filePath.GetFilenameWithoutExtension()}.ogl.mgfxo", shadersDir);
+            context.DotNetRun(mgfxc, $"\"{filePath}\" {filePath.GetFilenameWithoutExtension()}.ogl.mgfxo", shadersDir);
             context.Information("");
         }
     }

+ 2 - 2
build/BuildShaders/BuildShadersVulkanTask.cs

@@ -1,7 +1,7 @@
 
 namespace BuildScripts;
 
-[TaskName("Build Vulklan Shaders")]
+[TaskName("Build Vulkan Shaders")]
 [IsDependentOn(typeof(BuildMGFXCTask))]
 public sealed class BuildShadersVulkanTask : FrostingTask<BuildContext>
 {
@@ -14,7 +14,7 @@ public sealed class BuildShadersVulkanTask : FrostingTask<BuildContext>
         foreach (var filePath in context.GetFiles($"{shadersDir}/*.fx"))
             {
                 context.Information($"Building {filePath.GetFilename()}");
-                context.DotNetRun(mgfxc, $"{filePath} {filePath.GetFilenameWithoutExtension()}.vk.mgfxo /Profile:Vulkan", workingDir);
+                context.DotNetRun(mgfxc, $"\"{filePath}\" {filePath.GetFilenameWithoutExtension()}.vk.mgfxo /Profile:Vulkan", workingDir);
                 context.Information("");
             }
     }

+ 2 - 2
scripts/build_shaders_vulkan.ps1

@@ -1,2 +1,2 @@
-dotnet run --project "$PSScriptRoot/../build/Build.csproj" -- --target="Build Vulklan Shaders"
-exit $LASTEXITCODE;
+dotnet run --project "$PSScriptRoot/../build/Build.csproj" -- --target="Build Vulkan Shaders"
+exit $LASTEXITCODE;