-
Notifications
You must be signed in to change notification settings - Fork 161
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
[dxvk] Optimize for the d3d9 Strict float emulation path #346
Comments
@Blisto91 Thanks for your comments. Now I'm investigating this issue on Amdvlk. |
Hi there and thank you for the response. I am not personally skilled in this area but I have asked the dxvk devs for assistance when they have a bit of time. |
I see GPUOpen-Drivers/llpc@e91a935 added an optimization for |
@DadSchoorse Thanks for your comment. Now I have added more patterns as you refer, now the patterns supported is listed below:
For 2.3, one more condition is the single operand(a or b) should not be constant zero here. Please check any missing here. Now my fix is under CI, looking forward to merge and deliver it ASAP. |
What I've said before may have been a bit ambiguous, so just to make sure: For Otherwise, your list matches what radv optimizes. |
Oh, another thing I just thought of, I don't see a bit size check in GPUOpen-Drivers/llpc@e91a935 . |
Was this work supposed to be enabled in the 2024.Q2.1 release? |
@Blisto91 Thanks for your feedback. For the cause of the issue, I have two suspects here:
To confirm which one cause this issue, would you please(or ask dxvk devs for assistance) to dump the pipeline then I can check whether my optimization has been effective. Thanks. |
You can dump the shaders by setting the environment variable That will export the generated SPIR-V among other things. Any D3D9 game will work, you just need to also set the environment variable |
Linked is a dxvk shader dump from Risen 1 running on my 7950x iGPU with amdvlk 2024.Q2.1 and |
@Blisto91 Thanks. But unfortunatelly I can't access this link.... Maybe you can add the related files in this page attached? |
@ruiminzhao Hi there. I hope a 7zip wrapped in a zip is fine as most formats Github allows doesn't compress enough on their own. |
Thanks. I can get the log now and will have a look later. |
The root cause has been found, the pattern used widely is like: %2293 = select reassoc nnan nsz arcp contract afn i1 %2291, float 0.000000e+00, float %2292 " |
I think the further fix for this issue has been delivered, maybe you can have a validation in the latest release. Thanks. |
@ruiminzhao Hi there. |
Oh, it seems this issue hasn't been delivered on 2024.Q2.3. Once it's delivered, I would ask you for further validation. Thanks. |
Thank you for the work everyone, i can confirm this looks good now with 2024.Q3.1. |
The d3d9
Strict
float emulation path in dxvk (see links below for technical description) is not enabled by default for all drivers, even though it is more correct, because it has a performance penalty compared to the defaultTrue
.Radv and now also nvk have code to optimize for this and so will both use
Strict
out of the box without any performance penalty and with more games functioning out of the box without visual issues.Amdvlk currently doesn't do this and so will either have a performance penalty for any games where dxvk sets Strict by default or risk of visual issues in any games where such builtin configs doesn't exist yet. A couple of examples for illustrating the performance dip can be seen below.
Note that these games are just randomly chosen and are not meant to be worst case scenarios. Also note that my test setup is pretty high end to begin with (RX6800 and 7950x) and so does not represent a typical one.
Risen
d3d9.floatEmulation = True
d3d9.floatEmulation = Strict
Dragons Dogma
d3d9.floatEmulation = True
d3d9.floatEmulation = Strict
See original dxvk PR doitsujin/dxvk#2294
See also radv MR https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13436
The text was updated successfully, but these errors were encountered: