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.