r/programming • • Oct 04 '13

What every programmer should know about memory, Part 1

http://lwn.net/Articles/250967/
660 Upvotes

223 comments sorted by

View all comments

Show parent comments

2

u/skulgnome Oct 04 '13

Since the mid-2000s, nearly all software renderers have rearranged texture images into 4x4 chunks, because in a 8-bpc RGBA format it fits on a single cacheline. This trick increases the cache hit rate in proportion to magnification, i.e. greatly for the densest mip-map, and to between 3/4ths and half the time for smaller sizes.

Really it's just a common example of arranging data according to the use pattern.

1

u/agumonkey Oct 04 '13

Oh well, first I confused doom and quake, and I was talking about quake 1 days (first pentiums), it was a very hardware specific, I mean not cpu cache lines, but vga card bit planes. Taken from M. Abrash Black Book IIRC.

1

u/bonzinip Oct 05 '13

Yes, mode X placed every fourth pixel in the same plane.