
OpenGL 3.0 bindings
Posted Thursday, 13 November, 2008 - 19:22 by Inertia| Project: | The Open Toolkit library |
| Version: | 0.9.6 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | the Fiddler |
| Status: | closed |
Description
Ati has done its homework and over half of the GL 3.0 extensions are supported.
This feature request does not cover forward compatible contexts. No remarks about deprecation either.
I'd really like to see this going in 0.9.2, so we have all gremlins hunted down by the time 0.9.3 is due.


Comments
#41
Using new drivers, all works as expected.
GLX_EXT_visual_info GLX_EXT_visual_rating GLX_SGIX_fbconfig GLX_SGIX_pbuffer GLX_SGI_video_sync GLX_SGI_swap_control GLX_EXT_texture_from_pixmap GLX_ARB_create_context GLX_ARB_multisample GLX_NV_float_buffer GLX_ARB_fbconfig_float GLX_EXT_framebuffer_sRGB GLX_ARB_get_proc_address
Getting framebuffer config
Getting XVisualInfo
Creating colormap
Creating window
Mapping window
Creating context
Making context current
Small window flashing from blue to orange then closing.
#42
Ah great, thanks! The code seems correct, then, which points to bug in the ati drivers.
Anyone else with new-ish graphics cards, please test - if the results are consistent, I'll commit the code to SVN.
#43
I started going down the route of testing this with Ubuntu and a NVidia 8800GT, but was interrupted and never got back to it. Let me know if you still want it tested and I'll get to it.
#44
Thanks. The issue and the test program has been forwarded to Ati, so it's a matter of time before it's solved.
The code seems to work fine on Nvidia cards, so I'll add it to SVN for testing when I get the chance.
#45
I have committed initial GL3 support to trunk and will make a new release shortly. GL3 is far for complete, but it will be nice to get some testing, to fix bugs, oversights etc.
Features:
Missing stuff:
These will be addressed over the following weeks.
#46
I noticed something which I first thought might be a bug in the ATI driver, but then the same problem arose when I let someone with a nvidia test it.
The situation is this:
I have a fragment shader
and a vertex one:
The uniforms are set like so:
Now this worked perfectly with a GL2 context before gl3 branch was merged. But with a GL3 context (both trunk now and gl3 when that was first branched) the both sampler2Ds seem to have faulty value. In my application it looks both are 0.
Since this problem is reproducable on both ATI and NVidia cards, I am beginning to suspect that either my code is wrong or there is something else fishy going on.
(some time later... :)
Ok, I just made a minimal OpenTK example trying this out, and the fragments are rendered black. Both with trunk as is, and with the lines for the GL3 creating attempt commented out resulting in the creation of a GL2 context.
After copying OpenTK.*dll from an older build (r1488) and running Examples.exe again gives me the correct result.
I attached the failing code.
#47
Thanks, I'll test it tomorrow on a GL3-capable machine. Btw, these shaders shaders don't seem valid GL3.0 (you are using builtin gl_* attributes), but I think they should still work. Will have to read the specs, though.
#48
If I parsed the specs correctly, this should work with the backward compatible contexts. But it fails, on my ati machine at least, when creating a gl2 context as well.
edit: Tried with varyings in stead of the gl_* built-ins, same result.
edit2: got it.
OpenGL spec page 101:
Sampler values need to be set by calling Uniform1i{v}.
Loading samplers with any of the other Uniform* entry points is not allowed and
will result in an INVALID OPERATION error.
Using your nice new extension viewer (with entrypoints added to table) showed me GL.Uniform1 is really glUniform1ui of version30. After changing my calls to GL.Arb.Uniform1 the sample works as expected.
edit3:
This one and other unsigned versions are incorrectly generated: (param should be UInt32 v0)
I searched the gl.spec file, but the Uniform1ui entry looks good and can not find why the Uniform1i(location, v0) of VERSION_2_0 is not generated into GL namespace
#49
Thanks for catching that. This is a due to a shortcome in the binding generator - it's going to be a little hairy, but it should be fixable.
I think this might explain some abnormal behavior (borked samplers) I started seeing with 0.9.4. The conflict does not happen in older versions, which do not contain Uniform1ui (it's a 3.0 entry point).
#50
Ok, I've found a solution to the GL3/Ati problem on Linux. It seems that you need to create a temporary context before taking the address of glXCreateContextAttribsARB, *even* if it seems to suceed without that.
I have committed the new code to SVN, along with several other improvements to context creation (support for forward-compatible and debug contexts, you can now choose which OpenGL version you want).