Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add memory page cache #22

Open
JayFoxRox opened this issue Oct 7, 2018 · 0 comments
Open

Add memory page cache #22

JayFoxRox opened this issue Oct 7, 2018 · 0 comments

Comments

@JayFoxRox
Copy link
Member

A major bottleneck for nv2a-trace is the amount of traffic between the Xbox and the development PC.
A single frame can easily take 600MB of RAM if textures and surfaces are dumped for each draw call.

In practice, most of this data will obviously be constant.
So if nv2a-trace knew that a page wasn't modified, we could skip the transfer.

One way to implement this, is to filter memory reads:
Before each read, nv2a-trace would ask the Xbox to generate a hash for the RAM pages (page size does not have to be 0x1000 bytes).
If nv2a-trace already has a page with the returned hash in it's local cache, then the transfer could be skipped.
If the returned hash is not in the cache, nv2a-trace would have to load that page into its cache.

I have already written some scripts for prototyping which can be found on my personal repository: JayFoxRox#6

A more abstract solution could possibly be promoted to xboxpy and nxdk-rdt. However, nv2a-trace is the biggest stakeholder at the moment.

Dirty bit tracking is probably not a suitable alternative because it would be unaware of changes done by the DSP, IO DMA or the GPU itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant