OGRECave / ogre-next

aka ogre v2 - scene-oriented, flexible 3D C++ engine
https://ogrecave.github.io/ogre-next/api/latest
Other
1.02k stars 225 forks source link

[OGRE-421] Missing glGetError call causing "Error prior to using GLSL Program Object: validation successfull" log spam #17

Open paroj opened 8 years ago

paroj commented 8 years ago

[reporter="hhyyrylainen", created="Mon, 7 Jul 2014 21:30:20 +0200"]

When using custom shaders my log is constantly spammed with "Error prior to using GLSL Program Object: Validation successfull" messages. There are no graphical glitches and the shader is working correctly. After using break on OpenGL error I found that the function in OgreGLRenderSystem.cpp called GLRenderSystem::_setPointSpritesEnabled doesn't check has the opengl call made by it caused an error. This causes the shader binding code report the error. I fixed this by adding glGetError(); after line 1548. There have been discussion on the forums about a similar issue before and it was, too, caused by a missing get error call (http://www.ogre3d.org/forums/viewtopic.php?f=2&t=44132&start=25)

paroj commented 8 years ago

[author="charles", created="Mon, 22 Sep 2014 10:41:31 +0200"]

I had a similar problem that came form an invalid specular intensity in material file (>128), glGetError not called, so a wrong error is reported after...

paroj commented 8 years ago

[author="dark_sylinc", created="Mon, 22 Sep 2014 16:28:49 +0200"]

Is GL3 also affected by the issue? (GL doesn't exist in 2.0)
Is there a quick way to repro the problem?
What are the machines showing these behavior (Hardware and driver versions + OS). This last item is very important, as I can't repro the problem but probably depends on the drivers.

paroj commented 8 years ago

[author="charles", created="Mon, 22 Sep 2014 16:37:22 +0200"]

for my problem, it is under archlinux with nvidia drivers, loading a material with specular intensity more than 128. GlError is not catch, and is detected in another GLSL program. Didn't try GL3 (I think it is not build by default under linux, is it ?)
EDIT: confirm this issue with RederSystem_GL on linux with nvidia 340.32, tried GL3Plus, but my big app doesn't work :/ and the small app I use shows only a black screen. which is weird as sampleBrowser displays things... but unrelated to this bug
On a small app the error msg is " GLHardwareVertexBuffer::lock - Error: failed to Discard the buffer. Try to recreate the buffer", triggered with "specular 0 0 0 0 129"

paroj commented 8 years ago

[author="dark_sylinc", created="Mon, 22 Sep 2014 16:51:33 +0200"]

Yes, you have to explicitly enable it in CMake.
Thanks for the info. When I get time I'll have to setup Linux in the only NVIDIA machine I have.
If you happen to have the driver version that would be also great.

paroj commented 8 years ago

[author="hhyyrylainen", created="Tue, 23 Sep 2014 11:30:02 +0200"]

(I couldn't actually verify whether this actually affects GL3+ as it failed to start due to missing symbol in RenderSystem_GL3Plus.so)
Drivers wise I was using at the time Catalyst 14.6 Beta with an amd radeon 5800-series card.
This issue happened while I was trying to make CEGUI work with Ogre 2.0. I had to use HardwareVertexBuffer and custom shaders for rendering which would spam the error every frame.
I just found out that there's an option in the cmake file to build render system gl3 plus, which I haven't tried... I'm going to build that and test how that works.
If the GL rendersystem is no longer supported shouldn't the GL3+ be enabled by default? (It might already be as my local copy is a few months behind the 2.0 branch)

paroj commented 8 years ago

[author="dark_sylinc", created="Tue, 23 Sep 2014 16:41:33 +0200"]

It repros in AMD? Awesome.
Now I think I know what you mean. I remember seeing the log being spammed once or twice, but I thought it was a feature to remind you that something was going terribly wrong.
I'll investigate into it.

"If the GL rendersystem is no longer supported shouldn't the GL3+ be enabled by default?"
In the CTP GL still is the recommended version. On the Hlms and Azdo branch, GL has been removed in favour of GL3+; but I'd admit my CMake-fu has failed me; probably even in those branches it still selects GL even though it no longer exists. I still have to do some cleanup.