I have read a lot of topics concerning screenshot image processing with CUDA, also review some SDK examples. All of them use pixel or buffer buffer objects, taking advantage of CUDA interoperability with these openGL’s objects.
I’m currently working on a project where I need to perform a screenshot of the entire window desktop and do some processing (that’s where CUDA comes in) without rendering anything. So my first idea was to create an openGL context associated with windows desktop using the WGL functions, then create a pixel buffer object and read desktop context into this buffer with glReadPixels, map this PBO to CUDA and so on. Using PBO would lead to several benefits in my running time, at least that’s what I have read.
But there is no way I can create an openGL rendering context associated with windows desktop that support buffers extensions. Docs about this says this is because the Microsoft’s generic implementation of openGL correspond to version 1.1.0 where no buffers objects existed. I have tried to make it work with the openGL implementation of my NVIDIA video card (wich correspond to version 2.1.2) but this only works with a window other than desktop. OPENGL forums don’t say anything about this, but it seems that a window that support GDI drawing (desktop is certainly one of the kind) will always lead to the generic implementation rather than to the one provided by the graphic driver.
Does somebody have any strategy in mind about how to carry Windows GDI drawing to CUDA using openGL at a reasonable speed?
In a 102476832bpp configuration it means moving 3 Mb of info, so copying it first to DRAM and then back to CUDA mem space would produce a very high latency.
Is there an answer in Direct3D? (never work with it before)
Thanks in advance!