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

Dark Souls Remastered - Heavy Texture Flickering #405

Closed
ghost opened this issue May 29, 2018 · 66 comments
Closed

Dark Souls Remastered - Heavy Texture Flickering #405

ghost opened this issue May 29, 2018 · 66 comments

Comments

@ghost
Copy link

ghost commented May 29, 2018

Upon entering into the Blight town area of the game, textures start to flicker heavily all around the screen making the game unplayable.

Software information

Arch Linux, kernel 4.16.11
Dark Souls Remastered, Steam version.

System information

  • GPU: GeForce GTX 770
  • Driver: 396.24
  • Wine version: Wine Staging 3.9
  • DXVK version: 3b70e23

Apitrace file(s)

  • Put a link here

Log files

@ghost
Copy link

ghost commented May 29, 2018

Did you try with latest nvidia driver?

@ghost
Copy link
Author

ghost commented May 29, 2018

@Yardanico Yes, tried with 396.24.02 - same issue.

@doitsujin doitsujin added the bug label May 29, 2018
@doitsujin
Copy link
Owner

doitsujin commented May 29, 2018

Please provide an apitrace as requested in the issue template. I didn't put that section there for fun but because I need it to do anything about it.

@ghost
Copy link
Author

ghost commented May 29, 2018

Would be nice to also put instructions how to do it :)

@ghost
Copy link
Author

ghost commented May 30, 2018

Here's the trace file (hope, I did it right) https://www.dropbox.com/s/7bhdhvvnp8nffxk/DarkSoulsRemastered.trace?dl=0

@doitsujin
Copy link
Owner

doitsujin commented May 30, 2018

Thanks. I'm not seeing any texture flickering though, might be a driver-specific issue - can you take a screenshot of what it looks like for you?

@ghost
Copy link
Author

ghost commented May 30, 2018

screenshot_20180530_110828

@ghost
Copy link
Author

ghost commented May 30, 2018

BTW, in d3d11.log err: D3D11DeviceContext::SetPredication: Stub and the Wiki says that Predication is not supported.
Could this be what's causing the glicthes?

@varris1
Copy link
Contributor

varris1 commented May 30, 2018

The trace seems to work fine on radv and amdgpu-pro.

I tested the trace and it seems to be an nvidia-only issue. Also it doesn't matter if it's the old or new shader compiler. It happens on both.

