diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index b394480..08c659e 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -36,3 +36,21 @@ jobs: accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} command: pages deploy cts_report --project-name=vulkan-driver-cts-report gitHubToken: ${{ secrets.GITHUB_TOKEN }} + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + targets: x86_64-unknown-linux-gnu,wasm32-unknown-unknown + + - uses: Swatinem/rust-cache@v2 + with: + cache-all-crates: "true" + cache-on-failure: "false" + + - name: Install deqp-runner + run: cargo install deqp-runner + + - name: Run multithreaded master Vulkan CTS + if: ${{ !cancelled() && steps.install.conclusion == 'success' }} + run: zig build test-conformance-multithreaded-soft diff --git a/.gitignore b/.gitignore index 6762740..92930e5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .cache/ .zig-cache/ zig-out/ +cts/ cts_report/ scripts/__pycache__/ *.o diff --git a/build.zig b/build.zig index 513043a..107d332 100644 --- a/build.zig +++ b/build.zig @@ -105,6 +105,8 @@ pub fn build(b: *std.Build) !void { (try addCTS(b, target, &impl, lib, false)).dependOn(&lib_install.step); (try addCTS(b, target, &impl, lib, true)).dependOn(&lib_install.step); + + (try addMultithreadedCTS(b, target, &impl, lib)).dependOn(&lib_install.step); } const autodoc_test = b.addObject(.{ @@ -172,7 +174,7 @@ fn addCTestRunner(b: *std.Build, impl: *const ImplementationDesc, exe: *std.Buil } fn addCTS(b: *std.Build, target: std.Build.ResolvedTarget, impl: *const ImplementationDesc, impl_lib: *std.Build.Step.Compile, comptime gdb: bool) !*std.Build.Step { - const cts = b.dependency("cts_bin", .{}); + const cts = b.lazyDependency("cts_bin", .{}) orelse return error.CouldNotFetchCTS; const cts_exe_name = cts.path(b.fmt("deqp-vk-{s}", .{ switch (if (target.query.os_tag) |tag| tag else builtin.target.os.tag) { @@ -231,3 +233,36 @@ fn addCTS(b: *std.Build, target: std.Build.ResolvedTarget, impl: *const Implemen return &run.step; } + +fn addMultithreadedCTS(b: *std.Build, target: std.Build.ResolvedTarget, impl: *const ImplementationDesc, impl_lib: *std.Build.Step.Compile) !*std.Build.Step { + const cts = b.lazyDependency("cts_bin", .{}) orelse return error.CouldNotFetchCTS; + + const cts_exe_name = cts.path(b.fmt("deqp-vk-{s}", .{ + switch (if (target.query.os_tag) |tag| tag else builtin.target.os.tag) { + .linux => "linux.x86_64", + else => unreachable, + }, + })); + + const mustpass_path = try cts.path("mustpass/master/vk-default.txt").getPath3(b, null).toString(b.allocator); + const cts_exe_path = try cts_exe_name.getPath3(b, null).toString(b.allocator); + + const run = b.addSystemCommand(&[_][]const u8{"deqp-runner"}); + run.step.dependOn(&impl_lib.step); + + run.addArg("run"); + run.addArg("--deqp"); + run.addArg(cts_exe_path); + run.addArg("--caselist"); + run.addArg(mustpass_path); + run.addArg("--output"); + run.addArg("./cts"); + run.addArg("--"); + run.addArg(b.fmt("--deqp-archive-dir={s}", .{try cts.path("").getPath3(b, null).toString(b.allocator)})); + run.addArg(b.fmt("--deqp-vk-library-path={s}", .{b.getInstallPath(.lib, impl_lib.out_lib_filename)})); + + const run_step = b.step(b.fmt("test-conformance-multithreaded-{s}", .{impl.name}), b.fmt("Run Vulkan conformance tests in a multithreaded environment for libvulkan_{s}", .{impl.name})); + run_step.dependOn(&run.step); + + return &run.step; +} diff --git a/build.zig.zon b/build.zig.zon index 498fc8a..dc8ab1b 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -26,8 +26,9 @@ .hash = "zdt-0.8.1-xr0_vAxUDwCJRDh9pcAS_mdZBIsvcGTtN-K8JJSWY4I6", }, .cts_bin = .{ - .url = "git+https://github.com/Kbz-8/Vulkan-CTS-bin#964760c8348ca61c1c63d951821d94016ed0c99a", - .hash = "N-V-__8AAIz9twSI7YE7QOGYizFRF14Kp9K-JLkYAsr3aH24", + .url = "git+https://github.com/Kbz-8/Vulkan-CTS-bin#606ee47675ac1ba7a260983f020d6460efe05d2c", + .hash = "N-V-__8AAHqjQhpVdUurt2jQc9gRHwT3_pugIvimGEu8iyrQ", + .lazy = true, }, .cpuinfo = .{ .url = "git+https://github.com/Kbz-8/cpuinfo#4883954cfcec3f6c9ca9c4aaddfc26107e08726f",