Qt [c++] - No Qt3D rendering on older laptop
-
Hi,
I think you can use the QSG_RHI_BACKEND environment variable for that.
-
Based on a quick look at older versions of the documentation, I would say no.
-
Does it happen if you set
QSG_RHI_BACKENDbefore starting your application ? -
In that case you might be able to leverage
Q3D_RENDERER. See the module documentation for more information. -
I did that. My output is:
WARNING Initializing RHI with OpenGL backend
WARNING No GLSL shader code found (versions tried: QList(130, 120) ) in baked shader QShader(stage=0 shaders=QList(ShaderKey(1 Version(300 QFlags()) 0)) desc.isValid=true)
WARNING Failed to build graphics pipeline: Creation FailedNo problem with this setting on the newer machine so far ...
Speed of the scene is comparable to DirextX11+What am I missing?
-
It looks like you are running into a classic RHI (Rendering Hardware Interface) mismatch. Even though the performance feels snappy, those warnings are red flags that your current environment is missing the specific shader translations needed for the OpenGL backend.
Here’s the breakdown of what is actually happening under the hood:
1. The Shader Version Gap
The error
versions tried: QList(130, 120)tells us that your application is looking for older, "baked" GLSL shader code (OpenGL 3.0/2.1 era). However, the only shader found in your binary isVersion(300), which corresponds to OpenGL ES 3.0.- What you're missing: Your application was likely compiled/packaged with shaders targeting modern mobile or DirectX/Vulkan backends, but the runtime is falling back to a legacy OpenGL path that doesn't have the corresponding "blobs" to talk to the GPU.
2. Why it "Works" on the Newer Machine
The newer machine likely has a more robust driver set or a different default RHI priority.
- DirectX 11 vs. OpenGL: On Windows, Qt and similar frameworks perform significantly better on DirectX because they can use the ANGLE layer, which translates OpenGL calls to DirectX.
- The "Speed" Illusion: If the scene is still fast, your system might be successfully falling back to a software rasterizer or a partial hardware acceleration path, but you'll eventually hit a "Black Screen" or a crash when the app tries to call a specific graphics pipeline that failed to build.
Comparison of Backends
Feature OpenGL (Legacy) DirectX 11 Vulkan / Metal Stability Lower on Windows High (Windows native) High (Modern) Shader Format GLSL HLSL SPIR-V Compatibility Hit-or-miss drivers Best for Windows Best for Cross-platform
How to Fix This
You likely need to force the application to use a backend that matches its baked shaders. Try one of the following:
-
Force the RHI: Set an environment variable before launching the app to see if it clears the warning:
-
QT_RHI_BACKEND=d3d11(For Windows) -
QT_RHI_BACKEND=vulkan(If supported) -
Update Drivers: Even if the machine is "older," ensure the GPU drivers support OpenGL 3.3+.
-
Check Shader Baking: If you are the developer, ensure your
qsb(Qt Shader Baker) settings include the desktop GLSL versions (--glsl "130,120,100") and not just the ES versions.
Note: The "Failed to build graphics pipeline" error is the most critical. It means certain effects, materials, or lighting calculations simply won't render, even if the rest of the UI seems to be moving.
Would you like me to show you how to check which OpenGL versions your current GPU drivers actually support?
P.S. Sorry, but my answer above was generated with Gemini. I think it can be usefull.
-
K kevin_d has marked this topic as solved