we all know reading from the video ram is a real pain, now the question is; are there any neat ways to speed it up? memcpy each line into system memory and then process each pixel from there? if there are any better ways to do it then reading pixel per pixel from vram, not that i think there are, please drop me a note. thanks in advance
Edited by - Staffan on 1/22/00 12:35:31 PM
Well, I don''t think there is anything like your describing. One idea though: say you want to read a block off the screen. What you might try doing is creating an offscreen *sytem* memory surface. Then use Blt to copy the area of the backbuffer you want to read to the offscreen surface. You can then read/modify the stuff in the offscreen surface, and reupload it when you want to. It''s probably much faster then reading each pixel from the backbuffer since:
1) some cards can do Vid->Sys blts really quickly (there accelerated) 2) your not requesting it one at a time, but instead getting it in one big block
I haven''t tried this myself (never needed to read from vidmem), but I think it might work. Tell me what you think .
Well, damn, it didnt improve my previous results. The technique you described, blitting the backbuffer to an offscreen surface, read for it and update it and blt it back on to the backbuffer actually slowed it down my 2 fps. Though, just using it for reading and writing to the backbuffer manually kept it at the same speed as my original routine. Guess my assembly routines are just to damn fast to be any more optimized They''re reasonble fast so i guess ill keep them the way they are, though its become some of an obsession to see how far i can push it