mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-27 21:45:16 +01:00
* feat: log the cpu, the memory and the GPUs at startup Bug reports can't tell from log.txt whether the game ran on the integrated GPU of a laptop instead of the dedicated one: it names only GL_RENDERER, GL_VENDOR and the GL version. The exe asks for the dedicated GPU (NvOptimusEnablement, AmdPowerXpressRequestHighPerformance), but the Windows graphics settings, the driver panel or the socket the monitor is plugged into can override that. At startup the log now gets, every line starting with "hardware: ": - the cpu (cpuid brand string, the registry on Windows as a fallback, /proc/cpuinfo on Linux), its cores and threads, and AVX2 support (with a warning when the build needs AVX2 and the cpu has none) - the total and the available memory - on Windows every adapter DXGI lists (description, vendor and device id, dedicated and shared memory, monitors connected, integrated or discrete), the software adapter left out; dxgi.dll is loaded with LoadLibrary, so the game gets no new link dependency - right after the OpenGL context is made, the GPU it runs on and its memory where the driver tells it (GL_NVX_gpu_memory_info, GL_ATI_meminfo) - a warning when OpenGL runs on an integrated GPU while the system has a discrete one, or draws on the cpu (GDI Generic, llvmpipe) Integrated or discrete is told from the vendor and the name, and only when sure (utilities/hardwareinfo.h): NVIDIA is discrete; Intel is integrated except the Arc cards and Iris Xe MAX; AMD is discrete for RX/Pro/VII/FirePro, integrated for the APU names ending in "Graphics", unknown otherwise. An unknown GPU never raises the warning. The rules and the text are in utilities/hardwareinfo.cpp (core library, unit tested); the probing in utilities/hardwareprobe.cpp, called from application.cpp. No renderer file is touched. README.md: the minimum cpu now matches the package readme, 4 cores with AVX2 (Core i5-4430 / Ryzen 3 1200), instead of 2 cores (Core i3-2100, which has no AVX2 the release needs). * refactor(log): the hardware info without Sonar issues using enum for gpu_kind, the ranges algorithms, a reader struct for /proc/cpuinfo instead of a long lambda, explicit captures, cpuid returning a std::array, the adapter list behind a function rather than a mutable global, and uppercase literal suffixes in the test. No change in behaviour. * fix(log): load dxgi.dll from System32 only, cap the GL error drain LoadLibraryW searched the game folder first, so a proxy dxgi.dll left there by ReShade or ENB was loaded at every start just to list the adapters. The loop that clears the GL errors after the memory queries could spin forever on a lost context that keeps reporting one; it now stops after 32. A comment says when the AVX2 warning can be reached. * fix(log): Raven Ridge RX Vega and Panther Lake Arc B3xx are integrated "Radeon RX Vega 11 Graphics" (Ryzen 2400G) and "RX Vega 10 Graphics" (2700U) hit the "rx" card rule before the "ends with Graphics" APU one, and "Arc B390 GPU" / "B370" of Panther Lake looked like an Arc card by the letter and number. Both came out discrete, so the integrated-GPU warning never showed on such a machine. An RX Vega with a number and "Graphics" is now an APU (RX Vega 56 and Vega M of Kaby Lake G stay discrete), and Arc B3xx is integrated (A310, A380, B570, B580 stay cards).