Skip to content

Run Windows games on Apple Silicon — free, open source, with an open compatibility database that tells you what actually works.

D3DMetal timestamp shim: lay the real d3d12 out as apd12.dll with its export name patched, so Wine 11 loads it

Gauthier Piarrette0b8dc0965a70
diff --git a/Scripts/build-tsshim.sh b/Scripts/build-tsshim.sh
index 3087a56..731f61e 100755
--- a/Scripts/build-tsshim.sh
+++ b/Scripts/build-tsshim.sh
@@ -2,7 +2,7 @@
# Build the D3DMetal timestamp shim (spike/tsshim) into a renderer overlay tarball for the engine
# manifest: renderers/d3dmetal-tsshim/wine/x86_64-windows/d3d12.dll, stamped as a Wine builtin so
# WINEDLLPATH_PREPEND picks it up. At launch, Highball lays the real D3DMetal d3d12.dll beside it
-# as d3d12_d3dmetal.dll (see InstalledEngine.timestampShimDir). Needs mingw-w64 (brew).
+# as apd12.dll, export name patched to match (see InstalledEngine.timestampShimDir). Needs mingw-w64 (brew).
# Usage: Scripts/build-tsshim.sh [tag] -> dist/d3dmetal-tsshim-<tag>.tar.xz, prints sha256 and size
set -euo pipefail
cd "$(dirname "$0")/.."
diff --git a/Sources/HighballKit/Bottle.swift b/Sources/HighballKit/Bottle.swift
index ee2518d..3df7d50 100644
--- a/Sources/HighballKit/Bottle.swift
+++ b/Sources/HighballKit/Bottle.swift
@@ -50,9 +50,9 @@ public enum Renderer: String, Codable, CaseIterable, Sendable {
var overlays = dir.appending(path: "wine").path
if let shim = engine.timestampShimDir(d3dmetal: dir) {
overlays = shim.appending(path: "wine").path + ":" + overlays
- // The shim loads D3DMetal's d3d12.dll by this path: Wine resolves builtin modules by base
- // name, so under its own name the real one would come back as the shim.
- env["HB_D3D12_REAL"] = "Z:" + shim.appending(path: "wine/x86_64-windows/d3d12_d3dmetal.dll").path.replacingOccurrences(of: "/", with: "\\")
+ // The shim loads D3DMetal's d3d12.dll by this path: under its own name the real one
+ // would come back as the shim (see InstalledEngine.timestampShimDir for the layout).
+ env["HB_D3D12_REAL"] = "Z:" + shim.appending(path: "wine/x86_64-windows/\(InstalledEngine.shimRealName).dll").path.replacingOccurrences(of: "/", with: "\\")
}
env["WINEDLLPATH_PREPEND"] = Self.withD9VK(overlays, engine: engine)
env["CX_D3DMETALPATH"] = external
diff --git a/Sources/HighballKit/EngineStore.swift b/Sources/HighballKit/EngineStore.swift
index 1d5f13d..30db66d 100644
--- a/Sources/HighballKit/EngineStore.swift
+++ b/Sources/HighballKit/EngineStore.swift
@@ -389,36 +389,50 @@ public struct InstalledEngine: Sendable {
}
/// The D3DMetal timestamp shim overlay, laid out for launch, or nil when the engine has none.
- /// Wine resolves builtin modules by base name, so the shim's d3d12.dll cannot load the real one
- /// under its own name: the real PE is hard-linked beside the shim as d3d12_d3dmetal.dll and its
- /// Mach-O half symlinked as x86_64-unix/d3d12_d3dmetal.so, both pointing into the licensed
- /// D3DMetal overlay, so nothing of Apple's is copied anywhere new. Idempotent, and redone when
- /// the D3DMetal files change (an engine update replaces the inode).
+ /// The shim's d3d12.dll cannot load the real one under its own name, so the real PE is laid out
+ /// beside the shim as apd12.dll ("Apple's d3d12"), with its Mach-O half symlinked as
+ /// x86_64-unix/apd12.so into the licensed D3DMetal overlay. The copy differs from Apple's file
+ /// in nine bytes: its internal export name, because Wine 10 tells builtin modules apart by file
+ /// name but CrossOver's Wine 11 by that internal name, and with it untouched the copy came back
+ /// as the shim itself (no DirectX 12 device at all, 2026-09-08). Idempotent, and redone when the
+ /// D3DMetal files change (an engine update replaces them).
public func timestampShimDir(d3dmetal: URL) -> URL? {
guard let shim = rendererDir("d3dmetal-tsshim") else { return nil }
let fm = FileManager.default
let realPE = d3dmetal.appending(path: "wine/x86_64-windows/d3d12.dll")
let realSO = d3dmetal.appending(path: "wine/x86_64-unix/d3d12.so")
- let pe = shim.appending(path: "wine/x86_64-windows/d3d12_d3dmetal.dll")
- let so = shim.appending(path: "wine/x86_64-unix/d3d12_d3dmetal.so")
+ let pe = shim.appending(path: "wine/x86_64-windows/\(Self.shimRealName).dll")
+ let so = shim.appending(path: "wine/x86_64-unix/\(Self.shimRealName).so")
do {
- let realID = try fm.attributesOfItem(atPath: realPE.path)[.systemFileNumber] as? Int
- let peID = (try? fm.attributesOfItem(atPath: pe.path))?[.systemFileNumber] as? Int
- if peID == nil || peID != realID {
+ let realAttrs = try fm.attributesOfItem(atPath: realPE.path)
+ let current = (try? fm.attributesOfItem(atPath: pe.path))
+ let fresh = current != nil
+ && current?[.size] as? UInt64 == realAttrs[.size] as? UInt64
+ && ((current?[.modificationDate] as? Date) ?? .distantPast) >= ((realAttrs[.modificationDate] as? Date) ?? .distantPast)
+ && (try? PEExportName.read(Data(contentsOf: pe))) == "\(Self.shimRealName).dll"
+ if !fresh {
try? fm.removeItem(at: pe)
- do { try fm.linkItem(at: realPE, to: pe) } catch { try fm.copyItem(at: realPE, to: pe) }
+ try PEExportName.patched(Data(contentsOf: realPE), to: "\(Self.shimRealName).dll").write(to: pe)
}
try fm.createDirectory(at: so.deletingLastPathComponent(), withIntermediateDirectories: true)
if (try? fm.destinationOfSymbolicLink(atPath: so.path)) != realSO.path {
try? fm.removeItem(at: so)
try fm.createSymbolicLink(at: so, withDestinationURL: realSO)
}
+ // The 0.9.0 layout (a hard link under this name) is the one that collided.
+ for stale in ["wine/x86_64-windows/d3d12_d3dmetal.dll", "wine/x86_64-unix/d3d12_d3dmetal.so"] {
+ try? fm.removeItem(at: shim.appending(path: stale))
+ }
return shim
} catch {
return nil
}
}
+ /// Base name of the real D3DMetal d3d12 laid out beside the shim: a name of the same length as
+ /// "d3d12" so the export-name patch fits, and distinct enough to never match a DLL a game ships.
+ public static let shimRealName = "apd12"
+
public func wineVersion() throws -> String {
try Shell.capture(wineBinary.path, ["--version"], env: baseEnvironment()).trimmingCharacters(in: .whitespacesAndNewlines)
}
diff --git a/Sources/HighballKit/PEExportName.swift b/Sources/HighballKit/PEExportName.swift
new file mode 100644
index 0000000..6e50c13
--- /dev/null
+++ b/Sources/HighballKit/PEExportName.swift
@@ -0,0 +1,72 @@
+import Foundation
+
+/// The name a PE (a Windows DLL) gives itself in its export directory. Wine identifies a builtin
+/// module by this name on some builds (CrossOver's Wine 11) and by the file name on others
+/// (Wine 10), so a second copy of a builtin DLL laid out under another file name still collides
+/// with the first unless this internal name changes too (D3DMetal's d3d12.dll behind the
+/// timestamp shim: with the internal name untouched, the copy came back as the shim itself and
+/// no DirectX 12 device was ever created, 2026-09-08).
+public enum PEExportName {
+ public enum Failure: Error, Equatable { case notPE, noExports, nameTooLong(max: Int) }
+
+ /// The export directory's name string, or nil when the file is not a PE with exports.
+ public static func read(_ d: Data) -> String? {
+ guard let o = nameOffset(in: d) else { return nil }
+ var end = o
+ while end < d.count, d[end] != 0 { end += 1 }
+ return String(data: d[o..<end], encoding: .ascii)
+ }
+
+ /// The same PE with its export name replaced in place. The new name must fit in the old one's
+ /// bytes (the string is padded with zeros): nothing else in the file moves, so the file stays
+ /// byte-for-byte the same DLL otherwise.
+ public static func patched(_ d: Data, to name: String) throws -> Data {
+ guard let o = nameOffset(in: d) else { throw isPE(d) ? Failure.noExports : Failure.notPE }
+ var end = o
+ while end < d.count, d[end] != 0 { end += 1 }
+ let room = end - o
+ let bytes = Array(name.utf8)
+ guard bytes.count <= room else { throw Failure.nameTooLong(max: room) }
+ var out = d
+ out.replaceSubrange(o..<end, with: bytes + [UInt8](repeating: 0, count: room - bytes.count))
+ return out
+ }
+
+ // MARK: PE walking (PE32 and PE32+)
+
+ private static func isPE(_ d: Data) -> Bool {
+ guard d.count > 0x40, d[0] == 0x4D, d[1] == 0x5A else { return false }
+ let pe = Int(u32(d, 0x3c))
+ return pe + 4 <= d.count && d[pe] == 0x50 && d[pe + 1] == 0x45 && d[pe + 2] == 0 && d[pe + 3] == 0
+ }
+
+ /// File offset of the export directory's name string.
+ static func nameOffset(in d: Data) -> Int? {
+ guard isPE(d) else { return nil }
+ let pe = Int(u32(d, 0x3c))
+ let sections = Int(u16(d, pe + 6)), optSize = Int(u16(d, pe + 20)), opt = pe + 24
+ guard optSize >= 96, opt + optSize <= d.count else { return nil }
+ let magic = u16(d, opt)
+ let ddOffset = opt + (magic == 0x20b ? 112 : 96) // data directories: PE32+ vs PE32
+ guard ddOffset + 8 <= d.count else { return nil }
+ let exportRVA = Int(u32(d, ddOffset)), exportSize = Int(u32(d, ddOffset + 4))
+ guard exportRVA > 0, exportSize > 0 else { return nil }
+ var secs: [(va: Int, size: Int, raw: Int)] = []
+ for i in 0..<sections {
+ let s = opt + optSize + 40 * i
+ guard s + 40 <= d.count else { return nil }
+ secs.append((va: Int(u32(d, s + 12)), size: max(Int(u32(d, s + 8)), Int(u32(d, s + 16))), raw: Int(u32(d, s + 20))))
+ }
+ func off(_ rva: Int) -> Int? {
+ for s in secs where rva >= s.va && rva < s.va + max(s.size, 1) { return rva - s.va + s.raw }
+ return nil
+ }
+ guard let dir = off(exportRVA), dir + 40 <= d.count, let name = off(Int(u32(d, dir + 12))), name < d.count else { return nil }
+ return name
+ }
+
+ private static func u16(_ d: Data, _ o: Int) -> UInt16 { o + 2 <= d.count ? UInt16(d[o]) | UInt16(d[o + 1]) << 8 : 0 }
+ private static func u32(_ d: Data, _ o: Int) -> UInt32 {
+ o + 4 <= d.count ? UInt32(d[o]) | UInt32(d[o + 1]) << 8 | UInt32(d[o + 2]) << 16 | UInt32(d[o + 3]) << 24 : 0
+ }
+}
diff --git a/Tests/HighballKitTests/PEExportNameTests.swift b/Tests/HighballKitTests/PEExportNameTests.swift
new file mode 100644
index 0000000..1db5aa3
--- /dev/null
+++ b/Tests/HighballKitTests/PEExportNameTests.swift
@@ -0,0 +1,77 @@
+import XCTest
+@testable import HighballKit
+
+/// A minimal PE32+ with one section holding an export directory whose name is `exportName`.
+/// Enough of a DLL for the parts of Highball that read PE headers.
+enum SyntheticPE {
+ static func make(exportName: String, extraNameRoom: Int = 0) -> Data {
+ var d = Data(count: 0x600)
+ func put16(_ v: UInt16, _ o: Int) { d[o] = UInt8(v & 0xff); d[o + 1] = UInt8(v >> 8) }
+ func put32(_ v: UInt32, _ o: Int) { for i in 0..<4 { d[o + i] = UInt8((v >> (8 * i)) & 0xff) } }
+ d[0] = 0x4D; d[1] = 0x5A // MZ
+ put32(0x40, 0x3c) // e_lfanew
+ d[0x40] = 0x50; d[0x41] = 0x45 // PE\0\0
+ put16(0x8664, 0x44) // machine x64
+ put16(1, 0x46) // one section
+ put16(240, 0x54) // optional header size (PE32+)
+ let opt = 0x58
+ put16(0x20b, opt) // PE32+ magic
+ put32(0x1000, opt + 112) // data directory 0: export table RVA
+ put32(0x100, opt + 116) // size
+ let sec = opt + 240
+ d.replaceSubrange(sec..<sec + 5, with: Array(".edata".utf8.prefix(5)))
+ put32(0x200, sec + 8) // virtual size
+ put32(0x1000, sec + 12) // virtual address
+ put32(0x200, sec + 16) // raw size
+ put32(0x400, sec + 20) // raw pointer
+ let dir = 0x400
+ put32(0x1000 + 40, dir + 12) // export directory Name RVA: right after the 40-byte directory
+ let name = Array(exportName.utf8)
+ d.replaceSubrange(dir + 40..<dir + 40 + name.count, with: name)
+ // extraNameRoom: the zero padding after the name is not "room" unless the original name was longer
+ _ = extraNameRoom
+ return d
+ }
+}
+
+final class PEExportNameTests: XCTestCase {
+ func testReadsTheExportName() {
+ XCTAssertEqual(PEExportName.read(SyntheticPE.make(exportName: "d3d12.dll")), "d3d12.dll")
+ XCTAssertNil(PEExportName.read(Data("not a pe".utf8)))
+ XCTAssertNil(PEExportName.read(Data()))
+ }
+
+ func testPatchesInPlaceWhenTheNewNameFits() throws {
+ let original = SyntheticPE.make(exportName: "d3d12.dll")
+ let patched = try PEExportName.patched(original, to: "apd12.dll")
+ XCTAssertEqual(PEExportName.read(patched), "apd12.dll")
+ XCTAssertEqual(patched.count, original.count, "nothing moves")
+ let diff = zip(original, patched).enumerated().filter { $0.element.0 != $0.element.1 }.map(\.offset)
+ XCTAssertEqual(diff.count, 2, "only the bytes of the name that differ change (d3d12 -> apd12): \(diff)")
+ let shorter = try PEExportName.patched(original, to: "ab.dll")
+ XCTAssertEqual(PEExportName.read(shorter), "ab.dll", "a shorter name is zero padded")
+ }
+
+ func testRefusesALongerNameAndNonPEs() {
+ XCTAssertThrowsError(try PEExportName.patched(SyntheticPE.make(exportName: "d3d12.dll"), to: "d3d12_d3dmetal.dll")) {
+ XCTAssertEqual($0 as? PEExportName.Failure, .nameTooLong(max: 9))
+ }
+ XCTAssertThrowsError(try PEExportName.patched(Data("MZ nope".utf8), to: "x.dll")) {
+ XCTAssertEqual($0 as? PEExportName.Failure, .notPE)
+ }
+ }
+
+ /// The real thing, when this Mac has a licensed D3DMetal: the file Highball lays out must still
+ /// be a PE Wine will take, so the patch is checked on Apple's own bytes.
+ func testPatchesTheRealD3DMetalWhenPresent() throws {
+ let home = FileManager.default.homeDirectoryForCurrentUser
+ let engines = home.appending(path: "Library/Application Support/Highball/engines")
+ guard let ids = try? FileManager.default.contentsOfDirectory(atPath: engines.path) else { throw XCTSkip("no engines here") }
+ let real = ids.map { engines.appending(path: "\($0)/frameworks/renderer/d3dmetal/wine/x86_64-windows/d3d12.dll") }
+ .first { FileManager.default.fileExists(atPath: $0.path) }
+ guard let real else { throw XCTSkip("no D3DMetal on this Mac") }
+ let d = try Data(contentsOf: real)
+ XCTAssertEqual(PEExportName.read(d), "d3d12.dll")
+ XCTAssertEqual(PEExportName.read(try PEExportName.patched(d, to: "apd12.dll")), "apd12.dll")
+ }
+}
diff --git a/Tests/HighballKitTests/RendererAvailabilityTests.swift b/Tests/HighballKitTests/RendererAvailabilityTests.swift
index 2bb1901..b7a3913 100644
--- a/Tests/HighballKitTests/RendererAvailabilityTests.swift
+++ b/Tests/HighballKitTests/RendererAvailabilityTests.swift
@@ -111,22 +111,32 @@ final class RendererAvailabilityTests: XCTestCase {
let real = e.root.appending(path: "frameworks/renderer/d3dmetal/wine")
try fm.createDirectory(at: real.appending(path: "x86_64-windows"), withIntermediateDirectories: true)
try fm.createDirectory(at: real.appending(path: "x86_64-unix"), withIntermediateDirectories: true)
- try Data("pe".utf8).write(to: real.appending(path: "x86_64-windows/d3d12.dll"))
+ try SyntheticPE.make(exportName: "d3d12.dll").write(to: real.appending(path: "x86_64-windows/d3d12.dll"))
try Data("so".utf8).write(to: real.appending(path: "x86_64-unix/d3d12.so"))
let shim = e.root.appending(path: "renderers/d3dmetal-tsshim/wine")
try fm.createDirectory(at: shim.appending(path: "x86_64-windows"), withIntermediateDirectories: true)
+ try fm.createDirectory(at: shim.appending(path: "x86_64-unix"), withIntermediateDirectories: true)
try Data("shim".utf8).write(to: shim.appending(path: "x86_64-windows/d3d12.dll"))
+ // The 0.9.0 layout, which Wine 11 resolved back to the shim: it must go.
+ try Data("old".utf8).write(to: shim.appending(path: "x86_64-windows/d3d12_d3dmetal.dll"))
+ try fm.createSymbolicLink(at: shim.appending(path: "x86_64-unix/d3d12_d3dmetal.so"), withDestinationURL: real.appending(path: "x86_64-unix/d3d12.so"))
let env = try bottle(renderer: .d3dmetal).environment(engine: e)
XCTAssertTrue(env["WINEDLLPATH_PREPEND"]?.hasPrefix(shim.path) == true, "the shim overlay comes first: \(env["WINEDLLPATH_PREPEND"] ?? "")")
XCTAssertTrue(env["WINEDLLPATH_PREPEND"]?.contains("/d3dmetal/wine") == true, "D3DMetal itself stays on the path")
- XCTAssertEqual(try String(contentsOf: shim.appending(path: "x86_64-windows/d3d12_d3dmetal.dll"), encoding: .utf8), "pe",
- "the real PE sits beside the shim under a name of its own")
- XCTAssertEqual(try fm.destinationOfSymbolicLink(atPath: shim.appending(path: "x86_64-unix/d3d12_d3dmetal.so").path),
+ let copy = shim.appending(path: "x86_64-windows/apd12.dll")
+ XCTAssertEqual(PEExportName.read(try Data(contentsOf: copy)), "apd12.dll",
+ "the real PE sits beside the shim under a name of its own, inside and out")
+ XCTAssertEqual(try Data(contentsOf: copy).count, SyntheticPE.make(exportName: "d3d12.dll").count, "same bytes otherwise")
+ XCTAssertEqual(try fm.destinationOfSymbolicLink(atPath: shim.appending(path: "x86_64-unix/apd12.so").path),
real.appending(path: "x86_64-unix/d3d12.so").path, "and its Mach-O half is a link, not a copy")
- XCTAssertEqual(env["HB_D3D12_REAL"], "Z:" + shim.path.replacingOccurrences(of: "/", with: "\\") + "\\x86_64-windows\\d3d12_d3dmetal.dll",
+ XCTAssertEqual(env["HB_D3D12_REAL"], "Z:" + shim.path.replacingOccurrences(of: "/", with: "\\") + "\\x86_64-windows\\apd12.dll",
"the shim gets the real one's Windows path")
+ XCTAssertFalse(fm.fileExists(atPath: shim.appending(path: "x86_64-windows/d3d12_d3dmetal.dll").path), "the colliding layout is removed")
+ XCTAssertNil(try? fm.destinationOfSymbolicLink(atPath: shim.appending(path: "x86_64-unix/d3d12_d3dmetal.so").path))
+ let stamp = try fm.attributesOfItem(atPath: copy.path)[.modificationDate] as? Date
_ = try bottle(renderer: .d3dmetal).environment(engine: e) // a second launch changes nothing
+ XCTAssertEqual(try fm.attributesOfItem(atPath: copy.path)[.modificationDate] as? Date, stamp, "the copy is not rewritten every launch")
let plain = try engine(accepted: true)
let env2 = try bottle(renderer: .d3dmetal).environment(engine: plain)
diff --git a/spike/tsshim/d3d12.c b/spike/tsshim/d3d12.c
index 8a53ba8..80347d9 100644
--- a/spike/tsshim/d3d12.c
+++ b/spike/tsshim/d3d12.c
@@ -25,10 +25,11 @@ static int dbg, idle;
static UINT64 qpc_freq;
#define LOG(...) do { if (dbg) { fprintf(stderr, "tsshim: " __VA_ARGS__); fputc('\n', stderr); fflush(stderr); } } while (0)
-// Wine resolves builtin modules by base name, so a second "d3d12.dll" at another path comes back as
-// this shim. The real one therefore lives beside the shim as d3d12_d3dmetal.dll with its Mach-O half
-// as x86_64-unix/d3d12_d3dmetal.so (Highball lays both out from the licensed D3DMetal overlay).
-// HB_D3D12_REAL, a Windows path or module name, overrides that for experiments.
+// Wine tells builtin modules apart by name (the file name on Wine 10, the PE's internal export name
+// on CrossOver's Wine 11), so a second "d3d12.dll" at another path comes back as this shim. Highball
+// lays the real one out beside the shim as apd12.dll, export name patched to match, with its Mach-O
+// half as x86_64-unix/apd12.so (InstalledEngine.timestampShimDir), and passes the path in
+// HB_D3D12_REAL. The bare-name fallback below is for experiments only.
static HMODULE load_real(void)
{
WCHAR path[1024];
diff --git a/spike/tsshim/probe.c b/spike/tsshim/probe.c
new file mode 100644
index 0000000..5588413
--- /dev/null
+++ b/spike/tsshim/probe.c
@@ -0,0 +1,49 @@
+// dx12probe: which d3d12.dll a process gets, whether a D3D12 device comes up, and what the
+// timestamp frequency is. Built by Scripts/build-tsshim.sh --probe into the scratchpad; run in a
+// bottle with `highball run <bottle> <unix path> --renderer d3dmetal --verbose`.
+#define COBJMACROS
+#define INITGUID
+#include <windows.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <d3d12.h>
+#include <dxgi1_4.h>
+
+static void say(const char *fmt, ...) {
+ va_list ap; va_start(ap, fmt); vfprintf(stdout, fmt, ap); va_end(ap); fputc('\n', stdout); fflush(stdout);
+}
+
+int main(void) {
+ char path[MAX_PATH];
+ say("dx12probe: LoadLibrary(d3d12.dll)");
+ HMODULE m = LoadLibraryA("d3d12.dll");
+ if (!m) { say(" FAILED, error %lu", GetLastError()); return 1; }
+ GetModuleFileNameA(m, path, sizeof path);
+ say(" module: %s", path);
+ HMODULE real = GetModuleHandleA("apd12.dll");
+ if (real) { GetModuleFileNameA(real, path, sizeof path); say(" shim active, real: %s", path); }
+ else say(" no apd12.dll in the process (shim absent or idle)");
+
+ typedef HRESULT (WINAPI *create_t)(IUnknown *, D3D_FEATURE_LEVEL, REFIID, void **);
+ create_t create = (create_t)GetProcAddress(m, "D3D12CreateDevice");
+ if (!create) { say(" no D3D12CreateDevice export, error %lu", GetLastError()); return 2; }
+
+ ID3D12Device *dev = NULL;
+ HRESULT hr = create(NULL, D3D_FEATURE_LEVEL_11_0, &IID_ID3D12Device, (void **)&dev);
+ say("D3D12CreateDevice: 0x%08lx", (unsigned long)hr);
+ if (FAILED(hr) || !dev) return 3;
+
+ D3D12_COMMAND_QUEUE_DESC qd = { D3D12_COMMAND_LIST_TYPE_DIRECT, 0, D3D12_COMMAND_QUEUE_FLAG_NONE, 0 };
+ ID3D12CommandQueue *q = NULL;
+ hr = ID3D12Device_CreateCommandQueue(dev, &qd, &IID_ID3D12CommandQueue, (void **)&q);
+ say("CreateCommandQueue: 0x%08lx", (unsigned long)hr);
+ if (SUCCEEDED(hr) && q) {
+ UINT64 f = 0;
+ hr = ID3D12CommandQueue_GetTimestampFrequency(q, &f);
+ say("GetTimestampFrequency: 0x%08lx -> %llu Hz", (unsigned long)hr, (unsigned long long)f);
+ ID3D12CommandQueue_Release(q);
+ }
+ ID3D12Device_Release(dev);
+ say("dx12probe: done");
+ return 0;
+}