DXMT ビルド
dxmt-er-build リポジトリは、Eternal Return 専用の pixel output sanitization パッチを適用した DXMT v0.80 ランタイムをビルドします。
このパッチは、Eternal Return で観測された閃光や壊れたグラフィック表示を減らすための補正です。
パッチは d3d11.sanitizeOutput オプションを追加し、EternalReturn.exe にだけ既定で適用します。
dxgi.forceSDR、sampleNaNToZero、defuseFma などの他の実験オプションは有効にしません。
macOS、Xcode Command Line Tools、git、curl、cmake、meson、ninja が必要です。
また、builtin Wine DLL と .so を作るために Wine build tree が必要です。
既定の Wine build tree パスは次のとおりです。
./wine-build/build64別のパスを使う場合は WINE_BUILD で指定します。
WINE_BUILD=/path/to/wine-build/build64 ./scripts/build-dxmt.shまず DXMT 用 toolchain を準備し、DXMT source を取得します。
./scripts/fetch-toolchains.sh./scripts/fetch-dxmt.sh次に Wine build tree を指定して DXMT runtime をビルドします。
WINE_BUILD=/path/to/wine-build/build64 ./scripts/build-dxmt.sh既定パスに Wine build tree をつないでいる場合は、次のように実行できます。
./scripts/build-dxmt.shビルド後は dxmt-runtime と tarball artifact が生成されます。
dxmt-runtime/ i386-windows/ x86_64-windows/ x86_64-unix/
artifacts/ dxmt-v0.80-builtin.tar.gz dxmt-v0.80-builtin.tar.gz.sha256archive は dxmt-v0.80-builtin/ ディレクトリとして展開されます。
runtime と archive には、関連する DXMT と third-party license ファイルが含まれます。
インストールと override
Section titled “インストールと override”Wine Stable のレイアウトにインストールする場合は、インストールスクリプトを使用できます。 既存ファイルは timestamp 付きの backup として保存されます。
./scripts/install-to-wine-stable.shWine では DXMT DLL を builtin 優先で使うよう override を設定します。
d3d10core = builtin,natived3d11 = builtin,nativedxgi = builtin,nativewinemetal = builtin,nativeランチャーに統合する場合は、Wine root と prefix-local DLL が同じ DXMT バージョンになるよう管理してください。 古い prefix-local DLL が残っていると、新しい runtime を入れても古い DXMT が読み込まれる可能性があります。
Eternal Return 補正方式
Section titled “Eternal Return 補正方式”診断結果では、この可視問題は Wine の一般的な pointer truncation、row pitch、stride、buffer size 問題ではなく、D3D shader が macOS graphics backend へ変換される境界で起きる浮動小数点互換性の問題に近いと整理されています。
現在の補正は、pixel shader output に NaN や Inf のような non-finite 値が入った場合、それを 0.0 に置き換えます。
概念的な流れは次のとおりです。
game DXBC pixel shader -> DXMT LLVM/AIR conversion -> injected non-finite output epilogue -> Metal shader compilation -> GPU execution -> render-target writeこの処理は branchless select に近く、コストは予測しやすいものの完全に無料ではありません。 また、D3D conformance の観点では NaN/Inf が float render target に残る必要がある場合があるため、グローバル既定値にはしません。
Eternal Return で A/B テストを行う場合は、shader cache を無効にして sanitizer の有効/無効を比較します。
DXMT_SHADER_CACHE=0 /path/to/your/steam-launcher.shDXMT_SHADER_CACHE=0 DXMT_DISABLE_OUTPUT_SANITIZE=1 /path/to/your/steam-launcher.sh1 つ目のコマンドは sanitizer が有効な経路を確認します。 2 つ目のコマンドは補正を無効化した比較実行です。
CrossOver 26.1.0 向けには別の diagnostic build もあります。
これは shader DXBC dump、DXMT log、Xcode .gputrace capture、non-finite output marker を取得するためのものです。
./scripts/build-crossover-26.1.0-diagnostic.sh./scripts/test-crossover-26.1.0-diagnostic.sh診断 marker は問題 pixel を白く表示して位置を確認するための道具です。 ユーザー向けの修正ではなく、release build には診断 marker や tracing code を含めない方針です。