From a7e56beb19476450faff05d4c676ac6e9b600a45 Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Wed, 15 Oct 2025 12:14:20 +0200 Subject: [PATCH] ci: Run the Windows tests with WARP version 1.0.16.1. Many tests fail or even segfault with the older WARP version provided by the current CI Windows environment. --- gitlab/test.yml | 6 +++++ tests/driver.c | 21 ++++++++++++++++- tests/hlsl/sm1-centroid.shader_test | 36 +++++++++++++---------------- 3 files changed, 42 insertions(+), 21 deletions(-) diff --git a/gitlab/test.yml b/gitlab/test.yml index 340e700da..6eefaeb78 100644 --- a/gitlab/test.yml +++ b/gitlab/test.yml @@ -8,6 +8,8 @@ tags: - win10-21h2 script: + - 'Invoke-WebRequest -Uri "https://www.nuget.org/api/v2/package/Microsoft.Direct3D.WARP/1.0.16.1" -OutFile ".\warp.zip"' + - 'Expand-Archive -Path "warp.zip" -DestinationPath ".\warp"' - git rebase $CI_MERGE_REQUEST_DIFF_BASE_SHA --exec './artifacts/driver.cross64.exe $(git cherry $CI_MERGE_REQUEST_DIFF_BASE_SHA HEAD^ | wc -l) $(git rev-parse --short HEAD)' - if (Test-Path "pipeline_failed") { exit 1 } artifacts: @@ -42,6 +44,8 @@ test-win-64-dxc: variables: VKD3D_TEST_DEBUG: '1' script: + - 'Invoke-WebRequest -Uri "https://www.nuget.org/api/v2/package/Microsoft.Direct3D.WARP/1.0.16.1" -OutFile ".\warp.zip"' + - 'Expand-Archive -Path "warp.zip" -DestinationPath ".\warp"' - 'Invoke-WebRequest -Uri "https://github.com/microsoft/DirectXShaderCompiler/releases/download/v1.8.2502/dxc_2025_02_20.zip" -OutFile ".\dxc.zip"' - 'Expand-Archive -Path "dxc.zip" -DestinationPath ".\dxc"' - '$Env:PATH += ";" + (Convert-Path ".\dxc\bin\x64")' @@ -51,3 +55,5 @@ test-win-64-dxc: when: always paths: - artifacts + exclude: + - artifacts/**/d3d10warp.dll diff --git a/tests/driver.c b/tests/driver.c index 5511edf9d..a8ee1245b 100644 --- a/tests/driver.c +++ b/tests/driver.c @@ -133,7 +133,7 @@ out: static bool run_tests_for_directory(const char *commit_dir) { - char cmdline[1024], log_filename[1024], list_filename[1024], line[1024]; + char cmdline[1024], log_filename[1024], list_filename[1024], line[1024], dest_filename[1024]; unsigned int success_count = 0, test_count = 0, timeout_count = 0; const char *test_arch = getenv("TEST_ARCH"); enum program_result result; @@ -146,6 +146,25 @@ static bool run_tests_for_directory(const char *commit_dir) printf("\e[0Ksection_start:%I64d:commit_%s\r\e[0KBuilding commit %s\n", (uint64_t)time(NULL), commit_dir, commit_dir); + if (strcmp(test_arch, "64") == 0) + { + sprintf(dest_filename, "artifacts\\%s\\tests\\d3d10warp.dll", commit_dir); + if (!CopyFileA(".\\warp\\build\\native\\bin\\x64\\d3d10warp.dll", dest_filename, FALSE)) + { + fprintf(stderr, "Cannot copy d3d10warp.dll, last error %ld.\n", GetLastError()); + ret = false; + } + } + else + { + sprintf(dest_filename, "artifacts\\%s\\tests\\d3d10warp.dll", commit_dir); + if (!CopyFileA(".\\warp\\build\\native\\bin\\win32\\d3d10warp.dll", dest_filename, FALSE)) + { + fprintf(stderr, "Cannot copy d3d10warp.dll, last error %ld.\n", GetLastError()); + ret = false; + } + } + sprintf(list_filename, "artifacts/%s/tests/shader_tests.txt", commit_dir); list_file = fopen(list_filename, "r"); diff --git a/tests/hlsl/sm1-centroid.shader_test b/tests/hlsl/sm1-centroid.shader_test index ecd9b2d88..890a2746e 100644 --- a/tests/hlsl/sm1-centroid.shader_test +++ b/tests/hlsl/sm1-centroid.shader_test @@ -45,9 +45,8 @@ probe (1, 478) f32(0.5, 0.5, 0.5, 0.5) probe (638, 479) f32(0.0, 0.0, 0.0, 0.0) % Centroid interpolation. -% The WARP driver doesn't seem to support centroid interpolation for SM < 4. [pixel shader] -static const float2 sample_pos = {-0.001f, 0.000f}; +static const float2 sample_pos = {0.375f, -0.125f}; float4 main(centroid float2 t : TEXCOORD0) : SV_Target { @@ -56,20 +55,19 @@ float4 main(centroid float2 t : TEXCOORD0) : SV_Target float2 diff = t.xy - ref; float2 expected = first_col ? sample_pos : 0.0f; float2 err = abs(diff - expected); - return floor(1000.0f * float4(err, 0.0f, 0.0f)); + return floor(500.0f * float4(err, 0.0f, 0.0f)); } [test] clear rtv 0 1.0 1.0 1.0 1.0 draw triangle list 3 -todo probe (1, 1) f32(0.5, 0.5, 0.5, 0.5) +probe (1, 1) f32(0.5, 0.5, 0.5, 0.5) probe (638, 1) f32(0.0, 0.0, 0.0, 0.0) -todo probe (1, 478) f32(0.5, 0.5, 0.5, 0.5) +probe (1, 478) f32(0.5, 0.5, 0.5, 0.5) probe (638, 479) f32(0.0, 0.0, 0.0, 0.0) -% The WARP driver doesn't seem to support centroid interpolation for SM < 4. [pixel shader] -static const float2 sample_pos = {-0.001f, 0.000f}; +static const float2 sample_pos = {0.375f, -0.125f}; float4 main(float2 t : TEXCOORD0_centRoid) : SV_Target { @@ -78,20 +76,19 @@ float4 main(float2 t : TEXCOORD0_centRoid) : SV_Target float2 diff = t.xy - ref; float2 expected = first_col ? sample_pos : 0.0f; float2 err = abs(diff - expected); - return floor(1000.0f * float4(err, 0.0f, 0.0f)); + return floor(500.0f * float4(err, 0.0f, 0.0f)); } [test] clear rtv 0 1.0 1.0 1.0 1.0 draw triangle list 3 -todo probe (1, 1) f32(0.5, 0.5, 0.5, 0.5) +probe (1, 1) f32(0.5, 0.5, 0.5, 0.5) probe (638, 1) f32(0.0, 0.0, 0.0, 0.0) -todo probe (1, 478) f32(0.5, 0.5, 0.5, 0.5) +probe (1, 478) f32(0.5, 0.5, 0.5, 0.5) probe (638, 479) f32(0.0, 0.0, 0.0, 0.0) -% The WARP driver doesn't seem to support centroid interpolation for SM < 4. [pixel shader] -static const float2 sample_pos = {-0.001f, 0.000f}; +static const float2 sample_pos = {0.375f, -0.125f}; struct ps_in { @@ -105,21 +102,20 @@ float4 main(ps_in data) : SV_Target float2 diff = data.t.xy - ref; float2 expected = first_col ? sample_pos : 0.0f; float2 err = abs(diff - expected); - return floor(1000.0f * float4(err, 0.0f, 0.0f)); + return floor(500.0f * float4(err, 0.0f, 0.0f)); } [test] clear rtv 0 1.0 1.0 1.0 1.0 draw triangle list 3 -todo probe (1, 1) f32(0.5, 0.5, 0.5, 0.5) +probe (1, 1) f32(0.5, 0.5, 0.5, 0.5) probe (638, 1) f32(0.0, 0.0, 0.0, 0.0) -todo probe (1, 478) f32(0.5, 0.5, 0.5, 0.5) +probe (1, 478) f32(0.5, 0.5, 0.5, 0.5) probe (638, 479) f32(0.0, 0.0, 0.0, 0.0) % The "_centroid" semantic modifier can be specified together with the "centroid" prefix attribute. -% The WARP driver doesn't seem to support centroid interpolation for SM < 4. [pixel shader] -static const float2 sample_pos = {-0.001f, 0.000f}; +static const float2 sample_pos = {0.375f, -0.125f}; float4 main(centroid float2 t : TEXCOORD0_centroid) : SV_Target { @@ -128,15 +124,15 @@ float4 main(centroid float2 t : TEXCOORD0_centroid) : SV_Target float2 diff = t.xy - ref; float2 expected = first_col ? sample_pos : 0.0f; float2 err = abs(diff - expected); - return floor(1000.0f * float4(err, 0.0f, 0.0f)); + return floor(500.0f * float4(err, 0.0f, 0.0f)); } [test] clear rtv 0 1.0 1.0 1.0 1.0 draw triangle list 3 -todo probe (1, 1) f32(0.5, 0.5, 0.5, 0.5) +probe (1, 1) f32(0.5, 0.5, 0.5, 0.5) probe (638, 1) f32(0.0, 0.0, 0.0, 0.0) -todo probe (1, 478) f32(0.5, 0.5, 0.5, 0.5) +probe (1, 478) f32(0.5, 0.5, 0.5, 0.5) probe (638, 479) f32(0.0, 0.0, 0.0, 0.0) % The semantic name is this case is "TEXCOORD_centroid", which is not valid for SM < 4.