Run Windows games on Apple Silicon — free, open source, with an open compatibility database that tells you what actually works.
Swift apple-silicond3dmetaldxmtdxvkfexgame-porting-toolkitgamingmac-gamingmacosmetalmoltenvksteamswiftuivkd3d-protonwhisky-alternativewindows-gameswinewine-wrapper
dx12probe: report every feature level and the caps a DirectX 12 game checks
Gauthier Piarrette66adeeca582d
diff --git a/spike/tsshim/probe.c b/spike/tsshim/probe.cindex 5588413..bcb8459 100644--- a/spike/tsshim/probe.c+++ b/spike/tsshim/probe.c@@ -28,11 +28,35 @@ int main(void) {create_t create = (create_t)GetProcAddress(m, "D3D12CreateDevice");if (!create) { say(" no D3D12CreateDevice export, error %lu", GetLastError()); return 2; }+ // Feature levels a DirectX 12 game asks for. GTA V Enhanced quits with ERR_GFX_D3D_NOD3D12+ // when none it accepts comes back, so print every one.+ static const struct { D3D_FEATURE_LEVEL fl; const char *name; } LEVELS[] = {+ { D3D_FEATURE_LEVEL_11_0, "11_0" }, { D3D_FEATURE_LEVEL_11_1, "11_1" },+ { D3D_FEATURE_LEVEL_12_0, "12_0" }, { D3D_FEATURE_LEVEL_12_1, "12_1" },+ };+ for (int i = 0; i < 4; i++) {+ ID3D12Device *probe = NULL;+ HRESULT r = create(NULL, LEVELS[i].fl, &IID_ID3D12Device, (void **)&probe);+ say(" feature level %s: 0x%08lx%s", LEVELS[i].name, (unsigned long)r, SUCCEEDED(r) ? " ok" : "");+ if (probe) ID3D12Device_Release(probe);+ }+ID3D12Device *dev = NULL;HRESULT hr = create(NULL, D3D_FEATURE_LEVEL_11_0, &IID_ID3D12Device, (void **)&dev);- say("D3D12CreateDevice: 0x%08lx", (unsigned long)hr);+ say("D3D12CreateDevice(11_0): 0x%08lx", (unsigned long)hr);if (FAILED(hr) || !dev) return 3;+ D3D12_FEATURE_DATA_D3D12_OPTIONS o = {0};+ if (SUCCEEDED(ID3D12Device_CheckFeatureSupport(dev, D3D12_FEATURE_D3D12_OPTIONS, &o, sizeof o)))+ say("options: ResourceBindingTier %d, TiledResourcesTier %d, ConservativeRasterizationTier %d, ResourceHeapTier %d",+ o.ResourceBindingTier, o.TiledResourcesTier, o.ConservativeRasterizationTier, o.ResourceHeapTier);+ D3D12_FEATURE_DATA_SHADER_MODEL sm = { D3D_SHADER_MODEL_6_6 };+ if (SUCCEEDED(ID3D12Device_CheckFeatureSupport(dev, D3D12_FEATURE_SHADER_MODEL, &sm, sizeof sm)))+ say("shader model: 0x%x", sm.HighestShaderModel);+ D3D12_FEATURE_DATA_ARCHITECTURE arch = {0};+ if (SUCCEEDED(ID3D12Device_CheckFeatureSupport(dev, D3D12_FEATURE_ARCHITECTURE, &arch, sizeof arch)))+ say("architecture: UMA %d, CacheCoherentUMA %d", arch.UMA, arch.CacheCoherentUMA);+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);