Skip to content

Commit d3c5a23

Browse files
authored
Quoted shader file paths and fixed Vulkan task name (MonoGame#8969)
Fixes MonoGame#8968 ### Description of Change - Escaping the file path passed to mgfxc - Fixed a small typo with Vulkan
1 parent 93a3243 commit d3c5a23

5 files changed

Lines changed: 7 additions & 7 deletions

File tree

build/BuildShaders/BuildShadersDX11Task.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public override void Run(BuildContext context)
1515
foreach (var filePath in context.GetFiles($"{shadersDir}/*.fx"))
1616
{
1717
context.Information($"Building {filePath.GetFilename()}");
18-
context.DotNetRun(mgfxc, $"{filePath} {filePath.GetFilenameWithoutExtension()}.dx11.mgfxo /Profile:DirectX_11", shadersDir);
18+
context.DotNetRun(mgfxc, $"\"{filePath}\" {filePath.GetFilenameWithoutExtension()}.dx11.mgfxo /Profile:DirectX_11", shadersDir);
1919
context.Information("");
2020
}
2121
}

build/BuildShaders/BuildShadersDX12Task.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public override void Run(BuildContext context)
1717
foreach (var filePath in context.GetFiles($"{shadersDir}/*.fx"))
1818
{
1919
context.Information($"Building {filePath.GetFilename()}");
20-
context.DotNetRun(mgfxc, $"{filePath} {filePath.GetFilenameWithoutExtension()}.dx12.mgfxo /Profile:DirectX_12", workingDir);
20+
context.DotNetRun(mgfxc, $"\"{filePath}\" {filePath.GetFilenameWithoutExtension()}.dx12.mgfxo /Profile:DirectX_12", workingDir);
2121
context.Information("");
2222
}
2323

build/BuildShaders/BuildShadersOGLTask.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public override void Run(BuildContext context)
1313
foreach (var filePath in context.GetFiles($"{shadersDir}/*.fx"))
1414
{
1515
context.Information($"Building {filePath.GetFilename()}");
16-
context.DotNetRun(mgfxc, $"{filePath} {filePath.GetFilenameWithoutExtension()}.ogl.mgfxo", shadersDir);
16+
context.DotNetRun(mgfxc, $"\"{filePath}\" {filePath.GetFilenameWithoutExtension()}.ogl.mgfxo", shadersDir);
1717
context.Information("");
1818
}
1919
}

build/BuildShaders/BuildShadersVulkanTask.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
namespace BuildScripts;
33

4-
[TaskName("Build Vulklan Shaders")]
4+
[TaskName("Build Vulkan Shaders")]
55
[IsDependentOn(typeof(BuildMGFXCTask))]
66
public sealed class BuildShadersVulkanTask : FrostingTask<BuildContext>
77
{
@@ -14,7 +14,7 @@ public override void Run(BuildContext context)
1414
foreach (var filePath in context.GetFiles($"{shadersDir}/*.fx"))
1515
{
1616
context.Information($"Building {filePath.GetFilename()}");
17-
context.DotNetRun(mgfxc, $"{filePath} {filePath.GetFilenameWithoutExtension()}.vk.mgfxo /Profile:Vulkan", workingDir);
17+
context.DotNetRun(mgfxc, $"\"{filePath}\" {filePath.GetFilenameWithoutExtension()}.vk.mgfxo /Profile:Vulkan", workingDir);
1818
context.Information("");
1919
}
2020
}

scripts/build_shaders_vulkan.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
dotnet run --project "$PSScriptRoot/../build/Build.csproj" -- --target="Build Vulklan Shaders"
2-
exit $LASTEXITCODE;
1+
dotnet run --project "$PSScriptRoot/../build/Build.csproj" -- --target="Build Vulkan Shaders"
2+
exit $LASTEXITCODE;

0 commit comments

Comments
 (0)