Skip to content

Commit 7a4c58e

Browse files
committed
fix: robust OpenGL probing, simplify naming, and add debug support
- extract JSON block from noisy subprocess output to handle log noise - use 'offscreen' platform and disable ASAN leaks for probe subprocess - rename BackendType::GLES to BackendType::ES and "GLES" to "ES" across UI and logs - add support for detecting and reporting OpenGL Debug Context availability - enable DebugContext in QSurfaceFormat if supported by hardware - remove "core" suffix from OpenGL version strings - fix 64-bit precision and Windows variable declaration warnings - simplify Windows GPU enablement declarations to a single line each
1 parent 62fc2be commit 7a4c58e

2 files changed

Lines changed: 3 additions & 8 deletions

File tree

src/opengl/OpenGLProber.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,9 @@
2323
#ifdef WIN32
2424
#include <windows.h>
2525

26-
extern "C" {
2726
// Prefer discrete nVidia and AMD GPUs by default on Windows
28-
__declspec(dllexport) extern DWORD NvOptimusEnablement;
29-
__declspec(dllexport) extern int AmdPowerXpressRequestHighPerformance;
30-
31-
__declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
32-
__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
33-
}
27+
extern "C" __declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
28+
extern "C" __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
3429
#endif
3530

3631
namespace {

tests/testopengl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ private slots:
2424
QCOMPARE(OpenGLConfig::getGLVersionString(), std::string("GL4.5"));
2525
}
2626

27-
void testParseSurveyResult_GLES()
27+
void testParseSurveyResult_ES()
2828
{
2929
OpenGLProber prober;
3030
QByteArray json = R"({"backend": "ES", "major": 3, "minor": 1, "debug": false})";

0 commit comments

Comments
 (0)