the Fiddler's picture

Generic ref and out wrappers do not copy results to the reference parameter

Project:The Open Toolkit library
Category:bug report
Assigned:the Fiddler

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.)


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture


Version:0.9.6» 0.9.x-dev
Status:in progress» fixed

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.

the Fiddler's picture


Version:0.9.x-dev» 0.9.9-3
Status:fixed» closed

Closing issues fixed in 0.9.9-3.