Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions docs/audio_hal_exe_calls.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,13 @@ open pull request for it.
## What the executable already does about a failure

Four of the calls above have a branch for a negative result: `AcpHalCreate`, `AcpHalAllocateShapeContexts`,
`ApuCreateHeap` and `XApuDequeueResult`. An unimplemented import under `LEONIDA_UNIMPLEMENTED=log` returns 0, so a caller
that tests for a negative result sees success with its outputs unset; under `fail` only imports `classify_import`
knows to return an `HRESULT` get `E_NOTIMPL`, and none of these four is on that list (it names only functions the public
documentation describes). So today neither mode makes the executable take its own failure path for the audio hardware.
Whether the title survives that path, or needs the coprocessor, is **unmeasured**: it takes a run to find out, and the
first run reported in #6603 stops earlier, in `D3D12ConfigureVirtualMemoryX`.
`ApuCreateHeap` and `XApuDequeueResult`. An unimplemented import under `LEONIDA_UNIMPLEMENTED=log` returns 0, so a
caller that tests for a negative result sees success with its outputs unset; under `fail` only imports `classify_import`
knows to return an `HRESULT` get `E_NOTIMPL`; all four are on that list now (`runtime/shims/registry.cpp` names the
`AcpHal.dll`, `xapu.dll` and `chad.dll` functions whose shims return an `HRESULT`), but their shims serve them. So today
neither mode makes the executable take its own failure path for the audio hardware. Whether the title survives that
path, or needs the coprocessor, is **unmeasured**: it takes a run to find out, and the first run reported in #6603 stops
earlier, in `D3D12ConfigureVirtualMemoryX`.

## What this does not show

Expand Down
2 changes: 2 additions & 0 deletions runtime/shims/registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ std::vector<Lookup> g_lookups;
// xcrdapi.dll functions/dstoragegetfactory). dstorage_xs.dll is the console name; xcrdapi.dll is a
// console module the title may import it from (docs/directstorage.md). dstorage.cpp serves
// it; the class is kept for a build without that shim.
// xapu.dll, chad.dll the HRESULT returns of the shims in xapu_queue.cpp (xapu.dll) and xapu_chad.cpp
// (chad.dll); XApuGetResultCount returns uint32_t.XApuGetResultCount returns uint32_t.
const char* const kNotHResult[] = {
"XAsyncCancel", "XAsyncComplete",
"XTaskQueueCloseHandle", "XTaskQueueDispatch", "XTaskQueueGetCurrentProcessTaskQueue",
Expand Down
11 changes: 11 additions & 0 deletions runtime/test/unimplemented_policy_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,17 @@ void test_classification() {
"the console dstorage name is hresult");
check(cls("xcrdapi.dll", "DStorageGetFactory") == ReturnClass::HResult, "xcrdapi's DStorageGetFactory is hresult");
check(cls("xcrdapi.dll", "XCrdLeonidaPolicyProbe") == ReturnClass::Other, "other xcrdapi imports are other");
check(cls("XCRDAPI.dll", "DStorageGetFactory") == ReturnClass::HResult,
"the retail spelling XCRDAPI.dll is hresult, case-insensitively");
check(cls("dstorage.dll", "DStorageGetFactory") == ReturnClass::HResult, "the PC dstorage name is hresult");
check(cls("xcrdapi.dll", "DStorageGetFactoryLeonidaPolicyProbe") == ReturnClass::Other,
"another xcrdapi import is other");
for (const char* name : {"XApuConnect", "XApuDequeueResult", "XApuDisconnect", "XApuEnqueueCommand"})
check(cls("xapu.dll", name) == ReturnClass::HResult, name);
check(cls("xapu.dll", "XApuGetResultCount") == ReturnClass::Other, "XApuGetResultCount returns uint32_t");
for (const char* name : {"XDspActivate", "XDspConnectWithMaximumStreamLimit", "XDspDeactivate", "XDspDisconnect",
"XDspSubmitCommand"})
check(cls("chad.dll", name) == ReturnClass::HResult, name);
check(cls("xg_xs.dll", "XGCreateTexture2DComputer") == ReturnClass::Other, "unmeasured xg_xs import is other");
check(cls("xg_xs.dll", "XGCreateTextureComputer") == ReturnClass::Other,
"the xg_xs shim's export is bound, not classified here");
Expand Down
Loading