Description
When attempting to use Qt3D ShaderPrograms on iOS, all shaders fail to compile with an empty error message (printed to qDebug as Shader Error: "" <shader source>). This can be reproduced using any Qt example/test that requires Qt3DRender::QMaterial, such as:
- qt3d/tests/manual/rhi/simple-rhi-cpp/simple-rhi-cpp.pro
- qt3d/examples/qt3d/simple-cpp/simple-cpp.pro
Just build these projects for iOS or iOS simulator and run to observe the issue.
The issue seems to be simply a forgotten iOS platform check in SubmissionContext::createShaderProgram within the RHI plugin:
i.e.
#ifdef Q_OS_MACOS
{{ ->}}
{{ #if defined(Q_OS_MACOS) || defined(Q_OS_IOS)}}
With this change I am able to successfully run the above test/example and my own code.
Attachments
For Gerrit Dashboard: QTBUG-95130 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
360420,3 | Compile RHI shaders on iOS | dev | qt/qt3d | Status: MERGED | +2 | 0 |
360616,2 | Compile RHI shaders on iOS | 6.2 | qt/qt3d | Status: MERGED | +2 | 0 |
360617,2 | Compile RHI shaders on iOS | 6.1 | qt/qt3d | Status: MERGED | +2 | 0 |