Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 50 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: .NET 10 build baseline
name: .NET 10 SDK qualification

on:
push:
Expand All @@ -10,7 +10,7 @@ permissions:
contents: read

concurrency:
group: build-${{ github.workflow }}-${{ github.ref }}
group: build-${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true

jobs:
Expand All @@ -29,7 +29,10 @@ jobs:
global-json-file: global.json
cache: true
cache-dependency-path: '**/packages.lock.json'
- name: Restore, build, baseline tests, pack, and consume packages
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Restore, build, ABI tests, pack, and consume packages
shell: pwsh
run: ./build.ps1 -Configuration ${{ matrix.configuration }}
- name: Upload build evidence
Expand All @@ -42,3 +45,47 @@ jobs:
artifacts/test-results/**
artifacts/packages/**
if-no-files-found: warn

interop-aot:
name: Native COM JIT and AOT (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, windows-2025]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- uses: ilammy/msvc-dev-cmd@v1
if: runner.os == 'Windows'
with:
arch: x64
- name: Native fixture and managed/AOT ownership qualification
shell: pwsh
run: ./build/VerifyInterop.ps1 -Configuration Release -PublishAot
- name: WARP swap-chain resize qualification
if: runner.os == 'Windows'
shell: pwsh
run: dotnet run --project samples/ModernTriangle -c Debug -- --warp --resize-test --evidence=artifacts/triangle-resize
- name: WARP compute and DirectML numerical qualification
if: runner.os == 'Windows'
shell: pwsh
run: |
dotnet run --project samples/ModernCompute -c Debug -- --warp --directml
if ($LASTEXITCODE -ne 0) { throw 'JIT numerical qualification failed.' }
dotnet publish samples/ModernCompute -c Release -r win-x64 -p:PublishAot=true -o artifacts/modern-compute-aot
if ($LASTEXITCODE -ne 0) { throw 'NativeAOT compute publish failed.' }
& ./artifacts/modern-compute-aot/ModernCompute.exe --warp --directml --no-debug
if ($LASTEXITCODE -ne 0) { throw 'NativeAOT numerical qualification failed.' }
- uses: actions/upload-artifact@v4
if: always()
with:
name: interop-${{ matrix.os }}
path: |
artifacts/qualification-aot/**
artifacts/modern-compute-aot/**
artifacts/triangle-resize/**
if-no-files-found: warn
77 changes: 77 additions & 0 deletions DXSharp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,18 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "inc", "inc", "{301D517A-385
devops\pipelines\inc\global-varz.yml = devops\pipelines\inc\global-varz.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{827E0CD3-B72D-47B6-A68D-7590B98EB39B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DXSharp.Core", "src\DXSharp.Core\DXSharp.Core.csproj", "{95C699FE-92C8-4296-BC32-D250258EA40D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DXSharp.DirectML", "src\DXSharp.DirectML\DXSharp.DirectML.csproj", "{28A906D9-4254-467D-9238-8C60C49E2E21}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InteropQualification", "tests\InteropQualification\InteropQualification.csproj", "{6D81F5A7-1D01-49DF-8D02-ECD9183FDF6F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ModernTriangle", "samples\ModernTriangle\ModernTriangle.csproj", "{AA296E18-E027-4E92-A7D7-42FC5086A052}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ModernCompute", "samples\ModernCompute\ModernCompute.csproj", "{2BB6521A-B6BC-4BD3-AC2E-67E8042386E4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -230,6 +242,66 @@ Global
{2362EB4B-6F3D-4274-A836-C5394A9660FC}.Release|x64.Build.0 = Release|Any CPU
{2362EB4B-6F3D-4274-A836-C5394A9660FC}.Release|x86.ActiveCfg = Release|Any CPU
{2362EB4B-6F3D-4274-A836-C5394A9660FC}.Release|x86.Build.0 = Release|Any CPU
{95C699FE-92C8-4296-BC32-D250258EA40D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{95C699FE-92C8-4296-BC32-D250258EA40D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{95C699FE-92C8-4296-BC32-D250258EA40D}.Debug|x64.ActiveCfg = Debug|x64
{95C699FE-92C8-4296-BC32-D250258EA40D}.Debug|x64.Build.0 = Debug|x64
{95C699FE-92C8-4296-BC32-D250258EA40D}.Debug|x86.ActiveCfg = Debug|x86
{95C699FE-92C8-4296-BC32-D250258EA40D}.Debug|x86.Build.0 = Debug|x86
{95C699FE-92C8-4296-BC32-D250258EA40D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{95C699FE-92C8-4296-BC32-D250258EA40D}.Release|Any CPU.Build.0 = Release|Any CPU
{95C699FE-92C8-4296-BC32-D250258EA40D}.Release|x64.ActiveCfg = Release|x64
{95C699FE-92C8-4296-BC32-D250258EA40D}.Release|x64.Build.0 = Release|x64
{95C699FE-92C8-4296-BC32-D250258EA40D}.Release|x86.ActiveCfg = Release|x86
{95C699FE-92C8-4296-BC32-D250258EA40D}.Release|x86.Build.0 = Release|x86
{28A906D9-4254-467D-9238-8C60C49E2E21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{28A906D9-4254-467D-9238-8C60C49E2E21}.Debug|Any CPU.Build.0 = Debug|Any CPU
{28A906D9-4254-467D-9238-8C60C49E2E21}.Debug|x64.ActiveCfg = Debug|x64
{28A906D9-4254-467D-9238-8C60C49E2E21}.Debug|x64.Build.0 = Debug|x64
{28A906D9-4254-467D-9238-8C60C49E2E21}.Debug|x86.ActiveCfg = Debug|x86
{28A906D9-4254-467D-9238-8C60C49E2E21}.Debug|x86.Build.0 = Debug|x86
{28A906D9-4254-467D-9238-8C60C49E2E21}.Release|Any CPU.ActiveCfg = Release|Any CPU
{28A906D9-4254-467D-9238-8C60C49E2E21}.Release|Any CPU.Build.0 = Release|Any CPU
{28A906D9-4254-467D-9238-8C60C49E2E21}.Release|x64.ActiveCfg = Release|x64
{28A906D9-4254-467D-9238-8C60C49E2E21}.Release|x64.Build.0 = Release|x64
{28A906D9-4254-467D-9238-8C60C49E2E21}.Release|x86.ActiveCfg = Release|x86
{28A906D9-4254-467D-9238-8C60C49E2E21}.Release|x86.Build.0 = Release|x86
{6D81F5A7-1D01-49DF-8D02-ECD9183FDF6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6D81F5A7-1D01-49DF-8D02-ECD9183FDF6F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6D81F5A7-1D01-49DF-8D02-ECD9183FDF6F}.Debug|x64.ActiveCfg = Debug|x64
{6D81F5A7-1D01-49DF-8D02-ECD9183FDF6F}.Debug|x64.Build.0 = Debug|x64
{6D81F5A7-1D01-49DF-8D02-ECD9183FDF6F}.Debug|x86.ActiveCfg = Debug|x86
{6D81F5A7-1D01-49DF-8D02-ECD9183FDF6F}.Debug|x86.Build.0 = Debug|x86
{6D81F5A7-1D01-49DF-8D02-ECD9183FDF6F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6D81F5A7-1D01-49DF-8D02-ECD9183FDF6F}.Release|Any CPU.Build.0 = Release|Any CPU
{6D81F5A7-1D01-49DF-8D02-ECD9183FDF6F}.Release|x64.ActiveCfg = Release|x64
{6D81F5A7-1D01-49DF-8D02-ECD9183FDF6F}.Release|x64.Build.0 = Release|x64
{6D81F5A7-1D01-49DF-8D02-ECD9183FDF6F}.Release|x86.ActiveCfg = Release|x86
{6D81F5A7-1D01-49DF-8D02-ECD9183FDF6F}.Release|x86.Build.0 = Release|x86
{AA296E18-E027-4E92-A7D7-42FC5086A052}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AA296E18-E027-4E92-A7D7-42FC5086A052}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AA296E18-E027-4E92-A7D7-42FC5086A052}.Debug|x64.ActiveCfg = Debug|x64
{AA296E18-E027-4E92-A7D7-42FC5086A052}.Debug|x64.Build.0 = Debug|x64
{AA296E18-E027-4E92-A7D7-42FC5086A052}.Debug|x86.ActiveCfg = Debug|x86
{AA296E18-E027-4E92-A7D7-42FC5086A052}.Debug|x86.Build.0 = Debug|x86
{AA296E18-E027-4E92-A7D7-42FC5086A052}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AA296E18-E027-4E92-A7D7-42FC5086A052}.Release|Any CPU.Build.0 = Release|Any CPU
{AA296E18-E027-4E92-A7D7-42FC5086A052}.Release|x64.ActiveCfg = Release|x64
{AA296E18-E027-4E92-A7D7-42FC5086A052}.Release|x64.Build.0 = Release|x64
{AA296E18-E027-4E92-A7D7-42FC5086A052}.Release|x86.ActiveCfg = Release|x86
{AA296E18-E027-4E92-A7D7-42FC5086A052}.Release|x86.Build.0 = Release|x86
{2BB6521A-B6BC-4BD3-AC2E-67E8042386E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2BB6521A-B6BC-4BD3-AC2E-67E8042386E4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2BB6521A-B6BC-4BD3-AC2E-67E8042386E4}.Debug|x64.ActiveCfg = Debug|x64
{2BB6521A-B6BC-4BD3-AC2E-67E8042386E4}.Debug|x64.Build.0 = Debug|x64
{2BB6521A-B6BC-4BD3-AC2E-67E8042386E4}.Debug|x86.ActiveCfg = Debug|x86
{2BB6521A-B6BC-4BD3-AC2E-67E8042386E4}.Debug|x86.Build.0 = Debug|x86
{2BB6521A-B6BC-4BD3-AC2E-67E8042386E4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2BB6521A-B6BC-4BD3-AC2E-67E8042386E4}.Release|Any CPU.Build.0 = Release|Any CPU
{2BB6521A-B6BC-4BD3-AC2E-67E8042386E4}.Release|x64.ActiveCfg = Release|x64
{2BB6521A-B6BC-4BD3-AC2E-67E8042386E4}.Release|x64.Build.0 = Release|x64
{2BB6521A-B6BC-4BD3-AC2E-67E8042386E4}.Release|x86.ActiveCfg = Release|x86
{2BB6521A-B6BC-4BD3-AC2E-67E8042386E4}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -256,6 +328,11 @@ Global
{9AA76EA1-7D92-40CF-A170-B38DEEB87396} = {AF35E6EE-C244-4E1F-84A6-DED8F9BD0EC7}
{3FEFFBFD-24AE-4B98-AF02-1A2EA87F9245} = {60DAF7CD-8C68-4BDF-9940-5ACBF49620D3}
{301D517A-3852-4BEC-911A-EAF7F421F3EB} = {60DAF7CD-8C68-4BDF-9940-5ACBF49620D3}
{95C699FE-92C8-4296-BC32-D250258EA40D} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
{28A906D9-4254-467D-9238-8C60C49E2E21} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
{6D81F5A7-1D01-49DF-8D02-ECD9183FDF6F} = {4A52D278-0251-4FD5-BF3A-5C52C294480A}
{AA296E18-E027-4E92-A7D7-42FC5086A052} = {AEE84FD5-7441-42CF-AA6C-5805B759E1F8}
{2BB6521A-B6BC-4BD3-AC2E-67E8042386E4} = {AEE84FD5-7441-42CF-AA6C-5805B759E1F8}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7C4990EC-248E-49D5-A254-EA8AD214C338}
Expand Down
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<PackageVersion Include="Microsoft.Windows.SDK.Win32Metadata" Version="56.0.13-preview" />
<PackageVersion Include="Microsoft.Direct3D.D3D12" Version="1.620.1" />
<PackageVersion Include="Microsoft.Direct3D.DXC" Version="1.9.2609.5" />
<PackageVersion Include="Microsoft.AI.DirectML" Version="1.15.4" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageVersion Include="NUnit" Version="3.14.0" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.5.0" />
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@

See [the .NET 10 build baseline](doc/NET10-Build-Baseline.md) for Release builds, locked dependencies, test scope, package checks, and current limitations. The original proof-of-concept architecture described below is being migrated incrementally; compilation does not establish production readiness.

The [generated COM foundation](doc/Generated-Com-Foundation.md) adds the modern `DXSharp.Core` and optional `DXSharp.DirectML` path, native ownership qualification, DXC compilation, and bounded graphics/compute samples. The coverage matrix distinguishes working implementations from the remaining port and records what has actually been executed.

## Roadmap 🛤️

- [x] Initial DirectX 12 support
Expand Down
1 change: 1 addition & 0 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ try {
if ([int] $trx.TestRun.ResultSummary.Counters.executed -lt 1) {
throw 'The baseline test filter executed no tests.'
}
& (Join-Path $PSScriptRoot 'build/VerifyInterop.ps1') -Configuration $Configuration
if ($RunGraphicsTests) {
Invoke-DotNet -Arguments @('test', 'tests/BasicTests/BasicTests.csproj', '--configuration', $Configuration,
'--no-build', '--no-restore', '--filter', 'TestCategory!=BuildBaseline',
Expand Down
26 changes: 26 additions & 0 deletions build/CaptureCrash.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[CmdletBinding()]
param(
[Parameter(Mandatory)] [string] $Executable,
[Parameter(Mandatory)] [string] $ProcDumpPath,
[string[]] $Arguments = @(),
[string] $OutputDirectory = (Join-Path (Split-Path $PSScriptRoot -Parent) 'artifacts/crashes')
)
$ErrorActionPreference = 'Stop'
if (-not $IsWindows) { throw 'Crash capture requires Windows.' }
$executablePath = (Resolve-Path $Executable).Path
$procDump = (Resolve-Path $ProcDumpPath).Path
$directory = [System.IO.Path]::GetFullPath($OutputDirectory)
New-Item -ItemType Directory -Force $directory | Out-Null
@{
Executable = $executablePath
Arguments = $Arguments
StartedUtc = [DateTime]::UtcNow.ToString('O')
OS = [System.Runtime.InteropServices.RuntimeInformation]::OSDescription
Architecture = [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString()
SHA256 = (Get-FileHash $executablePath -Algorithm SHA256).Hash
DotNet = (& dotnet --info | Out-String)
} | ConvertTo-Json -Depth 4 | Set-Content (Join-Path $directory 'session.json')
# Full dump on an unhandled exception, launching this executable only. ProcDump
# handles its own first-run license prompt. No machine-wide crash settings change.
& $procDump -ma -e -x $directory $executablePath @Arguments 2>&1 | Tee-Object (Join-Path $directory 'procdump.log')
if ($LASTEXITCODE -ne 0) { throw "ProcDump exited with code $LASTEXITCODE. See $directory." }
44 changes: 44 additions & 0 deletions build/VerifyInterop.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[CmdletBinding()]
param(
[ValidateSet('Debug', 'Release')] [string] $Configuration = 'Debug',
[ValidateSet('x64')] [string] $Architecture = 'x64',
[switch] $PublishAot
)
$ErrorActionPreference = 'Stop'
Set-StrictMode -Version Latest
$repoRoot = Split-Path $PSScriptRoot -Parent
function Invoke-Checked([string] $Command, [string[]] $Arguments) {
& $Command @Arguments
if ($LASTEXITCODE -ne 0) { throw "$Command failed with exit code $LASTEXITCODE." }
}
Push-Location $repoRoot
try {
$nativeDirectory = Join-Path $repoRoot "artifacts/native/$Architecture"
New-Item -ItemType Directory -Force $nativeDirectory | Out-Null
$source = Join-Path $repoRoot 'tests/InteropQualification/native/fixture.cpp'
if ($IsWindows) {
# Run from a Developer PowerShell, with cl.exe configured for Architecture.
$fixture = Join-Path $nativeDirectory 'dxsharp_abi.dll'
Invoke-Checked 'cl.exe' @('/nologo', '/std:c++17', '/EHsc', '/LD', '/O2', $source,
"/Fo$nativeDirectory/fixture.obj", '/link', "/OUT:$fixture", "/IMPLIB:$nativeDirectory/dxsharp_abi.lib")
$rid = "win-$Architecture"
} elseif ($IsLinux -and $Architecture -eq 'x64') {
$fixture = Join-Path $nativeDirectory 'libdxsharp_abi.so'
Invoke-Checked 'g++' @('-std=c++17', '-shared', '-fPIC', '-O2', $source, '-o', $fixture)
$rid = 'linux-x64'
} else { throw 'This script qualifies Windows x64/x86/ARM64 and Linux x64.' }
$project = 'tests/InteropQualification/InteropQualification.csproj'
Invoke-Checked 'dotnet' @('restore', $project, '--locked-mode', '-m:1')
Invoke-Checked 'dotnet' @('build', $project, '-c', $Configuration, '--no-restore', '-m:1', "-p:DXSharpNativeFixture=$fixture")
$managed = (& dotnet msbuild $project "-p:Configuration=$Configuration" -getProperty:TargetPath -nologo | Out-String).Trim()
if ($LASTEXITCODE -ne 0 -or -not (Test-Path $managed)) { throw 'Unable to locate the built qualification assembly.' }
Invoke-Checked 'dotnet' @($managed)
if ($PublishAot) {
$publish = Join-Path $repoRoot "artifacts/qualification-aot/$rid"
Invoke-Checked 'dotnet' @('publish', $project, '-m:1', '-c', $Configuration, '-r', $rid, '-p:PublishAot=true',
"-p:DXSharpNativeFixture=$fixture", '-o', $publish)
Copy-Item $fixture $publish -Force
$executable = Join-Path $publish $(if ($IsWindows) { 'InteropQualification.exe' } else { 'InteropQualification' })
Invoke-Checked $executable @()
}
} finally { Pop-Location }
34 changes: 33 additions & 1 deletion build/VerifyPackages.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ try {
if ($LASTEXITCODE -ne 0 -or [string]::IsNullOrWhiteSpace($version)) {
throw 'Unable to evaluate the package version.'
}
foreach ($name in @('DXSharp', 'DXSharp.Dxc', 'DXSharp.Framework')) {
foreach ($name in @('DXSharp', 'DXSharp.Dxc', 'DXSharp.Framework', 'DXSharp.Core', 'DXSharp.DirectML')) {
if (-not (Test-Path (Join-Path $packageDirectory "$name.$version.nupkg"))) {
throw "Missing package: $name.$version.nupkg"
}
Expand All @@ -28,15 +28,21 @@ try {
<TargetFramework>net10.0-windows10.0.26100.0</TargetFramework>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
<UseWindowsForms>true</UseWindowsForms>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>false</SelfContained>
<PublishSingleFile>true</PublishSingleFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DXSharp.Framework" Version="$version" />
<PackageReference Include="DXSharp.DirectML" Version="$version" />
</ItemGroup>
</Project>
"@ | Set-Content (Join-Path $consumerDirectory 'Consumer.csproj')
@'
System.Console.WriteLine(typeof(DXSharp.Direct3D12.IDevice).Assembly.FullName);
System.Console.WriteLine(typeof(DXSharp.Dxc.ShaderBuilder).Assembly.FullName);
System.Console.WriteLine(typeof(DXSharp.Graphics.GraphicsDevice).Assembly.FullName);
System.Console.WriteLine(typeof(DXSharp.MachineLearning.DirectMlDevice).Assembly.FullName);
'@ | Set-Content (Join-Path $consumerDirectory 'Program.cs')
@"
<configuration>
Expand All @@ -54,6 +60,32 @@ System.Console.WriteLine(typeof(DXSharp.Dxc.ShaderBuilder).Assembly.FullName);
if ($LASTEXITCODE -ne 0) { throw 'Package consumer restore failed.' }
& dotnet build Consumer.csproj --configuration $Configuration --no-restore
if ($LASTEXITCODE -ne 0) { throw 'Package consumer build failed.' }
$output = (& dotnet msbuild Consumer.csproj "-p:Configuration=$Configuration" -getProperty:TargetDir -nologo | Out-String).Trim()
if ($LASTEXITCODE -ne 0 -or -not (Test-Path $output)) { throw 'Unable to locate the package consumer output.' }
$native = @{
'D3D12/D3D12Core.dll' = 'microsoft.direct3d.d3d12/1.620.1/build/native/bin/x64/D3D12Core.dll'
'D3D12/D3D12StateObjectCompiler.dll' = 'microsoft.direct3d.d3d12/1.620.1/build/native/bin/x64/D3D12StateObjectCompiler.dll'
'dxcompiler.dll' = 'microsoft.direct3d.dxc/1.9.2609.5/build/native/bin/x64/dxcompiler.dll'
'dxil.dll' = 'microsoft.direct3d.dxc/1.9.2609.5/build/native/bin/x64/dxil.dll'
'DirectML.dll' = 'microsoft.ai.directml/1.15.4/bin/x64-win/DirectML.dll'
}
function Test-NativeOutput([string] $Directory) {
foreach ($relative in $native.Keys) {
$actual = Join-Path $Directory $relative
$expected = Join-Path $consumerDirectory "packages/$($native[$relative])"
if (-not (Test-Path $actual) -or (Get-FileHash $actual).Hash -ne (Get-FileHash $expected).Hash) {
throw "Missing or incorrect native package asset: $actual"
}
}
}
Test-NativeOutput $output
$publish = Join-Path $consumerDirectory 'publish'
& dotnet publish Consumer.csproj --configuration $Configuration --no-restore --output $publish
if ($LASTEXITCODE -ne 0) { throw 'Package consumer single-file publish failed.' }
Test-NativeOutput $publish
foreach ($debugLayer in @('D3D12/d3d12SDKLayers.dll', 'DirectML.Debug.dll')) {
if (Test-Path (Join-Path $publish $debugLayer)) { throw "Debug layer leaked into publish: $debugLayer" }
}
} finally {
Pop-Location
}
Expand Down
8 changes: 8 additions & 0 deletions build/msbuild/DXSharp.Core.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project>
<PropertyGroup>
<!-- Match Directory.Packages.props; native SDK packages are runtime dependencies. -->
<PkgMicrosoft_Direct3D_D3D12 Condition="'$(PkgMicrosoft_Direct3D_D3D12)' == ''">$(NuGetPackageRoot)/microsoft.direct3d.d3d12/1.620.1</PkgMicrosoft_Direct3D_D3D12>
<PkgMicrosoft_Direct3D_DXC Condition="'$(PkgMicrosoft_Direct3D_DXC)' == ''">$(NuGetPackageRoot)/microsoft.direct3d.dxc/1.9.2609.5</PkgMicrosoft_Direct3D_DXC>
</PropertyGroup>
<Import Project="$(MSBuildThisFileDirectory)DXSharp.NativeAssets.targets" />
</Project>
Loading
Loading