From 839e14dc1e83e4d30a18cb8bd5fb3f5b6361b367 Mon Sep 17 00:00:00 2001 From: Emma <47298336+zzEmmazz@users.noreply.github.com> Date: Sun, 22 Nov 2026 20:34:51 +0200 Subject: Tests: seven host comparisons take their hardware reference on the layer's own adapter d3d12_copy_xfmt, d3d12_depth_resolve, d3d12_fence_events, d3d12_indirect_zero, d3d12_node_mask, d3d12_query_rules and d3d12_resource_desc created their hardware reference with D3D12CreateDevice(nullptr), the default adapter, and did not read LEONIDA_HOST_ADAPTER. On a PC with two GPUs the layer then ran on one GPU and the host driver on the other. runtime/test/host_adapter.h picks the adapter by the rule d3d12_copy_compare.h already follows for d3d12_vulkan_device: the adapter LEONIDA_HOST_ADAPTER names (a name that matches none fails the run; "warp" leaves the hardware pass out), else the adapter behind the Vulkan device (deviceLUID), else the default adapter. The tests print the adapter's name instead of "the default adapter". Measured on a Ryzen 7 9700X iGPU (AMD 32.0.21042.62) next to an RTX 3070 (NVIDIA 610.74, the default adapter): d3d12_depth_resolve with the layer on the Radeon set aside nine resolves as host quirks before and after, but four of them were NVIDIA's ("D24S8 stencil as X24_G8"); against the Radeon's own driver the four are D24S8 depth MIN/MAX. The other six tests print the same results against either adapter. Co-Authored-By: Claude Fable 5.2 --- runtime/test/d3d12_query_rules_test.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'runtime/test/d3d12_query_rules_test.cpp') diff --git a/runtime/test/d3d12_query_rules_test.cpp b/runtime/test/d3d12_query_rules_test.cpp index f50536b6f..6d51ab704 100644 --- a/runtime/test/d3d12_query_rules_test.cpp +++ b/runtime/test/d3d12_query_rules_test.cpp @@ -1,9 +1,10 @@ -// Query heaps and query calls on the Vulkan-backed device against Windows D3D12 (the default adapter and WARP): +// Query heaps and query calls on the Vulkan-backed device against Windows D3D12 (the layer's own adapter and WARP): // CreateQueryHeap results by type, count and node mask, Close() results of lists that use queries on each list type, // and timestamps resolved on direct, compute and copy queues (pipeline statistics heaps are left out: the test // device does not enable pipelineStatisticsQuery). No game data or shaders. Run explicitly (needs Vulkan // hardware); LEONIDA_VK_VALIDATION=1 checks Vulkan usage. #include "vk_test_device.h" +#include "host_adapter.h" #include "host_wine.h" #include "../shims/d3d12_com.h" #include @@ -289,14 +290,15 @@ int main() { if (hostwine::host_is_wine()) break; Ref adapter; Ref host; - if (warp && FAILED(factory->EnumWarpAdapter(IID_PPV_ARGS(&adapter.p)))) continue; + std::string adapter_name; + if (!hostadapter::reference(factory.p, vk, warp, &adapter.p, adapter_name)) continue; if (FAILED(D3D12CreateDevice(adapter.p, D3D_FEATURE_LEVEL_11_0, IID_PPV_ARGS(&host.p)))) continue; const auto a = lines(mine), b = lines(all_cases(host.p)); for (size_t i = 0; i < a.size() || i < b.size(); ++i) { const std::string x = i < a.size() ? a[i] : "", y = i < b.size() ? b[i] : ""; if (x != y) { ++differ; - std::printf("[%s] ours: %s | host: %s\n", warp ? "WARP" : "GPU", x.c_str(), y.c_str()); + std::printf("[%s] ours: %s | host: %s\n", adapter_name.c_str(), x.c_str(), y.c_str()); } else if (!warp) { std::printf("same: %s\n", x.c_str()); } -- cgit v1.2.3