Archived

This topic is now archived and is closed to further replies.

Writing 4 bytes at a time to the video card

This topic is 5752 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

FAQ from "Teach Yourself Game Programming in 21 Days by Andre LaMothe, 1994": 4. The 386 and 486 are 32 bit computers, why can''t I write 4 bytes at a time to the video buffer and speed things up such as the clearing the screen or bit blitting? It''s true the 386 and 486 are 32 bit, but the VGA is either 8 or 16 bit and is plugged into a 8 or 16 bit slot, so no matter what you do the results will always be 8 or 16 bit writes at a single time. --- Okay, well has computers advanced at all in these past few years? I would imagine that the modern video cards of today are 32-bit, and AGP ports are at least 32-bit? So, would it be possible writing 4 bytes at a time these days to speed up blitting?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
yep

Share this post


Link to post
Share on other sites
Actually, you should try to write 8 bytes ''at a time'', read: 2 x 32bit dwords just one after the other. If you write to AGP or video memory, it is uncached, so 8 byte aligned sequential writes will take full advantage of the write combiners in your CPU (at least on P4, Athlon XP also does quite well with 4 bytes, but 8 bytes is always better).

Also, try to write sequentially, not to hop randomly around. And NEVER read from video memory !

/ Yann

Share this post


Link to post
Share on other sites