Comments (28)
Ok, I'll try to do my best.
from d9vk.
Line 3837 in 0595a6a
Looks like this produces different values every time.
Changing value to key.MipmapLodBias = 0;
"fixes" problem.
P.S. I was able to create apitrace, but it's too huge (I was very accurate in data collecting :) ).
I should learn how to crop it, to preserve only valuable data. Maybe separate frame states, or so.
from d9vk.
It is truly incredible that the game requires this many samplers.
The way I am doing lookups now is not the best.
May be worth offloading that sampler lookup into CS somehow, would need a d3d9-only backend change. I might have a go at implementing some dynamic sampler system and seeing if that makes a difference.
I could perhaps compress the sampler data with the bitfield struct thing (:) and probably get it down to 128 bits maybe? Wouldn't affect hashing it now due to how its being done though.
from d9vk.
would need a d3d9-only backend change
You can run your own code on the CS too, this doesn't (and shouldn't) be part of the backend.
Might also be worth checking if the game passes random/undefined data as sampler states, and normalize the key (e.g. set border colors to 0 if the sampler doesn't use border address mode). Usually there's no reason to have more than a few dozen samplers in total.
from d9vk.
would need a d3d9-only backend change
You can run your own code on the CS too, this doesn't (and shouldn't) be part of the backend.
Might also be worth checking if the game passes random/undefined data as sampler states, and normalize the key (e.g. set border colors to 0 if the sampler doesn't use border address mode). Usually there's no reason to have more than a few dozen samplers in total.
Good idea. Will start with normalizing first, and then see if offloading helps
from d9vk.
I've pushed a couple of commits to help rectify this issue:
d9df0f9
and
b5f6e4d
Can you try at each of them and tell me at which commit you get better performance with BL2?
Cheers :)
from d9vk.
To clarify for testing:
from d9vk.
To clarify for testing:
No noticeable difference between 0, 1 and 2.
Performance still degrading, but faster (degrading) with 2 (probably ... :) ).
from d9vk.
Can you produce an apitrace so I can attempt another fix locally?
from d9vk.
Can you produce an apitrace so I can attempt another fix locally?
I have no luck to do this on linux/steam/proton yet, maybe someone can help and do this on windows ?
from d9vk.
A guide is located here:
from d9vk.
Line 3837 in 0595a6a
key.MipmapLodBias = bit::cast(state[D3DSAMP_MIPMAPLODBIAS]);
Looks like this produces different values every time.
Changing value tokey.MipmapLodBias = 0;
"fixes" problem.P.S. I was able to create apitrace, but it's too huge (I was very accurate in data collecting :) ). I should learn how to crop it, to preserve only valuable data. Maybe separate frame states, or so.
Hi
If you have precompiled binary can test
from d9vk.
Line 3837 in 0595a6a
key.MipmapLodBias = bit::cast(state[D3DSAMP_MIPMAPLODBIAS]);Looks like this produces different values every time.
Changing value tokey.MipmapLodBias = 0;
"fixes" problem.P.S. I was able to create apitrace, but it's too huge (I was very accurate in data collecting :) ). I should learn how to crop it, to preserve only valuable data. Maybe separate frame states, or so.
Can you see if 55c86fa corrects your issue?
from d9vk.
Can you see if 55c86fa corrects your issue?
Still there.
Here is the alert("")
debugger output:
$ cat Borderlands2_d3d9.log | sort | uniq -c | grep new
9 warn: Direct3DDevice9Ex::CreateSampler: new sampler: 0 : 0
1 warn: Direct3DDevice9Ex::CreateSampler: new sampler: 0 : 1
1 warn: Direct3DDevice9Ex::CreateSampler: new sampler: 0 : 3.08894e-09
14484 warn: Direct3DDevice9Ex::CreateSampler: new sampler: 0 : -nan
2 warn: Direct3DDevice9Ex::CreateSampler: new sampler: 1 : 0
1 warn: Direct3DDevice9Ex::CreateSampler: new sampler: 1 : 1.97692e-07
2 warn: Direct3DDevice9Ex::CreateSampler: new sampler: 2 : 0
1 warn: Direct3DDevice9Ex::CreateSampler: new sampler: 2 : 1
1 warn: Direct3DDevice9Ex::CreateSampler: new sampler: 2 : 2
2 warn: Direct3DDevice9Ex::CreateSampler: new sampler: 2 : 3.08894e-09
1 warn: Direct3DDevice9Ex::CreateSampler: new sampler: 4 : 0
1 warn: Direct3DDevice9Ex::CreateSampler: new sampler: 4 : 1
1 warn: Direct3DDevice9Ex::CreateSampler: new sampler: 5 : 3.08894e-09
2 warn: Direct3DDevice9Ex::CreateSampler: new sampler: 6 : 3.08894e-09
Logger::warn(str::format("Direct3DDevice9Ex::CreateSampler: new sampler: ", Sampler, " : ", key.MipmapLodBias));
from d9vk.
I imagine its failing to make with a -NAN MipmapLodBias perhaps?
from d9vk.
yep
from d9vk.
Cool, I'll work on a fix for that
from d9vk.
Just for the record:
`$ cat Borderlands2_d3d9.log | sort | uniq -c | grep reused`
163457 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 0 : 0
16 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 0 : 1
7213 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 0 : 3.08894e-09
41351 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 1 : 0
3 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 10 : 0
16 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 1 : 1
3 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 11 : 0
10820 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 1 : 1.97692e-07
3 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 12 : 0
3 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 13 : 0
7214 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 1 : 3.08894e-09
3 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 14 : 0
3 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 15 : 0
1 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 16 : 0
1 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 17 : 0
1 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 18 : 0
1 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 19 : 0
59913 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 2 : 0
1 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 20 : 0
82 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 2 : 1
19 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 2 : 2
3605 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 2 : 3.08894e-09
28491 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 3 : 0
31 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 3 : 1
3607 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 3 : 3.08894e-09
39281 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 4 : 0
1 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 4 : 1
3607 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 4 : 3.08894e-09
17026 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 5 : 0
3606 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 5 : 3.08894e-09
10798 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 6 : 0
3605 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 6 : 3.08894e-09
7796 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 7 : 0
3607 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 7 : 3.08894e-09
3509 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 8 : 0
3507 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 8 : 3.08894e-09
3 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 9 : 0
from d9vk.
Does bd8264e rectify the issue?
from d9vk.
(I added a another commit to ensure the MipmapLodBias is 0 with NANs)
from d9vk.
Current master looks ok.
`$ cat Borderlands2_d3d9.log | sort | uniq -c | grep new`
10 warn: Direct3DDevice9Ex::CreateSampler: new sampler: 0 : 0
1 warn: Direct3DDevice9Ex::CreateSampler: new sampler: 0 : 1
1 warn: Direct3DDevice9Ex::CreateSampler: new sampler: 0 : 3
1 warn: Direct3DDevice9Ex::CreateSampler: new sampler: 0 : 3.08894e-09
3 warn: Direct3DDevice9Ex::CreateSampler: new sampler: 1 : 0
1 warn: Direct3DDevice9Ex::CreateSampler: new sampler: 1 : 1.97692e-07
3 warn: Direct3DDevice9Ex::CreateSampler: new sampler: 2 : 0
1 warn: Direct3DDevice9Ex::CreateSampler: new sampler: 2 : 1
1 warn: Direct3DDevice9Ex::CreateSampler: new sampler: 2 : 2
2 warn: Direct3DDevice9Ex::CreateSampler: new sampler: 2 : 3.08894e-09
1 warn: Direct3DDevice9Ex::CreateSampler: new sampler: 3 : 0
3 warn: Direct3DDevice9Ex::CreateSampler: new sampler: 4 : 0
1 warn: Direct3DDevice9Ex::CreateSampler: new sampler: 4 : 1
1 warn: Direct3DDevice9Ex::CreateSampler: new sampler: 5 : 0
1 warn: Direct3DDevice9Ex::CreateSampler: new sampler: 5 : 3.08894e-09
2 warn: Direct3DDevice9Ex::CreateSampler: new sampler: 6 : 3.08894e-09
`$ cat Borderlands2_d3d9.log | sort | uniq -c | grep reused`
913276 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 0 : 0
49 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 0 : 1
8 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 0 : 2
7 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 0 : 3
25715 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 0 : 3.08894e-09
210570 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 1 : 0
3 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 10 : 0
34 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 1 : 1
3 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 11 : 0
38573 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 1 : 1.97692e-07
8 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 1 : 2
3 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 12 : 0
3 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 13 : 0
25716 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 1 : 3.08894e-09
3 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 14 : 0
3 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 15 : 0
1 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 16 : 0
1 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 17 : 0
1 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 18 : 0
1 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 19 : 0
223036 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 2 : 0
1 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 20 : 0
183 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 2 : 1
19 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 2 : 2
12856 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 2 : 3.08894e-09
130386 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 3 : 0
63 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 3 : 1
12858 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 3 : 3.08894e-09
125760 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 4 : 0
1 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 4 : 1
12858 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 4 : 3.08894e-09
92525 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 5 : 0
12680 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 5 : 3.08894e-09
59734 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 6 : 0
12679 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 6 : 3.08894e-09
32812 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 7 : 0
12626 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 7 : 3.08894e-09
7914 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 8 : 0
7912 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 8 : 3.08894e-09
3 warn: Direct3DDevice9Ex::CreateSampler: reused sampler: 9 : 0
from d9vk.
@pchome Issue can be closed? :)
from d9vk.
Issue can be closed? :)
Sure.
You could keep it opened, to track remaining problems in Borderlands 2.
from d9vk.
Issue can be closed? :)
Sure.
You could keep it opened, to track remaining problems in Borderlands 2.
A separate issue with more detailed information on each issue would be better.
from d9vk.
upd:
Other problems (FYI):
high and constantly growing VRAM usage
Can't reproduce with recent build (~ e9af5d8), VRAM usage near 1000 (~200-300 usually used by system itself).- rotated Ammo/Weapon/Damage hints
See attached image. red texture borders (black is red)
While bug still there, can be overridden inWillowEngine.ini
:- partially:
DefaultPostProcessName=WillowEngineMaterials.RyanScenePostProcess
- completely:
DefaultPostProcessName=WillowEngineMaterials.CinematicScenePostProcess
- default:
DefaultPostProcessName=WillowEngineMaterials.WillowScenePostProcess
- partially:
from d9vk.
Issue is probably my shader io mapping (masks and multiple semantics to one register)
I will try and fix this over the next couple of days
from d9vk.
upd:
Other problems (FYI):
high and constantly growing VRAM usage
Can't reproduce with recent build (~ e9af5d8), VRAM usage near 1000 (~200-300 usually used by system itself).rotated Ammo/Weapon/Damage hints
See attached image.red texture borders (black is red)
While bug still there, can be overridden inWillowEngine.ini
:
- partially:
DefaultPostProcessName=WillowEngineMaterials.RyanScenePostProcess
- completely:
DefaultPostProcessName=WillowEngineMaterials.CinematicScenePostProcess
- default:
DefaultPostProcessName=WillowEngineMaterials.WillowScenePostProcess
Confimed in my case for now in x-men wolverine vram dont pass 500mb
from d9vk.
FYI the red lighting issue is fixed with 54a50c3
from d9vk.
Related Issues (20)
- Mudrunner only works in a Window and has rendering problems HOT 12
- Metal Gear Rising: Low framerate when moving mouse HOT 9
- Warhammer 40000 Spacemarines freeze in menus (once appear mouse cursor) HOT 2
- LOTR War in North show severe flickering HOT 5
- The Witcher 2 doesn't start when `PROTON_USE_D9VK=1 %command%` is set HOT 12
- Spellforce: Platinum Edition → transparent textures HOT 9
- AquaNox 2 → EXCEPTION_ACCESS_VIOLATION HOT 7
- master fails to compile on F31 HOT 5
- GW2 with d3d9 can't have a window/software in "front"/"always on top" HOT 12
- [2019.12.15] Fail compilation. (0f35b84) HOT 12
- About setting dialog mode HOT 9
- The Sims 4 crashes right at intro HOT 16
- Halo CE -> Low Framerate when lots of transparent geo on screen HOT 1
- [Question] Which version of d3d9.dll is more appropriate for GW2? HOT 1
- lutris league of legends not works with d9vk HOT 3
- Do not make new issues here!
- Battlefield 2 → crash when "Lightning" and "Dynamic Shadows" are set to high HOT 1
- Alt+Tab not working after d9vk HOT 2
- Where get d3d8.dll? HOT 2
- Halo ce direct x 9.0b HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from d9vk.