doitsujin added a commit that referenced this issue May 31, 2018
Emulates D3D11 behaviour more closely on Nvidia hardware.
Fixes an issue in Dark Souls Remastered caused by constant
buffer access with an undefined index value (#405).
@doitsujin
Copy link
Owner

@progman-dt 621aed5 should fix this, feel free to re-open this issue if the problem persists.

Basically the game is broken and tries to render something with an incorrect vertex buffer. The new commit doesn't change that, but it should behave the same as on Windows now. AMD seems to be doing this by default, which is why I wasn't able to reproduce the issue.

@ghost
Copy link
Author

ghost commented May 31, 2018

@doitsujin Unfortunately, this didn't fix it for me, at least with 396.24.0 drivers. Should I try with 396.24.02 beta drivers?

@doitsujin
Copy link
Owner

doitsujin commented May 31, 2018

You should always be using the .02 update with DXVK since it contains a bunch of fixes.

That said, other Nvidia users are unable to reproduce the bug with your trace file. If the above patch doesn't fix it for you, there's nothing I can do. Please double-check that you are actually using the updated build.

@doitsujin doitsujin reopened this May 31, 2018
@varris1
Copy link
Contributor

varris1 commented May 31, 2018

Are you sure you compiled the latest version of master?
It's fixed in the trace, so I am not sure if you are actually running 621aed5.

Also haagch already provides the latest build here: https://haagch.frickel.club/files/dxvk/latest/

@ghost
Copy link
Author

ghost commented May 31, 2018

Well, I downloaded the latest build from here https://haagch.frickel.club/files/dxvk/ from the folder r1176.621aed5, so it should be the needed build.
But, unfortunately, even with 396.24.02, it's still the same problem
screenshot_20180531_152850

@varris1
Copy link
Contributor

varris1 commented May 31, 2018

Can you replay your own trace and see if it's broken there as well?

you can use wine apitrace.exe replay /path/to/DarkSoulsRemastered.trace but make sure that dxvk is installed in your selected wineprefix.

@ghost
Copy link
Author

ghost commented May 31, 2018

@varris1 Just replayed the trace, and it's still broken, textures are flickering like crazy :(

@TestMode1
Copy link

Have you removed cache - e.g rm -rf ~/.cache? Checked that dlls are indeed replaced - e.g ls -la and check file sizes with the ones in the Download folder?

@ghost
Copy link
Author

ghost commented May 31, 2018

I double checked everything, the sizes match. Deleting the cache doesn't do anything either.
screenshot_20180531_204238
screenshot_20180531_204512

@bmy
Copy link

bmy commented Jan 1, 2022

and p.s. I am loath to use the custom build linked in the comment above mine, as it warns that using it could get one's Steam account banned.

@K0bin
Copy link
Collaborator

K0bin commented Jan 1, 2022

MoltenVK doesn't support robustBufferAccess2. DXVK relies on that to fix this issue because D3D11 guarantees that out of bounds buffer reads return 0. So this requires a hack to workaround the issue. We don't support Mac OS so this should be done in the Mac OS fork of DXVK.

@bmy
Copy link

bmy commented Jan 1, 2022

Oh okay, that makes sense. I didn't see a suitable fork after a quick search on Github but I am all ears if you have any idea where I should direct my comments.

Just to make sure I understand (I also have Linux boxes) – is this issue in fact fixed on Linux in DXVK 1.0.3 and later?

Thanks for the reply!

@K0bin
Copy link
Collaborator

K0bin commented Jan 1, 2022

Just to make sure I understand (I also have Linux boxes) – is this issue in fact fixed on Linux in DXVK 1.0.3 and later?

Yes. I even played DS Remastered 2 months ago on Proton and it worked perfectly.

@ApurvZ
Copy link

ApurvZ commented Apr 14, 2022

I read some previous threads, folks were talking as its nvidia driver's issue. But its not. The flickering issue is still happening in Blightown area of the game, and my system is Macbook Air M1. So not a driver issue. @doitsujin

@K0bin
Copy link
Collaborator

K0bin commented Apr 14, 2022

The Nvidia driver can be configured to return 0 for uniform buffer accesses that go out of bounds. Back in the day, this was not possible, hence why it was kind of a driver issue. On AMD that's the default behavior anyway.

What I wrote earlier still holds true:

MoltenVK doesn't support robustBufferAccess2. DXVK relies on that to fix this issue because D3D11 guarantees that out of bounds buffer reads return 0. So this requires a hack to workaround the issue. We don't support Mac OS so this should be done in the Mac OS fork of DXVK.

So in this case it's a driver issue in either Metal or MoltenVK.

@ApurvZ
Copy link

ApurvZ commented Apr 14, 2022

Oh, thx for clarifying!

@Kayfatlcst
Copy link

I have the same problem on a MacBook Pro with an M1 chip, running with CrossOver, how can I fix it?

@cdavis5e
Copy link
Contributor

I have the same problem on a MacBook Pro with an M1 chip, running with CrossOver, how can I fix it?

You'd have to ask CodeWeavers. DXVK itself doesn't support macOS.

@Kayfatlcst
Copy link

@cdavis5e
Copy link
Contributor

Yeah, @Gcenx's MoltenVK fork might be a better place to ask. If you're seeing problems with stock MoltenVK, I'd also suggest filing an issue there.

@Gcenx
Copy link

Gcenx commented Jun 23, 2022

@cdavis5e not really I’ve removed all MoltenVK-DXVK packages now only providing stock packages.

I’m providing modified versions of DXVK that work with stock MoltenVK.

@Kayfatlcst
Copy link

macos_dxvk_patched.tar.xz no longer found?

@Gcenx
Copy link

Gcenx commented Jun 23, 2022

macos_dxvk_patched.tar.xz no longer found?

See the comment to Chip

@cdavis5e not really I’ve removed all MoltenVK-DXVK packages now only providing stock packages.

I’m providing modified versions of DXVK that work with stock MoltenVK.

@Kayfatlcst
Copy link

I was able to solve the problem!

@Kayfatlcst
Copy link

https://mega.nz/file/EHhhWYYZ#cxOOM_bA9ILODaazs9swWjQRk0K6DVlUxiT9FCKjHd8 paste the files from the x64 folder into the system32 folder in the bottle

@Gcenx
Copy link

Gcenx commented Jun 23, 2022

MoltenVK doesn't support robustBufferAccess2. DXVK relies on that to fix this issue because D3D11 guarantees that out of bounds buffer reads return 0. So this requires a hack to workaround the issue. We don't support Mac OS so this should be done in the Mac OS fork of DXVK.

@K0bin do you happen to have an updated version of this hack?

@K0bin
Copy link
Collaborator

K0bin commented Jun 23, 2022

No, DXVK works around it by using SSBOs which are tightly bound checked. Metal doesn't differenciate between buffer types and doesn't have bounds checking so this doesn't work there.

@Kayfatlcst
Copy link

It works, try it, I was able to fix this bug on my MacBook Pro M1

@K0bin
Copy link
Collaborator

K0bin commented Jun 24, 2022

@Kayfatlcst What did you do to fix it in that build?

@Kayfatlcst
Copy link

https://mega.nz/file/EHhhWYYZ#cxOOM_bA9ILODaazs9swWjQRk0K6DVlUxiT9FCKjHd8 paste the files from the x64 folder into the system32 folder in the bottle
I wrote about it above

@K0bin
Copy link
Collaborator

K0bin commented Jun 24, 2022

But where does that "dxvk-dsr-0.96" build come from and what kinds of changes does it have over regular DXVK 0.96?

@Kayfatlcst
Copy link

This is a modification that I found specifically to solve this problem

@Kayfatlcst
Copy link

The most important thing is that after these steps everything works on M1

@K0bin
Copy link
Collaborator

K0bin commented Jun 24, 2022

It's a build with 621aed5. That does indeed fix Dark Souls Remastered but it's not a correct fix and breaks other games. That's why the commit was reverted shortly after.

@Kayfatlcst
Copy link

Kayfatlcst commented Jun 24, 2022

The specificity of CrossOver is such that it will not affect other games, each game has its own bottle, the system can be customized for each game and application individually and this solution is great for Mac
Снимок экрана 2022-06-24 в 23 16 07

@Gcenx
Copy link

Gcenx commented Jun 24, 2022

The specificity of CrossOver is such that it will not affect other games, each game has its own bottle, the system can be customized for each game and application individually and this solution is great for Mac

That’s not really the point that K0bin was making, that note was lightly aimed towards anyone maintaining a macOS target fork to not revert this commit as it will break other games.

@Kayfatlcst
Copy link

In any case, I hope I helped someone, as a last resort, you can keep a backup with a different version of the files and change it when you play other games

Chaotic-Temeraire pushed a commit to chaotic-cx/mesa-mirror that referenced this issue Feb 23, 2024
Some D3D11 games rely on out-of-bounds indirect UBO loads to return
real values from underlying bound descriptor. This workaround would
prevent us from lowering indirectly accessed UBOs to consts.

Later DXVK would declare dynamically indexed uniforms with upper
size bound, to make the accesses spec compliant. But for now
we need our own workaround.

Known affected games:
- Dark Souls 3
- Sekiro: Shadows Die Twice
- Final Fantasy Type-0 HD
- Ultrakill
- Dishonored 2

DXVK discussions:
- doitsujin/dxvk#405
- doitsujin/dxvk#3861

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27727>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests