Files
mandy/runtime/test/host_wine.h
lloyd 806ee523c4 tests: D3D12 host comparisons skip under Wine (TEST-105 follow-up)
The host-comparison tests added since #869 create their host devices with
D3D12CreateDevice themselves, so copycmp::try_create_host's Wine check never
reached them. Under Wine the reference is vkd3d, not Microsoft's runtime,
and they failed on a real GPU for that reason alone.

runtime/test/host_wine.h has the same check (ntdll's wine_get_version) for
them. Under Wine:
- d3d12_fence_events, d3d12_query_rules: the layer's own expectations
  still run; only the host references are skipped.
- d3d12_depth_resolve: the layer is still checked against the clears; a
  host reference is no longer required.
- d3d12_resource_desc, d3d12_node_mask, d3d12_copy_xfmt,
  d3d12_typeless_rtv, d3d12_predicated_copy: every case compares with the
  host (or WARP), so they exit 77, which ctest already reads as a skip.
Windows runs them all as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 12:25:32 +02:00

24 lines
1011 B
C++

// Whether the host D3D12 these tests compare against is Wine's (vkd3d) rather than Microsoft's runtime. The host
// comparisons take Microsoft's d3d12.dll and WARP as the reference: under Wine, vkd3d answers differently in ways
// that aren't the layer's (it accepts copies Microsoft refuses, reports other heap flags and alignments, keeps no
// separate WARP), so such a test skips its host comparisons there and says why. Windows runs them all. The same
// check as copycmp::host_is_wine (d3d12_copy_compare.h) and loader_test, for tests that create their host
// devices themselves.
#pragma once
#include <windows.h>
#include <cstdio>
namespace hostwine {
inline bool host_is_wine() {
static const bool wine = GetProcAddress(GetModuleHandleW(L"ntdll.dll"), "wine_get_version") != nullptr;
static bool said = false;
if (wine && !said) std::printf("host D3D12 is Wine's, not Microsoft's: comparisons with the host are skipped\n");
said = true;
return wine;
}
} // namespace hostwine