I'm trying to compile v1.10.8 for Android and I am currently faced with multiple errors when compiling RenderSystem_GLES2 project
PRECONDITIONS:
- Windows 10 x64
- Visual Studio 2017 Pro
- Android NDK r15c
- targets: Android ARM,x86
(Projects hlsl2glsl and glsl_optimizer are perfectly compiled as separate Android libraries!)
my OgreBuildSettings.h (scroll down please):
Code: Select all
#ifndef __Custom_Config_H_
#define __Custom_Config_H_
#define OGRE_STATIC_LIB
#define OGRE_DEBUG_MODE 0
#define OGRE_RESOURCEMANAGER_STRICT 1
[color=#008000]
//#undef OGRE_BUILD_RENDERSYSTEM_D3D9
//#undef OGRE_BUILD_RENDERSYSTEM_D3D11
//#define OGRE_BUILD_RENDERSYSTEM_GL
//#undef OGRE_BUILD_RENDERSYSTEM_GL3PLUS
//#undef OGRE_BUILD_RENDERSYSTEM_GLES
[/color]
#define OGRE_BUILD_RENDERSYSTEM_GLES2
[color=#008000]
//#define OGRE_BUILD_PLUGIN_BSP
[/color]
#define OGRE_BUILD_PLUGIN_OCTREE
#define OGRE_BUILD_PLUGIN_PCZ
#define OGRE_BUILD_PLUGIN_PFX
#define OGRE_BUILD_PLUGIN_CG [color=#008000]// NOTE: ENABLED for hlsl2glsl[/color]
#define OGRE_BUILD_COMPONENT_PAGING
#define OGRE_BUILD_COMPONENT_MESHLODGENERATOR
#define OGRE_BUILD_COMPONENT_TERRAIN
#define OGRE_BUILD_COMPONENT_VOLUME
#define OGRE_BUILD_COMPONENT_PROPERTY
#define OGRE_BUILD_COMPONENT_OVERLAY
#define OGRE_BUILD_COMPONENT_RTSHADERSYSTEM
#define OGRE_BUILD_COMPONENT_HLMS
#define OGRE_CONFIG_LITTLE_ENDIAN
#define OGRE_USE_STD11 0
#define OGRE_NODE_STORAGE_LEGACY 0
#define OGRE_DOUBLE_PRECISION 0
#define OGRE_NODE_INHERIT_TRANSFORM 0
#define OGRE_MEMORY_ALLOCATOR 1
#define OGRE_CONTAINERS_USE_CUSTOM_MEMORY_ALLOCATOR 0
#define OGRE_STRING_USE_CUSTOM_MEMORY_ALLOCATOR 0
#define OGRE_MEMORY_TRACKER_DEBUG_MODE 0
#define OGRE_MEMORY_TRACKER_RELEASE_MODE 0
#define OGRE_ASSERT_MODE 1
#define OGRE_THREAD_SUPPORT 0
#define OGRE_THREAD_PROVIDER 0
#define OGRE_NO_MESHLOD 0
#define OGRE_NO_FREEIMAGE 0
#define OGRE_NO_DDS_CODEC 0
#define OGRE_NO_PVRTC_CODEC 0
#define OGRE_NO_ETC_CODEC 0
#define OGRE_NO_STBI_CODEC 0
#define OGRE_NO_ZIP_ARCHIVE 0
#define OGRE_NO_VIEWPORT_ORIENTATIONMODE 1
[color=#800000]#define OGRE_NO_GLES2_CG_SUPPORT 0 [/color] [color=#008000]// NOTE: hlsl2glsl is ENABLED !!!! !!!! !!!! !!!! !!!! !!!! !!!![/color]
[color=#800000]#define OGRE_NO_GLES2_GLSL_OPTIMISER 0 [/color] [color=#008000]// NOTE: glsl_optimizer is ENABLED !!!! !!!! !!!! !!!! !!!! !!!! !!!! [/color]
#define OGRE_NO_GL_STATE_CACHE_SUPPORT 1
#define OGRE_NO_GLES3_SUPPORT 1
#define OGRE_NO_TBB_SCHEDULER 1
#define OGRE_NO_QUAD_BUFFER_STEREO 1
#define OGRE_BITES_HAVE_SDL 1
#define RTSHADER_SYSTEM_BUILD_CORE_SHADERS
#define RTSHADER_SYSTEM_BUILD_EXT_SHADERS
#endif
1) \RenderSystem_GLES2\src\GLSLES\src\OgreGLSLESCgProgram.cpp
Line 378: error : 'nullptr' was not declared in this scope
Code: Select all
...
376 int res = 0;
377 [color=#008000]// parse the file[/color]
[color=#ff0000]378 res = Hlsl2Glsl_Parse(parser, sourceToUse.c_str(), ETargetGLSL_ES_100, nullptr, options);[/color]
379 [color=#008000]// convert from cg to glsl[/color]
380 res = res && Hlsl2Glsl_Translate(parser, mEntryPoint.c_str(), ETargetGLSL_ES_100, options);
...
Line 68: error : 'GLSLESGpuProgram' has not been declared
Code: Select all
...
64 #if !OGRE_NO_GLES2_GLSL_OPTIMISER
65 [color=#008000]/**
66
67 */[/color]
[color=#ff0000]68 void optimiseShaderSource(GLSLESGpuProgram* gpuProgram);[/color]
69 #endif
...
Line 232: error : variable or field 'optimiseShaderSource' declared void
Line 232: error : 'GLSLESGpuProgram' was not declared in this scope
Line 232: error : 'gpuProgram' was not declared in this scope
Line 361: expected '}' at end of input
Code: Select all
...
231 #if !OGRE_NO_GLES2_GLSL_OPTIMISER
[color=#ff0000]232 void GLSLESProgramManagerCommon::optimiseShaderSource(GLSLESGpuProgram* gpuProgram)[/color]
233 {
234 if(!gpuProgram->getGLSLProgram()->getIsOptimised())
235 {
.................................
.................................
.................................
359 #endif
360 }
[color=#ff0000]361 } [/color]
{END OF FILE}
Line 83: error : 'mVertexProgram' was not declared in this scope...
Line 94: error : 'class Ogre::GLSLESProgram' has no member named 'getGLSLProgram'
Line 97: error : no matching function for call to 'Ogre::GLSLESLinkProgramManager::optimiseShaderSource(Ogre::GLSLESProgram*&)'
Line 106: error : 'mVertexProgram' was not declared in this scope
Line 107: error : 'class Ogre::GLSLESProgram' has no member named 'getGLSLProgram'
Line 112: error : 'class Ogre::GLSLESProgram' has no member named 'getGLSLProgram'
Code: Select all
...
81 #if !OGRE_NO_GLES2_GLSL_OPTIMISER
82 [color=#008000]// Check CmdParams for each shader type to see if we should optimize[/color]
[color=#ff0000]83 if(mVertexProgram)[/color]
84 {
85 String paramStr = mVertexProgram->getGLSLProgram()->getParameter("use_optimiser");
86 if((paramStr == "true") || paramStr.empty())
87 {
88 GLSLESLinkProgramManager::getSingleton().optimiseShaderSource(mVertexProgram);
89 }
90 }
91
92 if(mFragmentProgram)
93 {
[color=#ff0000]94 String paramStr = mFragmentProgram->getGLSLProgram()->getParameter("use_optimiser");[/color]
95 if((paramStr == "true") || paramStr.empty())
96 {
[color=#ff0000]97 GLSLESLinkProgramManager::getSingleton().optimiseShaderSource(mFragmentProgram);[/color]
98 }
99 }
100 #endif
101 compileAndLink();
102
103 #if !OGRE_NO_GLES2_GLSL_OPTIMISER
104 [color=#008000]// Try it again when we used the optimised versions[/color]
105 if(mTriedToLinkAndFailed &&
[color=#ff0000]106 mVertexProgram->getGLSLProgram()->getOptimiserEnabled() && [/color]
[color=#ff0000]107 mFragmentProgram->getGLSLProgram()->getOptimiserEnabled())[/color]
108 {
109 LogManager::getSingleton().stream() << "Try not optimised shader.";
110 mTriedToLinkAndFailed = false;
111 mVertexProgram->getGLSLProgram()->setOptimiserEnabled(false);
[color=#ff0000]112 mFragmentProgram->getGLSLProgram()->setOptimiserEnabled(false);[/color]
113 compileAndLink();
114 }
115 #endif
...
Line 195: error : 'mVertexProgram' was not declared in this scope
Line 206: error : 'class Ogre::GLSLESProgram' has no member named 'getGLSLProgram' RenderSystem_GLES2
Line 209: error : no matching function for call to 'Ogre::GLSLESProgramPipelineManager::optimiseShaderSource(Ogre::GLSLESProgram*&)'
Code: Select all
...
187 void GLSLESProgramPipeline::activate(void)
188 {
189 if (!mLinked && !mTriedToLinkAndFailed)
190 {
191 glGetError(); [color=#008000]// Clean up the error. Otherwise will flood log.[/color]
192
193 #if !OGRE_NO_GLES2_GLSL_OPTIMISER
194 [color=#008000]// Check CmdParams for each shader type to see if we should optimise[/color]
[color=#ff0000]195 if(mVertexProgram)[/color]
196 {
197 String paramStr = mVertexProgram->getGLSLProgram()->getParameter("use_optimiser");
198 if((paramStr == "true") || paramStr.empty())
199 {
200 GLSLESProgramPipelineManager::getSingleton().optimiseShaderSource(mVertexProgram);
201 }
202 }
203
204 if(mFragmentProgram)
205 {
[color=#ff0000]206 String paramStr = mFragmentProgram->getGLSLProgram()->getParameter("use_optimiser");[/color]
207 if((paramStr == "true") || paramStr.empty())
208 {
[color=#ff0000]209 GLSLESProgramPipelineManager::getSingleton().optimiseShaderSource(mFragmentProgram);[/color]
210 }
211 }
212 #endif
...
When I disable glsl_optimizer in my OgreBuildSettings.h as shown below:
Code: Select all
#define OGRE_NO_VIEWPORT_ORIENTATIONMODE 1
#define OGRE_NO_GLES2_CG_SUPPORT 0
[color=#008000]//#define OGRE_NO_GLES2_GLSL_OPTIMISER 0 [/color]
#define OGRE_NO_GLES2_GLSL_OPTIMISER 1 [color=#008000]// NOTE: glsl_optimizer is DISABLED !!!! [/color]
#define OGRE_NO_GL_STATE_CACHE_SUPPORT 1
But I need hlsl2glsl and glsl_optimizer to be included in project and work, because without glsl_optimizer there will be problems on some devices with a MALI chip (and they are actually the majority)
About glsl_optimizer and MALI (from http://www.ogre3d.org/developers/requirements):
...........
ANDROID
We support all devices where the OS version is greater or equal 2.3.3 (this OS version introduced GLES 2.0 support). For older phones / tablets
we still have the GLES 1.1 rendersystem (which is not developed any further).
Furthermore we have partial support for GLES 3.X which should be used on newer devices.
In the past we had several problems with MALI gpu’s due the usage of the RTSS – some devices could not handle the auto generated shaders.
But we overcome most problems with the use of the glsl optimizer so that one should be enabled when running on mobile gpu’s.
...
Btw, I downloaded the Ogre v1.10.8 from this link:
https://github.com/OGRECave/ogre/releases/tag/v1.10.8
Help
I assume that the functionality of the use of glsl_optimizer is broken or not fully implemented in the Render System GLES2