shpaass / yafc-ce

Powerful Factorio calculator/analyser that works with mods
GNU General Public License v3.0
52 stars 19 forks source link

Problems with detecting DirectX version #233

Closed Arengror closed 1 month ago

Arengror commented 1 month ago

Long story short, I using YAFK 0.8.1 but it crash during calculator window loading.

With my racoon hands and message from shpaass (Do you have DirectX12 on your machine? We've changed the default version to 12, so it might be the reason. It should've swapped to 9 otherwise though.) i searched trough log and found out few things

1)Apparently I have 6 render drivers 2)One of them is DX12

The problem is- I using Windows 10 and GTS450.

GTS450 too old for DX12 and ,according to Intel, DX12 is PREINSTALLED on Windows 10 and 11, so I can't delete DX12 files to manually resolve that issue. That's why during calculator loading phase YAFC tries to use DX12 but instead he just die.

And to save some time, driver finder is here - PickRenderDriver , line 91 at yafc-ce/Yafc.UI/Core/WindowMain.cs

Don't even know if I can add anything except it was fun to dig trough.

YAFC log attached yafc20240811.log

//How does SDL_GetRenderDriverInfo work? //Will "SDL.SDL_GetRenderDriverInfo(1, out SDL.SDL_RendererInfo rendererInfo)" show acting driver?

And for now I gonna use older versions.

sfoster1 commented 1 month ago

Oh, that’s a really interesting problem.

For your specific questions:

That said, I don’t think that information will help. It seems like what’s happening is that some DX12 call is crashing very early in the lifetime of the renderer we create - we only create a hardware-accelerated renderer for the main screens once you load a project, which is why the issue happens then. The initial screen where you select the project is a software renderer.

You mentioned on the discord that “it’s loading mods, icons, and calculator window and before UI even loaded it’s closing itself”. Knowing exactly when the program crashes might be really helpful here. How far does it get? Does it

The reason I want to know is that depending on how much gets loaded, we could conceivably try and look for render errors and fall back a DX version or two, or even all the way to software, if we see them. I’m unfortunately not sure if this will work though because if the errors are “the GPU driver crashes” we don’t really get to see that all the way up in c#.

Another option might be a setting, which we could actually save in the project file and initially set in the loading panel, to fall back to a software renderer. It’s probably safest to fall back all the way to a software renderer since DX9 is known to be crashy.

It also would be great if we could make sure that most error-indicating SDL calls (the ones that return an int) are error-guarded and log errors; I think some of them are but not all.

I’m happy to work on all this but unfortunately I’m away from anything but an iPhone until US evening on Monday so I can’t until then.

veger commented 1 month ago

Another option might be a setting, which we could actually save in the project file and initially set in the loading panel, to fall back to a software renderer.

There is also a global settings, e.g. to store the recent projects. This would be the ideal place to store a 'software render' configuration, as this setting would not be project dependent but installation dependent.

sfoster1 commented 1 month ago

Another option might be a setting, which we could actually save in the project file and initially set in the loading panel, to fall back to a software renderer.

There is also a global settings, e.g. to store the recent projects. This would be the ideal place to store a 'software render' configuration, as this setting would not be project dependent but installation dependent.

Oh, perfect, didn’t know about that