Skip to content

Commit e83480d

Browse files
ci: pin standalone ARM64 WARP for offscreen shader tests
1 parent e1e4db0 commit e83480d

3 files changed

Lines changed: 25 additions & 0 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,18 @@ jobs:
3030
- name: Build application
3131
shell: pwsh
3232
run: .\build.ps1 -Architecture '${{ matrix.arch }}' -OutputDirectory 'out\${{ matrix.arch }}'
33+
- name: Pin ARM64 offscreen test rasterizer
34+
if: matrix.arch == 'arm64'
35+
shell: pwsh
36+
run: |
37+
$version = '1.0.20'
38+
New-Item -ItemType Directory -Force out/test-warp | Out-Null
39+
Invoke-WebRequest "https://api.nuget.org/v3-flatcontainer/microsoft.direct3d.warp/$version/microsoft.direct3d.warp.$version.nupkg" -OutFile out/test-warp/package.zip
40+
Expand-Archive out/test-warp/package.zip out/test-warp/package
41+
$dll = Get-ChildItem out/test-warp/package -Recurse -Filter d3d10warp.dll | Where-Object { $_.Directory.Name -eq 'arm64' }
42+
if (@($dll).Count -ne 1) { throw 'Expected one ARM64 test WARP binary.' }
43+
"FLOATNOTE_TEST_WARP=$($dll.FullName)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
44+
$dll.VersionInfo | Select-Object FileName,FileVersion
3345
- name: Run native and glass regression
3446
shell: pwsh
3547
run: |

‎docs/DEVELOPMENT.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,5 @@ Package staging uses a fixed file allowlist: EXE, bilingual README, quick start,
6565
- Apply transparency only to the background; text must remain legible.
6666
- Treat glass as optional. Editing must work when composition, transparency effects, or the backdrop API is unavailable.
6767
- Avoid polling and animation loops while the note is idle.
68+
69+
ARM64 CI pins Microsoft.Direct3D.WARP 1.0.20 for offscreen HLSL tests because the runner's system WARP crashes during this fixture. FLOATNOTE_TEST_WARP selects that test-only DLL. Application builds and release archives continue to use Windows system components only; the pinned test DLL is never packaged.

‎tests/glass_adaptation.cpp‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ struct GlassAdaptationTest {
1919
static void Check(HRESULT hr) {if(FAILED(hr))throw std::runtime_error("D3D operation failed");}
2020
~GlassAdaptationTest(){g.Close();}
2121
static LONG WINAPI Crash(EXCEPTION_POINTERS* error) {
22+
static volatile LONG reports=0;
23+
if(InterlockedIncrement(&reports)>4)return EXCEPTION_CONTINUE_SEARCH;
2224
if(error->ExceptionRecord->ExceptionCode!=EXCEPTION_ACCESS_VIOLATION && error->ExceptionRecord->ExceptionCode!=EXCEPTION_ILLEGAL_INSTRUCTION && error->ExceptionRecord->ExceptionCode!=EXCEPTION_STACK_OVERFLOW)return EXCEPTION_CONTINUE_SEARCH;
2325
MEMORY_BASIC_INFORMATION region{};
2426
char module[MAX_PATH]{};
@@ -36,6 +38,15 @@ struct GlassAdaptationTest {
3638
(void)handler;
3739
Trace("compile shaders");
3840
Check(GlassLabBackdrop::WarmShaderBytecode());
41+
// CI can pin Microsoft's standalone WARP for offscreen shader tests.
42+
// The production renderer never loads this test-only dependency.
43+
wchar_t warpPath[MAX_PATH]{};
44+
const DWORD pathLength=GetEnvironmentVariableW(L"FLOATNOTE_TEST_WARP",warpPath,MAX_PATH);
45+
if(pathLength) {
46+
if(pathLength>=MAX_PATH || !LoadLibraryExW(warpPath,nullptr,LOAD_WITH_ALTERED_SEARCH_PATH))
47+
throw std::runtime_error("Could not load pinned test WARP");
48+
std::fwprintf(stderr,L"Test WARP: %ls\n",warpPath);
49+
}
3950
Trace("create device");
4051
Check(D3D11CreateDevice(nullptr,hardware?D3D_DRIVER_TYPE_HARDWARE:D3D_DRIVER_TYPE_WARP,nullptr,0,nullptr,0,D3D11_SDK_VERSION,&g.device,nullptr,&g.context));
4152
Trace("create shaders");

0 commit comments

Comments
 (0)