Hi there!
I somehow managed to break the emulator, like it seems, since every shader I try to compile fails with this:
0(2) : error C0118: macros prefixed with 'GL_' are reserved
This happens with the samples provided by the SDK as well, and all my shaders run fine on my friends computer.
Since this does happen with the samples as well, you can be sure, that the problem isn't a makro prefixed with "GL_", because there isn't such a makro in the Cube-Sample, and neither in my code.
I'm on a NVidia GTX570, by the way.
Has anyone ever experienced something like this? Any help would be appreciated, I can't continue my project otherwise...
Hi degenerated,
Can you let us know the OS you're running under?
Thanks,
Chris
Hi Chris,
I'm on Windows 8.1 64-Bit, using the newest stable Nvidia driver (Version 335.23).
The Mali-Offline-Compiler works fine by the way. Is there any way to see what the emulator does to make the shader compatible to OpenGL 2 in the glShaderSource-Call?
Okay, I used gDebugger to see what is getting passed to openGL, and there IS a makro, starting with GL_. This is the Vertex-Shader from the Cube-Example after it has gone through glShaderSource:
#version 120
#define GL_ES 1
#define gl_MaxFragmentUniformVectors (gl_MaxFragmentUniformComponents / 4)
#define gl_MaxVertexUniformVectors (gl_MaxVertexUniformComponents / 4)
#define gl_MaxVaryingVectors (gl_MaxVaryingFloats / 4)
#define gl_MaxCombinedTextureImageUnits (gl_MaxCombinedTextureImageUnits < 8 ? 8 : gl_MaxCombinedTextureImageUnits)
#define gl_MaxTextureImageUnits (gl_MaxTextureImageUnits < 8 ? 8 : gl_MaxTextureImageUnits)
attribute vec4 av4position;
attribute vec3 av3colour;
uniform mat4 mvp;
varying vec3 vv3colour;
void main() {
vv3colour = av3colour;
gl_Position = mvp * av4position;
}
Now how do I get rid of the "#define GL_ES 1" inserted by the emulator?
Edit: Used a Hex-Editor and tried to find that line in libGLESv2.dll. Found 2 of them and changed them to lower case. Now it's working. Still, why does the emulator put it there in the first place, if OpenGL complains afterwards?
Thanks for the bug report, I'm passing this on to the relevant team. I'm not sure why this issue is only occuring now if GL_ is reserved, but have to assume nvidia have tightened up their compiler. It makes sense that the Mali offline compiler works fine as this won't deal at all with the nvidia driver on the platform.
Thanks!
P.S. The GLES3 emulator may not exhibit the same problem, so you could use that instead!
I was installing the CUDA-SDK around the time when this error started. Maybe this updated their GLSL-Compiler or my drivers in some way.
Thats the only thing I can think of being the cause of the issue.
Best regards
Could be, we don't test with the CUDA SDK in place. We don't actively develop the GLES2 emulator any more, so if this is still a bug in the GLES3 emulator it will be fixed there but not back ported. I'd suggest moving to the GLES3 emulator .
Wouldn't I be stuck on Android 4.3+ then? Like it seems that is the earliest version of Android which supports GLES3, so I'd rather want to be still using GLES2, right?
Or am I missing something here and GLES3 runs on all hardware which runs GLES2, maybe with a limited featureset?
Actually it's the other way around, GLES3 is a superset of GLES2, so all GLES3 compatible hardware will run GLES2. The GLES3 emulator will happily run your GLES2 content!
I've been trying the GLES3-Emulator, and I can confirm that the problem persists in this version, and I somehow can't get around it with changing it in via the Hex-Editor. One location of the #define GL_ES 1 seems to be somewhere else and I can't find it.
However, the problem is mostly the same, so you may want to get this sorted out
Here is the Errorlog of the GLES3-Emulator:
Vertex info
-----------
0(7) : error C0118: macros prefixed with 'GL_' are reserved
0(8) : error C0118: macros prefixed with 'GL_' are reserved
0(9) : error C0118: macros prefixed with 'GL_' are reserved
0(10) : error C0118: macros prefixed with 'GL_' are reserved
0(11) : error C0118: macros prefixed with 'GL_' are reserved
0(12) : error C0118: macros prefixed with 'GL_' are reserved
0(13) : error C0118: macros prefixed with 'GL_' are reserved
0(14) : error C0118: macros prefixed with 'GL_' are reserved
0(15) : error C0118: macros prefixed with 'GL_' are reserved
0(16) : error C0118: macros prefixed with 'GL_' are reserved
0(17) : error C0118: macros prefixed with 'GL_' are reserved
0(18) : error C0118: macros prefixed with 'GL_' are reserved
0(19) : error C0118: macros prefixed with 'GL_' are reserved
0(20) : error C0118: macros prefixed with 'GL_' are reserved
0(21) : error C0118: macros prefixed with 'GL_' are reserved
0(22) : error C0118: macros prefixed with 'GL_' are reserved
0(22) : warning C7101: Macro GL_OES_texture_3D redefined
0(23) : error C0118: macros prefixed with 'GL_' are reserved
0(24) : error C0118: macros prefixed with 'GL_' are reserved
0(25) : error C0118: macros prefixed with 'GL_' are reserved
0(26) : error C0118: macros prefixed with 'GL_' are reserved
0(27) : error C0118: macros prefixed with 'GL_' are reserved
0(28) : error C0118: macros prefixed with 'GL_' are reserved
0(29) : error C0118: macros prefixed with 'GL_' are reserved
0(30) : error C0118: macros prefixed with 'GL_' are reserved
0(30) : warning C7101: Macro GL_OES_standard_derivatives redefined
0(31) : error C0118: macros prefixed with 'GL_' are reserved
0(32) : error C0118: macros prefixed with 'GL_' are reserved
0(32) : warning C7101: Macro GL_OES_EGL_image_external redefined
0(33) : error C0118: macros prefixed with 'GL_' are reserved
0(34) : error C0118: macros prefixed with 'GL_' are reserved
Fragment info
-------------
Thanks for your help reporting this,
We've also reproduced this, after updating our nvidia drivers so it's unrelated to the CUDA SDK and is being provoked by a recent change in the nvidia driver. This will be fixed in an upcoming release. For now the work around is to use an older nvidia driver, or follow your steps with the hex editor for the GLES2 emulator.
The workaround is - as Chris has already suggested - to use older NVIDIA Graphics Driver.
In my environment (NVIDIA NVS 300, Windows 7 64bit) the most recent driver that still works with OpenGL ES 3.0 Emulator v1.3.1 is 332.76.
Hope that helps,
Jacek