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

Feature request renderer auto option #364

Closed
nelsonmenon opened this issue Dec 9, 2024 · 12 comments
Closed

Feature request renderer auto option #364

nelsonmenon opened this issue Dec 9, 2024 · 12 comments

Comments

@nelsonmenon
Copy link

In ddraw.ini, renderer option, auto = try direct3d9/opengl
Is it possible to include auto2 = try opengl/direct3d9 ?

@FunkyFr3sh
Copy link
Owner

FunkyFr3sh commented Dec 9, 2024

Actually auto does the following right now:

Windows:
Try Direct3D9 and use GDI as fallback

Linux/macOS/andorid:
Try OpenGL and use GDI as fallback

But the chances for it to fail and switch the renderer are slim to none though. It's very very rare that it would fail. If it fails, then it's usually a Virual Machine without hardware acceleration (so there isn't much you can do, you must use GDI).

Do you have any example usecase? Is this on Windows?

Oh BTW, If you set the renderer to OpenGL then it will still detect any possible issue and it will still switch to GDI if needed.

@nelsonmenon
Copy link
Author

in my case I share my Diablo 2 folder with 2 notebook, the old one doesn't have opengl, the new one has.
so when I play the old one I have to change renderer to direc3d9, when I play in the new one I have to edit the renderer to opengl.
when I try to play opengl on the old one the game crashes.

@FunkyFr3sh
Copy link
Owner

FunkyFr3sh commented Dec 10, 2024

Ah okay. OpenGL should work fine, even on 15+ year old hardware. Maybe we can try to fix the crash instead of adding such a workaround with switching renderers. Could you test run the game with the debug build and upload the logs? Link: #44

@nelsonmenon
Copy link
Author

nelsonmenon commented Dec 10, 2024

cnc-ddraw-Game-1.dmp
cnc-ddraw-Game-1.log

with the old notebook using opengl when I set shader=Lanczos it works, when I set shader=.\Shaders\interpolation\fsr.glsl it crashes. so I assume that is something with the shader. thanks in advance, great work.

edit: with xBR-lv2 it crashes too. I don't know much about shaders, but I believe that those 2 are mutipass shaders?
edit2: with Nearest neighbor, Bilinear, Bicubic and Lanczos, it works.

FunkyFr3sh added a commit that referenced this issue Dec 10, 2024
@FunkyFr3sh
Copy link
Owner

FunkyFr3sh commented Dec 10, 2024

You are right, xBRZ and FSR are multipass shader and it does indeed crash while building the second shader.

The weird thing about it is that the first time it builds the shader it will work fine, your drivers/hardware have no issues with it. But when the game is done playing the intro video the game would then switch the display resolution and cnc-ddraw has to rebuild the shaders and then it would crash.

I can't really fix it properly because it's crashing in a .dll file of your drivers and not in cnc-ddraw's code. So what I done now is detecting the version number of your drivers and then just disable multipass shaders (it will use the default catmull-rom-bilinear if you try to use a multipass shader)

Here's the test version, I hope it works (I couldn't reproduce the bug since i don't have the same hardware)
https://github.com/FunkyFr3sh/cnc-ddraw/releases/download/experimental/cnc-ddraw-experimental-release.zip

You could maybe try to update your drivers, it seems like there is a newer version available than your current 10.18.10.4252 build

@nelsonmenon
Copy link
Author

hi, I updated the driver to version 10.18.10.5161 and got the same crash.
after that I tried the experimental build and still got the same crash (because of the driver version in the commit, and I can't downgrade now to test, sorry)

@nelsonmenon
Copy link
Author

still crashes

Minidump.dmp
Crash.txt
D2241211.txt

this is the log from d2, I don't know if it helps

@FunkyFr3sh
Copy link
Owner

I might need a new debug log since your driver version changed and I don't know how they setup the version string (I only made a guess...)

#44

@nelsonmenon
Copy link
Author

@FunkyFr3sh
Copy link
Owner

FunkyFr3sh commented Dec 11, 2024

This time you got xBR set up which is a single-pass shader (only XBRZ and FSR are multipass). Similar issues, it does build and run fine on the intro and then crashes while trying to build it again.

I disabled custom shaders for your two driver versions now and just use the default catmull-rom-bilinear instead

https://github.com/FunkyFr3sh/cnc-ddraw/releases/download/experimental/cnc-ddraw-experimental-release.zip

@nelsonmenon
Copy link
Author

you're right, I tested with fsr and it worked, it runs in catmull-rom-bilinear instead.

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

No branches or pull requests

2 participants