
Generic ref and out wrappers do not copy results to the reference parameter
Posted Saturday, 17 October, 2009 - 17:59 by the Fiddler| Project: | The Open Toolkit library |
| Version: | 0.9.9-3 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | the Fiddler |
| Status: | closed |
Jump to:
Description
Issue first reported in the GL.ReadPixels broken? forum topic.
The cause is that GCHandle.Alloc() causes its parameter to be boxed, which means that OpenGL will operate on a copy of the original parameter, not the original parameter itself.
This regression was introduced along with the generic wrappers in version 0.9.6. It affects the OpenGL, OpenGL|ES and OpenCL bindings. It does not affect generic array overloads (which explains why it went unnoticed for so long.)


Comments
#1
Fixed in rev. 2339.
We should really do something about those GCHandle allocations once 1.0 is out - they box value parameters (allocating memory) and are pretty inefficient to boot.
#2
Closing issues fixed in 0.9.9-3.