Add AGS third party module

AGS 6.3
This commit is contained in:
Wojtek Figat
2025-08-10 17:16:09 +02:00
parent c1c806490f
commit bc0e1f81e7
10 changed files with 9074 additions and 1 deletions

BIN
Source/Platforms/Windows/Binaries/ThirdParty/x64/amd_ags_x64.dll (Stored with Git LFS) vendored Normal file

Binary file not shown.

BIN
Source/Platforms/Windows/Binaries/ThirdParty/x64/amd_ags_x64.lib (Stored with Git LFS) vendored Normal file

Binary file not shown.

51
Source/ThirdParty/AGS/AGS.Build.cs vendored Normal file
View File

@@ -0,0 +1,51 @@
// Copyright (c) Wojciech Figat. All rights reserved.
using System.IO;
using Flax.Build;
using Flax.Build.NativeCpp;
/// <summary>
/// https://github.com/GPUOpen-LibrariesAndSDKs/AGS_SDK
/// </summary>
public class AGS : DepsModule
{
public static bool Use(BuildOptions options)
{
return options.Platform.Target == TargetPlatform.Windows && options.Architecture == TargetArchitecture.x64;
}
/// <inheritdoc />
public override void Init()
{
base.Init();
LicenseType = LicenseTypes.MIT;
LicenseFilePath = "LICENSE.txt";
// Merge third-party modules into engine binary
BinaryModuleName = "FlaxEngine";
}
/// <inheritdoc />
public override void Setup(BuildOptions options)
{
base.Setup(options);
var depsRoot = options.DepsFolder;
options.PublicDefinitions.Add("COMPILE_WITH_AGS");
switch (options.Platform.Target)
{
case TargetPlatform.Windows:
switch (options.Architecture)
{
case TargetArchitecture.x64:
options.OutputFiles.Add(Path.Combine(depsRoot, "amd_ags_x64.lib"));
options.OptionalDependencyFiles.Add(Path.Combine(depsRoot, "amd_ags_x64.dll"));
break;
default: throw new InvalidArchitectureException(options.Architecture);
}
break;
default: throw new InvalidPlatformException(options.Platform.Target);
}
}
}

19
Source/ThirdParty/AGS/LICENSE.txt vendored Normal file
View File

@@ -0,0 +1,19 @@
Copyright (c) 2025 Advanced Micro Devices, Inc. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1394
Source/ThirdParty/AGS/amd_ags.h vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,46 @@
// Copyright (c) Wojciech Figat. All rights reserved.
using Flax.Build;
using System.IO;
namespace Flax.Deps.Dependencies
{
/// <summary>
/// AMD GPU Services (AGS) library
/// https://github.com/GPUOpen-LibrariesAndSDKs/AGS_SDK
/// </summary>
/// <seealso cref="Flax.Deps.Dependency" />
class AGS : Dependency
{
/// <inheritdoc />
public override TargetPlatform[] Platforms
{
get => new[] { TargetPlatform.Windows };
}
/// <inheritdoc />
public override void Build(BuildOptions options)
{
var root = options.IntermediateFolder;
var moduleFolder = Path.Combine(options.ThirdPartyFolder, "AGS");
// Get the source
CloneGitRepoFast(root, "https://github.com/GPUOpen-LibrariesAndSDKs/AGS_SDK.git");
// Copy files
foreach (var platform in options.Platforms)
{
BuildStarted(platform);
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
Utilities.FileCopy(Path.Combine(root, "ags_lib/lib/amd_ags_x64.lib"), Path.Combine(depsFolder, "amd_ags_x64.lib"));
Utilities.FileCopy(Path.Combine(root, "ags_lib/lib/amd_ags_x64.dll"), Path.Combine(depsFolder, "amd_ags_x64.dll"));
}
// Copy license and header files
Utilities.FileCopy(Path.Combine(root, "LICENSE.txt"), Path.Combine(moduleFolder, "LICENSE.txt"));
Utilities.FileCopy(Path.Combine(root, "ags_lib/inc/amd_ags.h"), Path.Combine(moduleFolder, "amd_ags.h"));
Utilities.FileCopy(Path.Combine(root, "ags_lib/hlsl/ags_shader_intrinsics_dx11.hlsl"), Path.Combine(moduleFolder, "ags_shader_intrinsics_dx11.hlsl"));
Utilities.FileCopy(Path.Combine(root, "ags_lib/hlsl/ags_shader_intrinsics_dx12.hlsl"), Path.Combine(moduleFolder, "ags_shader_intrinsics_dx12.hlsl"));
}
}
}

View File

@@ -36,7 +36,7 @@ namespace Flax.Deps.Dependencies
}
// Copy license and header files
Utilities.FileCopy(Path.Combine(root, "License.txt"), Path.Combine(moduleFolder, "LICENSE.txt"));
Utilities.FileCopy(Path.Combine(root, "License.txt"), Path.Combine(moduleFolder, "License.txt"));
var files = new[]
{
"nvHLSLExtns.h",