bitblt and cuda

For a while i’ve been playing around with manipulating an array of bytes and using SetDIBitsToDevice to display the output which works great
however now i want to do the same thing on the gpu and i was wondering if i could use bitblt to access the data and display its contents on the screen

i use getdibits so i could manipulate an array for the image but now i can do these perpixel changes on the gpu with cuda i’d like to do that and use bitblt to display i hope this makes sense :D

cheers

was hoping for a few more responses :P is there anything i can clarify to yield some responses?

If you’re saying that you want to directly manipulate the graphics memory to change the individual pixel values…you can’t do that.

You could do some calculations or manipulations on some data, transfer it back to the host, and then use bitblt to draw the image if you want though.

I could but generally the time taken to transfer the data from the video memory to system memory eliminates any benefits of processing on the gpu (i’m using an 8600gt)

so theres no way i can create an image on the gpu and render it to the screen?

i guess i’m trying to think in the aspect of say opengl/directx where they can instruct the gpu to render various things and have them be displayed but just for per pixel access

In the cuda samples for the particle code it seems to take a pointer to each particle and work on it through cuda without copying back to the host

Yes, you can generate image data from a CUDA kernel and display it directly using the OpenGL or Direct3D interoperability functions (without reading back the data to the CPU).

You can’t use blit functions like SetDIBitsToDevice because these only read from CPU memory.

Take a look at the “postProcessGL” sample in the SDK.

Awesome thanks alot

i used SetDIBitsToDevice for when i was processing on the cpu and i figured bitblt would work for gpu but i’ll look into opengl interoperability and the sdk

Thanks again :)