According to CodeXL, I'm not succeeding in disabling the ANGLE layer in Qt
-
I've taken all care to disable the ANGLE layer in my Qt app, but apparently it's not happening. When I run the app in the CodeXL debugger, the event log contains lines like:
DLL Loaded: C:\Windows\SysWOW64\d3d11.dll
So it's loading Direct3D, which in Qt only happens via ANGLE I think. Also hitting the "Break" button in CodeXL does nothing, which to me means that no real OpenGL calls are happening, they're getting translated to D3D only.
The event log also says this:
Debug String: Failed to load opengl32.dll (The specified module could not be found.)
Why might that happen, how can I fix it?
The reason I want to disable ANGLE is because otherwise I can't debug with CodeXL (it doesn't support D3D debugging).
My system:
- Windows 10
- First GPU: Intel HD Graphics 5500
- Second GPU: AMD Radeon R5 M330 (I think this is the one my app uses)
My code:
main.cpp:
#include <QGuiApplication> #include <QQmlApplicationEngine> #include <QQuickFramebufferObject> #include <QOpenGLShaderProgram> #include <QOpenGLFramebufferObject> #include <QQuickWindow> class MyItem : public QQuickFramebufferObject { Q_OBJECT public: Renderer* createRenderer() const; }; class MyItemRenderer : public QQuickFramebufferObject::Renderer { public: void render() { update(); } QOpenGLFramebufferObject* createFramebufferObject(const QSize &size) { QOpenGLFramebufferObjectFormat format; format.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil); return new QOpenGLFramebufferObject(size, format); } }; QQuickFramebufferObject::Renderer* MyItem::createRenderer() const { return new MyItemRenderer(); } int main(int argc, char **argv) { qputenv("QT_OPENGL_BUGLIST", "Z:/disable_angle.txt"); QGuiApplication::setAttribute(Qt::AA_UseDesktopOpenGL); QGuiApplication app(argc, argv); qmlRegisterType<MyItem>("MyItem", 1, 0, "MyItem"); QQmlApplicationEngine engine; engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); return app.exec(); } #include "main.moc"
main.qml:
import QtQuick 2.0 import MyItem 1.0 import QtQuick.Window 2.2 Window { visible: true width: 400 height: 400 MyItem { anchors.fill: parent } }
Z:/disable_angle.txt:
{ "entries": [ { "id": 1, "description": "Disable angle", "os": { "type": "win" }, "features": [ "disable_angle" ] } ] }
-
Hi,
Did you set the
Qt::AA_UseDesktopOpenGL
application attribute before creating your Q(Gui)Application object ? -
@SGaistL: Yes I did. Didn't your see that in the code I posted? ;)
-
No, I missed it, the code block scrolling can be tricky and I didn't saw the
main
function implementation.Are you sure your disable_angle.txt list is valid ?
-
-
Set QT_LOGGING_RULES environment variable to 'qt.qpa.gl=true'. Thus, you will see some additional debug output that will help to understand what exactly Qt chooses (opengl/angle/software).
-
Try changing Z:/disable_angle.txt to Z:\disable_angle.txt Note the backslash :) It's Windows, so this may be the culprit.
-
Apart from disable_angle (your config seems correct to me), try also setting disable_d3d11 and disable_d3d9.
{ "entries": [ { "id": 1, "description": "Disable angle", "os": { "type": "win" }, "features": [ "disable_angle", "disable_d3d11", "disable_d3d9" ] } ] }
-
-
Set QT_LOGGING_RULES environment variable to 'qt.qpa.gl=true'.
Here's my log, I'm not sure how to interpret it. It seems to say it's disabling ANGLE and using OpenGL, but I'm not sure and it conflicts with what CodeXL tells me.
qt.qpa.gl: Qt: Using WGL and OpenGL from "opengl32.dll" qt.qpa.gl: QOpenGLStaticContext::create OpenGL: "Intel","Intel(R) HD Graphics 5500" default ContextFormat: v4.4 profile: QSurfaceFormat::OpenGLContextProfile(CompatibilityProfile) options: QFlags<QSurfaceFormat::FormatOption>(DeprecatedFunctions),SampleBuffers, Extension-API present Extensions: 200 qt.qpa.gl: Basic wglCreateContext gives version 4.4 qt.qpa.gl: OpenGL 2.0 entry points available qt.qpa.gl: GPU features: QSet("disable_angle") qt.qpa.gl: Disabling ANGLE: GpuDescription(vendorId=0x8086, deviceId=0x1616, subSysId=0x80c2103c, revision=9, driver: "igdumdim32.dll", version=20.19.15.4549, "Intel(R) HD Graphics 5500") qt.qpa.gl: QWindowsOpenGLTester::supportedRenderers GpuDescription(vendorId=0x8086, deviceId=0x1616, subSysId=0x80c2103c, revision=9, driver: "igdumdim32.dll", version=20.19.15.4549, "Intel(R) HD Graphics 5500") renderer: QFlags(0x1|0x20) qt.qpa.gl: QWindowsIntegration::createPlatformOpenGLContext QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::SwapBehavior(DoubleBuffer), swapInterval 1, profile QSurfaceFormat::OpenGLContextProfile(NoProfile)) qt.qpa.gl: "ARB::choosePixelFormat Attributes: 0x2003 , 0x2027 , 0x2010 , 0x1 , 0x2001 , 0x1 , 0x2014 , 0x18 , 0x2011 , 0x1 , 0x2022 , 0x18 , 0x2013 , 0x202b , 0x201b , 0x8 , 0x2023 , 0x8 , 0x2041 , 0x0 , \n obtained px # 5 of 1 \n PIXELFORMATDESCRIPTOR dwFlags=0x8225 PFD_DRAW_TO_WINDOW PFD_SUPPORT_OPENGL PFD_SUPPORT_COMPOSITION PFD_DOUBLEBUFFER iPixelType=0 cColorBits=32 cRedBits=8 cRedShift=16 cGreenBits=8 cGreenShift=8 cBlueBits=8 cBlueShift=0 cDepthBits=24 cStencilBits=8 iLayerType=0 cAlphaBits=8 cAlphaShift=24 cAccumBits=64 cAccumRedBits=16 cAccumGreenBits=16 cAccumBlueBits=16 cAccumAlphaBits=16 " qt.qpa.gl: ARB::createContext Creating context version 2 . 0 3 attributes qt.qpa.gl: QWindowsGLContext::QWindowsGLContext 0x163adc0 ARB requested: QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::SwapBehavior(DoubleBuffer), swapInterval 1, profile QSurfaceFormat::OpenGLContextProfile(NoProfile)) obtained # 5 ARB QSurfaceFormat(version 4.4, options QFlags<QSurfaceFormat::FormatOption>(DeprecatedFunctions), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples 0, swapBehavior QSurfaceFormat::SwapBehavior(DoubleBuffer), swapInterval 1, profile QSurfaceFormat::OpenGLContextProfile(CompatibilityProfile)) PIXELFORMATDESCRIPTOR dwFlags=0x8225 PFD_DRAW_TO_WINDOW PFD_SUPPORT_OPENGL PFD_SUPPORT_COMPOSITION PFD_DOUBLEBUFFER iPixelType=0 cColorBits=32 cRedBits=8 cRedShift=16 cGreenBits=8 cGreenShift=8 cBlueBits=8 cBlueShift=0 cDepthBits=24 cStencilBits=8 iLayerType=0 cAlphaBits=8 cAlphaShift=24 cAccumBits=64 cAccumRedBits=16 cAccumGreenBits=16 cAccumBlueBits=16 cAccumAlphaBits=16 swap interval: 1 default: ContextFormat: v4.4 profile: QSurfaceFormat::OpenGLContextProfile(CompatibilityProfile) options: QFlags<QSurfaceFormat::FormatOption>(DeprecatedFunctions) HGLRC= 0x30000
One thing I note is that surprisingly my Intel GPU seems to be used rather than my AMD GPU.
Try changing Z:/disable_angle.txt to Z:\disable_angle.txt Note the backslash :) It's Windows, so this may be the culprit.
Apart from disable_angle (your config seems correct to me), try also setting disable_d3d11 and disable_d3d9.
I tried both of these things, but CodeXL still shows the same "D3D" symptoms.