Repository navigation
Method tables with no room after their last method get slots that log - #942
Open
wildheathen wants to merge 3 commits into
Open
wildheathen wants to merge 3 commits into
wildheathen wants to merge 3 commits into
Conversation
A call past the end of a method table jumped to whatever followed the table in memory. Such a call is now logged with its slot and answered E_NOTIMPL. Every table the title is handed that had fewer than 8 entries after its last known method gets at least 8: the command queue's two (the newer one ended at its last method) and the DXGI factory's; the runtime objects', through a `with_spare` over the existing `missing`; GameInput's input, device and reading objects, through its `unsupported`; and the texture computer's, the audio coprocessor's and the source resolver's, which each get a logging entry of their own. The methods that were there are unchanged. One test per table.
…unted from the table's end The eight spare entries are counted after the last entry a table had before they were added, the `missing` ones included, not after its last written method: the DXGI factory's and the queues' (44, not 48), DirectStorage's factory and file (24 and 16), the task queue's (39), the shell's off Windows (12) and GameInput's device (29, since 0x78..=0xa0 are known methods). GameInput's reading object returns bools, counts and values, never a result code, so its spare entries log and answer 0 like its unwritten ones. Its three objects' entries say which object they belong to. The tests check the entries the table really gained, that none is null and that they differ; the GPU one compares them with the table of `missing` entries instead of calling them, which left the reported-once state set.
…save table's margin over its blocking calls
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
The method tables the layer hands the title are made longer than the interfaces we know, "so that a method a newer title adds logs instead of jumping into whatever follows the table" (
object.rs). About thirty tables had no such room: the command queue (0 slots after its last method in the newer layout, 2 in the older), the DXGI factory, and nearly every runtime object invictory-hle(saves, user, store, package, networking, input, speech, display, audio, media, the texture computer). A call to the next method jumped into whatever lay after the table.Each of them now has 8 more slots after the last one it had. A spare slot logs its slot and answers as the unwritten slots of that table already do:
E_NOTIMPLwhere they answer that, 0 for the input reading object, whose methods return counts and booleans. No method that was there changes, nor what it returns.Tests
One test a table (29 in all): the 8 slots after the table's former end are there, not null, and distinct. They failed before the change. After merging main at
77df871e:cargo test -p victory-gpu553 passed, 0 failed;cargo test -p victory-hle225 passed.Measured
A 3-minute scripted run from the start into the world (RTX 5080, diagnostics build): the game runs as before and none of the new slots is called, so nothing changes for this stretch of this title. It is for other scenes and other titles.
Limits
E_NOTIMPLas a wrong value, as with the slots that were there already.77df871e). DirectStorage's four tables got spare slots of their own on main with DirectStorage: EnqueueSignal, the error calls, Query, the legacy CreateQueue and QueryInterface #912, so this PR now leaves them as main has them; the game save table keeps its margin over main's new blocking calls.object.rs, HLE/gameinput: the system button registration gets its own six arguments #838 and HLE/gameinput: a reading-callback registration is refused like the platform #840gameinput.rs); I will merge main again if they go in first.