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

[d3d9] Early updates for textures #1901

Closed
wants to merge 2 commits into from

Conversation

K0bin
Copy link
Collaborator

@K0bin K0bin commented Jan 20, 2021

Mass Effect locks 2 textures every frame and those are always dirty so the game has to queue a copy and synchronize the gpu immediately afterwards.

So I propose copying the UpdateMappedBufferEarly approach from D3D11 and updating the mapping buffer after most writing operations (except if it's used as an RT). I put it behind a super simple heurstic though..

@mirh Please test if this PR improves performance for you.

@mirh
Copy link

mirh commented Jan 20, 2021

I'm not really in the bestest of situations to compile myself the thing.

EDIT: if it can help anyway, I noticed all d3d9 drivers that I have seen (at least in ME1) have some sort of caching behaviour. In certain places after save has just been loaded, cpu is like maxed out at 100% on all cores for a dozen of seconds (with say 40 fps). After that, you get the right "80% usage across a couple of threads that is passed around" (and you get, say, 55 fps with gpu finally maxed out).

@K0bin
Copy link
Collaborator Author

K0bin commented Jan 20, 2021

d3d9.zip

Here's a build.

@misyltoad
Copy link
Collaborator

I only implemented deferred texture uploads because some games depend on it because they keep writing after unlock or use the image while locked.

Might be easier just to disable that behaviour for this game?

@mirh
Copy link

mirh commented Jan 20, 2021

It doesn't make the slightest difference.
Also, I just noticed you don't even need a save to see this problem. The title screen saw 55% of the performance of d3d9, while the main menu is like 35%.

@K0bin
Copy link
Collaborator Author

K0bin commented Jan 20, 2021

And I still can't reproduce that.

At 4k, the game runs less than 20% slower with DXVK.

@K0bin K0bin closed this Jan 20, 2021
@pchome
Copy link
Contributor

pchome commented Jan 20, 2021

@K0bin

Mass Effect locks 2 textures every frame and those are always dirty so the game has to queue a copy and synchronize the gpu immediately afterwards.

Is this behavior the game or engine specific?

I downloaded a random UE3 benchmark (PLA Benchmark) and it shows ~1% avg. FPS improvement in d3d9 mode with this patch. So should be bigger improvement in some specific scenes, I guess. I don't know where to look at.

@mirh
Copy link

mirh commented Jan 20, 2021

What if you try 8K with vsr?

@K0bin
Copy link
Collaborator Author

K0bin commented Jan 20, 2021

4k (4x) is the highest I can get with VSR. Aside from that, Nvidia doesnt support GPU profiling on my GPU.

@mirh
Copy link

mirh commented Jan 20, 2021

Try SSAA then I guess (hoping driver can force it in vulkan too)?
And can't you use some older version of Nsight, or renderdoc?

@K0bin
Copy link
Collaborator Author

K0bin commented Jan 20, 2021

Try SSAA then I guess (hoping driver can force it in vulkan too)?

No it can't.

And can't you use some older version of Nsight, or renderdoc?

No version ever supported Vulkan GPU profiling on anything older than Turing.

Nothing I can do here. Just buy new hardware.

@mirh
Copy link

mirh commented Jan 20, 2021

Mhh I see, and anyhow even their raw api doesn't seem to expose vulkan.... but do you really need hardware counters here? Tracy, optick or renderdoc may be already good enough here perhaps.

As for DSR, it's your lucky day.

@K0bin
Copy link
Collaborator Author

K0bin commented Jan 20, 2021

but do you really need hardware counters here? Tracy, optick or renderdoc may be already good enough here perhaps.

Why don't you just go ahead and optimize it then? Tracy and optick are libraries that need to get integrated at a game engine level so they are obviously not useful here.

There's nothing obviously wrong with what DXVK does and I'm not gonna waste anymore time on a game that already runs at 500 fps on my system.

@mirh
Copy link

mirh commented Jan 21, 2021

Well, I tried

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

Successfully merging this pull request may close these issues.

4 participants