glReadPixel with video memory

Just a hypothetical question here.

Video memory that you allocate using the memory allocation function from the NV_vertex_array_range extension does not have to be used for a vertex array, right?

So what would happen if you used the glReadPixels and glDrawPixels functions with a pointer to memory allocated this way?

Would it be faster because the image data does not need to cross the bus between the GPU and the CPU?

Or would it do that anyway and be slower?

j

j,

There is currently no extension to accelerate pixel transfer operations in the way that VAR accelerates vertex transfer, but this may change in a future driver release.

Thanks -
Cass

There is one exception to this rule that is worth noting. If you want to read back, say, GL_UNSIGNED_BYTE GL_RGBA color data and then use it as vertex colors, then go right ahead and give us a pointer to your VAR, then set up your ColorPointer appropriately.

This will not eliminate any work on our part, but you can avoid a second data copy by having us write the readback data directly into the VAR rather than into a temporary buffer that you copy into your VAR.

This could be useful for techniques like Cass’s ReadPixels-then-draw-lots-of-points per-pixel reflection demo.

Aside from that, not too useful.

  • Matt

Thanks for the responses.

I was wondering how that per-pixel bump mapping demo worked.

j