Free fork of NotProton: Windows Steam games in Mac Steam, on CodeWeavers' Wine and Apple's Game Porting Toolkit
Swift apple-silicond3dmetaldxmtdxvkgame-porting-toolkitgptkmac-gamingmacosmetalfxrosetta-2steamsteam-playwinewinecx
fix(panel): show BRIDGEPLAY_BACKEND in the Graphics menu (#1659)
Raymond Chin7e33da3b96d4
diff --git a/dylib/feats/webpatch.c b/dylib/feats/webpatch.cindex ae6a38f..60a66ea 100644--- a/dylib/feats/webpatch.c+++ b/dylib/feats/webpatch.c@@ -447,7 +447,10 @@ static int out_expand(np_out_t *o, const char *replace, const np_cap_t *caps) {/* A toggle that is on unless set to "0" (upstream 1.2.0: AVX2, FEX x87 precision). */ \"X=(k,l)=>(0," RT ".jsx)(" BARREL ".Yh,{className:\"MSCXRow\",label:l," \"checked:\"0\"!==ev(k),onChange:v=>s([[k,v?\"\":\"0\"]])},k)," \- "bv=g(\"CX_GRAPHICS_BACKEND\"),b=fex&&\"d3dmetal\"===bv?\"\":bv," \+ /* The run script takes a valid BRIDGEPLAY_BACKEND over CX_GRAPHICS_BACKEND, so the menu \+ shows that one, and a pick from the menu drops it. */ \+ "pb=g(\"BRIDGEPLAY_BACKEND\"),bv=/^(dxmt|dxvk|wined3d|d3dmetal)$/.test(pb)?pb:g(\"CX_GRAPHICS_BACKEND\")," \+ "b=fex&&\"d3dmetal\"===bv?\"\":bv," \"dm=!fex&&(\"\"===b||\"d3dmetal\"===b)," \"dx=\"\"===b||\"dxmt\"===b," \"sw=\"1\"===g(\"DXMT_METALFX_SPATIAL_SWAPCHAIN\")," \@@ -485,7 +488,7 @@ static int out_expand(np_out_t *o, const char *replace, const np_cap_t *caps) {"typeof MSCXPrefixRow==\"function\"&&(0," RT ".jsx)(\"div\",{className:\"MSCXRow\",ref:e=>e&&MSCXPrefixRow(e,t.unAppID)},\"npstate\")," \"(0," RT ".jsxs)(" BARREL ".XY,{label:npL(\"Graphics\",\"图形\",\"Grafica\"),children:[" \"(0," RT ".jsx)(" BARREL ".m,{rgOptions:B,selectedOption:b," \- "onChange:v=>s([[\"CX_GRAPHICS_BACKEND\",v.data]]" \+ "onChange:v=>s([[\"CX_GRAPHICS_BACKEND\",v.data],[\"BRIDGEPLAY_BACKEND\",\"\"]]" \".concat(\"\"===v.data||\"d3dmetal\"===v.data?[]:[[\"D3DM_ENABLE_METALFX\",\"\"]])" \".concat(\"\"===v.data||\"dxmt\"===v.data?[]:" \"[[\"DXMT_METALFX_SPATIAL_SWAPCHAIN\",\"\"],[\"DXMT_CONFIG\",fx(\"\")]])" \diff --git a/dylib/tests/panel-behavior/switching.js b/dylib/tests/panel-behavior/switching.jsindex 5af6d56..53cf8cf 100644--- a/dylib/tests/panel-behavior/switching.js+++ b/dylib/tests/panel-behavior/switching.js@@ -69,6 +69,24 @@ for (const form of Object.keys(FORMS)) {(x.props.rgOptions || []).some(o => o.data === 'dxmt')).props.onChange({ data: 'dxvk' });const opts = written[written.length - 1].opts;t.ok(opts.trim().endsWith('%command%'), `%command% stays last (${opts})`);+ // The run script takes a valid BRIDGEPLAY_BACKEND (NOTPROTON_BACKEND winning) over+ // CX_GRAPHICS_BACKEND, so the menu shows what runs, and a pick has to drop it.+ const menu = o => walk(P({ details: details(o + ' %command%') })).find(x => x.type === 'Dropdown' &&+ (x.props.rgOptions || []).some(d => d.data === 'dxmt'));+ for (const [o, want] of [['BRIDGEPLAY_BACKEND=dxvk', 'dxvk'],+ ['CX_GRAPHICS_BACKEND=dxmt BRIDGEPLAY_BACKEND=wined3d', 'wined3d'],+ ['NOTPROTON_BACKEND=dxmt BRIDGEPLAY_BACKEND=dxvk', 'dxmt'],+ ['CX_GRAPHICS_BACKEND=dxmt BRIDGEPLAY_BACKEND=bogus', 'dxmt']]) {+ const got = menu(o).props.selectedOption;+ t.ok(got === want, `${o} shows ${want} (${got})`);+ }+ for (const to of ['dxmt', '']) {+ written.length = 0;+ menu('BRIDGEPLAY_BACKEND=dxvk NOTPROTON_BACKEND=dxvk').props.onChange({ data: to });+ const w = written.length ? written[written.length - 1].opts : '';+ t.ok(!/(BRIDGEPLAY|NOTPROTON)_BACKEND=/.test(w) && menu(w.replace(/ ?%command%.*/, '')).props.selectedOption === to,+ `picking ${to || 'automatic'} drops BRIDGEPLAY_BACKEND (${w})`);+ }failed += t.failed;}console.log(failed ? `\n${failed} failure(s)` : '\nno stale arguments, nothing lost');