Goodbye, garbage collector!

Marco Leise Marco.Leise at gmx.de
Wed Sep 28 20:18:03 PDT 2011


Am 28.09.2011, 14:14 Uhr, schrieb Dmitry Olshansky <dmitry.olsh at gmail.com>:

> On 28.09.2011 14:30, Gor Gyolchanyan wrote:
>> I'm asking for std.allocator to be used in the language to be able to
>> use graphics card memory when doing image processing.
>> I would like to create allocators for allocating graphics card memory.
>> Perhaps even texture memory.
>> This would allow one to directly operate on pixels on the graphics
>
> All good and well, but you certainly can't operate on pixels _directly_,  
> only through API calls, OpenCL kernels and other GPU specific stuff.  
> Otherwise you just copy them to RAM modify as you see fit and copy back.

You can always map the texture memory into client address space.
http://www.opengl.org/sdk/docs/man/xhtml/glMapBuffer.xml

This allows modifications via DMA. But you cannot use the texture while  
you have it mapped. And unmapping it *may* fail in certain situations. The  
allocator interface would have to allow for locking/mapping memory blocks  
and gracefully handle the case where unlocking/umapping fails.

-- Marco


More information about the Digitalmars-d mailing list