New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenGL errors on Windows with Intel HD4000 #2571
Comments
In release mode it's fine because:
And at least particles heightmap seems to be affected because weather particles don't work as expected (there is a while when rain falls, then a while when it doesn't fall, then again it falls etc.) |
I'm trying to understand the GL_INVALID_OPERATION (I cannot reproduce the issue). I've looked up in OpenGL specifications when glDrawArrays can generate a GL_INVALID_OPERATION, but everything seems to be ok, I cannot understand why it throws an error (and why only when face = 0?). I've tried to upload data in sampleBuffer in Skybox::generateSpecularCubemap using a different way: Can you try this branch, and tell me if it changes something? |
Using this branch in my 4770k onboard: GL_INVALID_OPERATION only comes once when level = 0 and face = 0 in glDrawArrays(GL_TRIANGLES, 0, 3) skybox.cpp:303 and the other is from glDrawArrays(GL_POINTS, 0, m_count); gpu_particles.cpp:496 So in short, 7 GL_INVALID_OPERATIONs were fixed! |
I tried your fix and it looks slightly better now (it displays only one error in importance_sampling_specular.frag). Stdout.log in attachment. Actually both importance_sampling_specular.frag and particlesimheightmap.vert are using uniform samplerBuffer, so maybe it's related to this feature.
|
For the skybox it seems that your driver "prefers" uploading data in sampleBuffer with glMapBuffer instead of glBufferData. Can you test? |
Unfortunately it doesn't work for me too. @Benau are weather particles broken for you either, or you just see these errors in console? |
No idea, i don't notice gameplay so much when testing... |
Because GL_ARB_texture_buffer_object is missing in hd graphics * with intel http://addons.supertuxkart.net:8080/opengl/feature/GL_ARB_texture_buffer_object but http://addons.supertuxkart.net:8080/opengl/feature/GL_ARB_texture_buffer_object_rgb32 supports So, either we do if !cvs->GL_ARB_texture_buffer_object return; or we explicitly use rgb32 texture buffer only (waste 1 float for each buffer) or use shader storage block (less supports (4.3 feature)) (actually GL_ARB_texture_buffer_object_rgb32 has support from more players) What do you prefer? |
Also allow to use setTextureUnits for texture buffer
For now I do the return trick Btw https://www.khronos.org/opengl/wiki/Buffer_Texture#Image_formats, it said Note that the three-component formats can only be used in GL 4.0 or with _rgb32. If we care about space / use a more "straight forward approach", we should stick with ARB_texture_buffer_object? |
Could you tell me what exactly needs this extension? I trust you that it's needed. It's just interesting for me, because I was looking at this before and I thoutht that all needed features are available in OpenGL 4.0. Btw. it was also returning an error in importance sampling specular shader - probably both are related to sampler buffer uniform. And weather particles work just fine without heightmap, so it's not that big problem to just disable it on windows for intel HD4000. |
https://www.khronos.org/opengl/wiki/Buffer_Texture It said
unfortuately seems all intel on windows lack this extension, not even the ext one, but rgb32 present |
For your info, even I change internal format to glTexBuffer(GL_TEXTURE_BUFFER, GL_RGB32F, sample_buffer) there is still opengl errors Probably we can conclude that intel on windows doesn't support texture buffer object at all (or something else?) Otherwise can we close this? |
I looked at this and the ARB_texture_buffer_object looks more like a OpenGL 2.1 extension. There are luminance/intensity formats and not GL_RED/GL_RG. Also in https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_texture_buffer_object_rgb32.txt they say:
So it looks like all formats except RGB32F, RGB32I, RGB32UI are available in OpenGL 3.1, and three channel formats were added in GL 4.0 (or as extension). Which seems to have a sense, because RGB32 is something non-typical. Don't close it yet. I will try to look where the error precisely occurs for me and maybe I will find something. In worst case we can add something like isSampleBufferWorking to graphics restrictions. |
ok |
I looked at this yesterday. Here is what I noticed:
Actually in current git version particles heightmap works fine for me. The shader is compiled, glDrawArrays doesn't return invalid operation anymore and the rain in lighthouse looks fine now. I think that importance sampling specular should work too, but there is still something messed. It has two different textures attached and there are some glBindTexture calls without glActiveTexture set, so maybe this is the reason. |
Actually when I changed assignSamplerNames to:
it doesn't complain anymore and importance sampling specular works fine. But I have no idea why it works ;) |
Just to provide more information and as a reminder, because I have no more time today. The importance sampling specular shader seems to work even if there is an error. I mean, modifications in this shader take effect on the rendered scene. Though it doesn't really confirm if sampler buffer is properly attached to the shader. And the invalid operation error is generated by glDrawArrays function in generateSpecularCubemap. But what it interesting, it is generated for every first iteration of this loop (when face = 0). Every other iteration (for face = 1, 2, 3, 4, 5) doesn't give any error. |
And if we use the setTextureUnits function, active texture will be auto-called:
... |
Yes, it works! |
hmm maybe not, gles lacks TBO... |
Ok, I removed the TBO check: 299a4dc The fallback function works only with irrlicht particles, so unfortunately GLES must still work without particles heightmap affector :( |
GL_ARB_texture_buffer_object is supported on Intel, just not advertised. It's available as long as GL ≥ 3.1. See the above link to Intel Communities. |
The game looks generally fine, but some errors are printed to the console. The stable 0.9.2 version doesn't show any errors, but this may be ralated to release/debug build. I didn't look at the reason yet. Here is the stdout.log:
The text was updated successfully, but these errors were encountered: