Commit 4d16b03
committed
gfx/d3d8, gfx/d3d9: surface dylib_load failure for d3d{8,9}.dll
Both drivers' *_initialize_symbols() return false silently when
LoadLibrary("d3d8.dll") / ("d3d9.dll") fails. The caller in turn
returns NULL silently from the video driver's init(), so the only
diagnostic the user gets is the generic
[ERROR] [Video] Cannot open video driver. Exiting...
from video_driver_init_internal(), with no hint that the legacy
runtime is the problem. Even --verbose does not help, because there
is no log call between the driver being selected and init() returning
NULL.
This is increasingly common on modern Windows installs that ship only
d3d8thk.dll (the kernel thunk layer) and not the user-mode d3d8.dll
runtime; recently made more visible by the qb change that lets D3D8
build without d3d8.lib being available at link time, which means more
people end up running a d3d8-enabled binary on a system where the
runtime DLL is missing.
Falling back to d3d8thk.dll is not an option -- it does not export
Direct3DCreate8, it is only the GDI-side thunk syscalls. So just log
clearly and let the caller fail.
Log dylib_error() (already populated by dylib_load on Win32 via
set_dl_err) and a one-liner pointing the user at the legacy DX runtime
or at picking a different video driver. Also log if the DLL loads but
Direct3DCreate{8,9} cannot be resolved, since that path is silent too.
No behavioural change beyond the new log lines; the error return is
unchanged.1 parent b71e8f7 commit 4d16b03
2 files changed
Lines changed: 30 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
75 | 83 | | |
76 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
77 | 88 | | |
78 | 89 | | |
79 | 90 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
218 | 230 | | |
219 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
220 | 237 | | |
221 | 238 | | |
222 | 239 | | |
| |||
0 commit comments